Don't generate potentially unsupported vertex formats to ignore W

* When using VS In we want to ignore the W component, but that already happens
  explicitly for vulkan/GL in the shader. Mirror that same solution to D3D
  instead of trying to force a 3-component format which may not be supported
  (e.g. on AMD R16G16B16_*)
This commit is contained in:
baldurk
2021-09-13 19:11:28 +01:00
parent adb2b65951
commit 90f3417039
5 changed files with 27 additions and 6 deletions
+2
View File
@@ -102,6 +102,8 @@ cbuffer MeshVertexCBuffer REG(b0)
row_major float4x4 ModelViewProj;
float2 SpriteSize;
uint homogenousInput;
};
cbuffer MeshGeometryCBuffer REG(b0)
+8 -1
View File
@@ -44,7 +44,14 @@ meshV2F RENDERDOC_MeshVS(meshA2V IN, uint vid : SV_VertexID)
float2 psprite[4] = {float2(-1.0f, -1.0f), float2(-1.0f, 1.0f), float2(1.0f, -1.0f),
float2(1.0f, 1.0f)};
OUT.pos = mul(IN.pos, ModelViewProj);
float4 pos = IN.pos;
if(homogenousInput == 0u)
{
pos = float4(pos.xyz, 1);
}
OUT.pos = mul(pos, ModelViewProj);
OUT.pos.xy += SpriteSize.xy * 0.01f * psprite[vid % 4] * OUT.pos.w;
OUT.norm = float3(0, 0, 1);
OUT.secondary = IN.secondary;