tests: Test shader compilation within braces.

This commit is contained in:
Francisco Casas 2024-06-25 15:29:18 -04:00 committed by Henri Verbeet
parent 1d24587405
commit 9fa8921b50
Notes: Henri Verbeet 2024-08-20 21:34:57 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1006

View File

@ -152,6 +152,27 @@ PixelShader ps1 = CompileShader(ps_2_0, main());
PixelShader ps2 = ps1;
[pixel shader fail(sm<6)]
float4 main() : sv_target { return 0; }
PixelShader ps1 = 42;
[pixel shader todo]
float4 main() : sv_target { return 0; }
PixelShader ps1 = {42}; // braces make the type checking more permissive.
% This compiles, but the default value of "f" is not written.
[pixel shader todo fail(sm>=6)]
float4 fun() : sv_target { return 0; }
float f = {CompileShader(ps_2_0, fun())};
float4 main() : sv_target { return f; }
% This also compiles, but the default value of "f" is not written.
[pixel shader todo fail(sm>=6)]
float4 fun() : sv_target { return 0; }
float4 f = {1, 2, compile ps_2_0 fun(), 4};
float4 main() : sv_target { return f; }
[pixel shader fail(sm<6)]
float4 fun() : sv_target { return 0; }
@ -162,6 +183,37 @@ float4 main() : sv_target
return 0;
}
[require]
shader model >= 5.0
shader model < 6.0
% The following test segfaults on DXC.
[pixel shader todo]
float f;
float4 foo(uniform float r) : sv_target { return r; }
struct apple
{
float4 f;
PixelShader ps;
} a = {1, 2, 3, 4, compile ps_4_0 foo(f * f)};
technique
{
pass
{
PixelShader = a.ps;
}
}
float4 main() : sv_target { return 0; }
[test]
todo draw quad
probe (0, 0) rgba (0, 0, 0, 0)
[require]
shader model >= 4.0