tests: Add tests for register space reservation syntax.

This commit is contained in:
Zebediah Figura 2023-08-28 17:27:29 -05:00 committed by Alexandre Julliard
parent f7a79517ae
commit 6cf065e7fd
Notes: Alexandre Julliard 2024-04-22 23:37:43 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/793
2 changed files with 140 additions and 0 deletions

View File

@ -171,6 +171,7 @@ vkd3d_shader_tests = \
tests/hlsl/register-reservations-numeric.shader_test \
tests/hlsl/register-reservations-profile.shader_test \
tests/hlsl/register-reservations-resources.shader_test \
tests/hlsl/register-reservations-space.shader_test \
tests/hlsl/return-implicit-conversion.shader_test \
tests/hlsl/return.shader_test \
tests/hlsl/round.shader_test \

View File

@ -0,0 +1,139 @@
% Tests for register space reservation syntax. We don't bother testing register
% space here, since it's specific to d3d12 and would require reworking a lot of
% the shader test code.
[require]
shader model >= 5.1
[srv 0]
size (2d, 1, 1)
0.0 0.0 0.0 99.0
[srv 1]
size (2d, 1, 1)
1.0 1.0 1.0 99.0
[srv 2]
size (2d, 1, 1)
2.0 2.0 2.0 99.0
[pixel shader todo]
Texture2D tex1 : register(t1, space0);
float4 main() : sv_target
{
return tex1.Load(int3(0, 0, 0));
}
[test]
todo(sm<6) draw quad
probe all rgba (1, 1, 1, 99)
[pixel shader todo fail(sm>=6)]
Texture2D tex1 : register(t1, sPaCe0);
float4 main() : sv_target
{
return tex1.Load(int3(0, 0, 0));
}
[test]
todo(sm<6) draw quad
probe all rgba (1, 1, 1, 99)
[pixel shader fail todo]
Texture2D tex1 : register(space0, t1);
float4 main() : sv_target
{
return tex1.Load(int3(0, 0, 0));
}
[pixel shader fail(sm<6)]
Texture2D tex1 : register(ps, space0);
float4 main() : sv_target
{
return tex1.Load(int3(0, 0, 0));
}
[test]
draw quad
probe all rgba (0, 0, 0, 99)
[pixel shader fail(sm<6)]
Texture2D tex1 : register(space0);
float4 main() : sv_target
{
return tex1.Load(int3(0, 0, 0));
}
[test]
draw quad
probe all rgba (0, 0, 0, 99)
% Specifying a profile is just broken. The first reservation (or, with sm6, the
% last) is taken regardless of whether it actually matches the current profile.
[pixel shader todo]
Texture2D tex1 : register(vs, t1, space0) : register(ps, t2, space0);
float4 main() : sv_target
{
return tex1.Load(int3(0, 0, 0));
}
[test]
todo(sm<6) draw quad
if(sm>=6) probe all rgba (2, 2, 2, 99)
if(sm<6) probe all rgba (1, 1, 1, 99)
% This actually inheres to 5.1+; it doesn't matter whether "space" is specified.
[pixel shader todo]
Texture2D tex1 : register(vs, t1) : register(ps, t2);
float4 main() : sv_target
{
return tex1.Load(int3(0, 0, 0));
}
[test]
todo(sm<6) draw quad
if(sm>=6) probe all rgba (2, 2, 2, 99)
if(sm<6) probe all rgba (1, 1, 1, 99)
% It's still illegal to specify multiple contradictory reservations with the
% same profile...
[pixel shader fail todo]
Texture2D tex1 : register(vs, t1) : register(vs, t2);
float4 main() : sv_target
{
return tex1.Load(int3(0, 0, 0));
}
% ...but it's not illegal to specify e.g. ps alongside ps_5_1.
[pixel shader todo]
Texture2D tex1 : register(ps, t1) : register(ps_5_1, t2);
float4 main() : sv_target
{
return tex1.Load(int3(0, 0, 0));
}
[test]
todo(sm<6) draw quad
if(sm>=6) probe all rgba (2, 2, 2, 99)
if(sm<6) probe all rgba (1, 1, 1, 99)