1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-04 07:24:15 +01:00

[hud] Changed vertex buffer format

Should fix the HUD on Nvidia cards, which do not
support SRGB conversion for vertex input data.
This commit is contained in:
Philip Rebohle 2018-01-22 01:20:07 +01:00
parent 847d50d812
commit 05f0008891
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 17 additions and 17 deletions

View File

@ -27,17 +27,17 @@ namespace dxvk::hud {
HudPos position) { HudPos position) {
renderer.drawText(context, 16.0f, renderer.drawText(context, 16.0f,
{ position.x, position.y }, { position.x, position.y },
{ 0xFF, 0xFF, 0xFF, 0xFF }, { 1.0f, 1.0f, 1.0f, 1.0f },
m_deviceName); m_deviceName);
renderer.drawText(context, 16.0f, renderer.drawText(context, 16.0f,
{ position.x, position.y + 24 }, { position.x, position.y + 24 },
{ 0xFF, 0xFF, 0xFF, 0xFF }, { 1.0f, 1.0f, 1.0f, 1.0f },
m_driverVer); m_driverVer);
renderer.drawText(context, 16.0f, renderer.drawText(context, 16.0f,
{ position.x, position.y + 44 }, { position.x, position.y + 44 },
{ 0xFF, 0xFF, 0xFF, 0xFF }, { 1.0f, 1.0f, 1.0f, 1.0f },
m_vulkanVer); m_vulkanVer);
return HudPos { position.x, position.y + 68 }; return HudPos { position.x, position.y + 68 };

View File

@ -38,7 +38,7 @@ namespace dxvk::hud {
HudPos position) { HudPos position) {
renderer.drawText(context, 16.0f, renderer.drawText(context, 16.0f,
{ position.x, position.y }, { position.x, position.y },
{ 0xFF, 0xFF, 0xFF, 0xFF }, { 1.0f, 1.0f, 1.0f, 1.0f },
m_fpsString); m_fpsString);
return HudPos { position.x, position.y + 20 }; return HudPos { position.x, position.y + 20 };

View File

@ -35,8 +35,8 @@ namespace dxvk::hud {
const std::array<DxvkVertexAttribute, 3> ilAttributes = {{ const std::array<DxvkVertexAttribute, 3> ilAttributes = {{
{ 0, 0, VK_FORMAT_R32G32_SFLOAT, offsetof(HudTextVertex, position) }, { 0, 0, VK_FORMAT_R32G32_SFLOAT, offsetof(HudTextVertex, position) },
{ 1, 0, VK_FORMAT_R16G16_UINT, offsetof(HudTextVertex, texcoord) }, { 1, 0, VK_FORMAT_R32G32_UINT, offsetof(HudTextVertex, texcoord) },
{ 2, 0, VK_FORMAT_R8G8B8A8_SRGB, offsetof(HudTextVertex, color) }, { 2, 0, VK_FORMAT_R32G32B32A32_SFLOAT, offsetof(HudTextVertex, color) },
}}; }};
const std::array<DxvkVertexBinding, 1> ilBindings = {{ const std::array<DxvkVertexBinding, 1> ilBindings = {{
@ -89,12 +89,12 @@ namespace dxvk::hud {
const HudPos posBr = { origin.x + size.x, origin.y + size.y }; const HudPos posBr = { origin.x + size.x, origin.y + size.y };
const HudTexCoord texTl = { const HudTexCoord texTl = {
static_cast<uint16_t>(glyph.x), static_cast<uint32_t>(glyph.x),
static_cast<uint16_t>(glyph.y), }; static_cast<uint32_t>(glyph.y), };
const HudTexCoord texBr = { const HudTexCoord texBr = {
static_cast<uint16_t>(glyph.x + glyph.w), static_cast<uint32_t>(glyph.x + glyph.w),
static_cast<uint16_t>(glyph.y + glyph.h) }; static_cast<uint32_t>(glyph.y + glyph.h) };
vertexData[6 * i + 0].position = { posTl.x, posTl.y }; vertexData[6 * i + 0].position = { posTl.x, posTl.y };
vertexData[6 * i + 0].texcoord = { texTl.u, texTl.v }; vertexData[6 * i + 0].texcoord = { texTl.u, texTl.v };

View File

@ -24,8 +24,8 @@ namespace dxvk::hud {
* to pick letters in the font texture. * to pick letters in the font texture.
*/ */
struct HudTexCoord { struct HudTexCoord {
uint16_t u; uint32_t u;
uint16_t v; uint32_t v;
}; };
/** /**
@ -35,10 +35,10 @@ namespace dxvk::hud {
* will use this color for the most part. * will use this color for the most part.
*/ */
struct HudColor { struct HudColor {
uint8_t x; float x;
uint8_t y; float y;
uint8_t z; float z;
uint8_t w; float w;
}; };
/** /**