Fix --hlsl-dx-position-w to work for SV_Position embedded in struct

Fixes #2244
This commit is contained in:
Greg Fischer
2021-12-07 14:33:09 -07:00
parent ec5ea2d6cb
commit fbb39aa461
5 changed files with 387 additions and 0 deletions

19
Test/hlsl.w-recip2.frag Normal file
View File

@@ -0,0 +1,19 @@
struct VSOutput
{
float4 PositionPS : SV_Position;
float3 PosInLightViewSpace : LIGHT_SPACE_POS;
float3 NormalWS : NORMALWS;
float2 TexCoord : TEXCOORD;
};
float4 AmbientColor = float4(1, 0.5, 0, 1);
float4 AmbientColor2 = float4(0.5, 1, 0, 0);
float4 main(VSOutput VSOut) : SV_TARGET
{
if (VSOut.PositionPS.x < 400)
return AmbientColor;
else
return AmbientColor2;
}