tests/hlsl: Add some conditional flattening tests.

This commit is contained in:
Shaun Ren
2025-10-16 21:57:29 -04:00
committed by Henri Verbeet
parent cd9a5bf2b4
commit 2ba53e06fa
Notes: Henri Verbeet 2025-10-30 19:59:51 +01:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1732
2 changed files with 192 additions and 0 deletions

View File

@@ -16,6 +16,68 @@ uniform 0 float4 9 8 7 6
todo(sm<4 | glsl | msl & sm>=6) draw quad
probe (0, 0) f32(1, 2, 3, 4)
[pixel shader todo(sm<4)]
uniform float4 x;
float4 main() : sv_target
{
[flatten]
if (x.x == 9.0f)
discard;
return x;
}
[test]
uniform 0 float4 1 2 3 4
todo(sm<4 | glsl | msl & sm>=6) draw quad
probe (0, 0) f32(1, 2, 3, 4)
uniform 0 float4 9 8 7 6
todo(sm<4 | glsl | msl & sm>=6) draw quad
probe (0, 0) f32(1, 2, 3, 4)
[pixel shader todo(sm<4)]
uniform float4 x;
float4 main() : sv_target
{
float4 ret = x;
if (x.x != 9.0f)
ret.w = 4.0f;
else
discard;
return ret;
}
[test]
uniform 0 float4 1 2 3 4
todo(sm<4 | glsl | msl & sm>=6) draw quad
probe (0, 0) f32(1, 2, 3, 4)
uniform 0 float4 9 8 7 6
todo(sm<4 | glsl | msl & sm>=6) draw quad
probe (0, 0) f32(1, 2, 3, 4)
[pixel shader todo(sm<4)]
uniform float4 x;
float4 main() : sv_target
{
float4 ret = x;
[flatten]
if (x.x != 9.0f)
ret.w = 4.0f;
else
discard;
return ret;
}
[test]
uniform 0 float4 1 2 3 4
todo(sm<4 | glsl | msl & sm>=6) draw quad
probe (0, 0) f32(1, 2, 3, 4)
uniform 0 float4 9 8 7 6
todo(sm<4 | glsl | msl & sm>=6) draw quad
probe (0, 0) f32(1, 2, 3, 4)
[require]
shader model >= 3.0