[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) {
renderer.drawText(context, 16.0f,
{ position.x, position.y },
{ 0xFF, 0xFF, 0xFF, 0xFF },
{ 1.0f, 1.0f, 1.0f, 1.0f },
m_deviceName);
renderer.drawText(context, 16.0f,
{ position.x, position.y + 24 },
{ 0xFF, 0xFF, 0xFF, 0xFF },
{ 1.0f, 1.0f, 1.0f, 1.0f },
m_driverVer);
renderer.drawText(context, 16.0f,
{ position.x, position.y + 44 },
{ 0xFF, 0xFF, 0xFF, 0xFF },
{ 1.0f, 1.0f, 1.0f, 1.0f },
m_vulkanVer);
return HudPos { position.x, position.y + 68 };

View File

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

View File

@ -34,9 +34,9 @@ namespace dxvk::hud {
context->setInputAssemblyState(iaState);
const std::array<DxvkVertexAttribute, 3> ilAttributes = {{
{ 0, 0, VK_FORMAT_R32G32_SFLOAT, offsetof(HudTextVertex, position) },
{ 1, 0, VK_FORMAT_R16G16_UINT, offsetof(HudTextVertex, texcoord) },
{ 2, 0, VK_FORMAT_R8G8B8A8_SRGB, offsetof(HudTextVertex, color) },
{ 0, 0, VK_FORMAT_R32G32_SFLOAT, offsetof(HudTextVertex, position) },
{ 1, 0, VK_FORMAT_R32G32_UINT, offsetof(HudTextVertex, texcoord) },
{ 2, 0, VK_FORMAT_R32G32B32A32_SFLOAT, offsetof(HudTextVertex, color) },
}};
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 HudTexCoord texTl = {
static_cast<uint16_t>(glyph.x),
static_cast<uint16_t>(glyph.y), };
static_cast<uint32_t>(glyph.x),
static_cast<uint32_t>(glyph.y), };
const HudTexCoord texBr = {
static_cast<uint16_t>(glyph.x + glyph.w),
static_cast<uint16_t>(glyph.y + glyph.h) };
static_cast<uint32_t>(glyph.x + glyph.w),
static_cast<uint32_t>(glyph.y + glyph.h) };
vertexData[6 * i + 0].position = { posTl.x, posTl.y };
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.
*/
struct HudTexCoord {
uint16_t u;
uint16_t v;
uint32_t u;
uint32_t v;
};
/**
@ -35,10 +35,10 @@ namespace dxvk::hud {
* will use this color for the most part.
*/
struct HudColor {
uint8_t x;
uint8_t y;
uint8_t z;
uint8_t w;
float x;
float y;
float z;
float w;
};
/**