tests: Add a test for loading from nonzero mipmap levels.

This commit is contained in:
Zebediah Figura 2023-04-30 19:27:41 -05:00 committed by Alexandre Julliard
parent c940486a89
commit e3eb4fc5eb
Notes: Alexandre Julliard 2023-05-08 22:34:30 +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/191
2 changed files with 52 additions and 0 deletions

View File

@ -133,6 +133,7 @@ vkd3d_shader_tests = \
tests/hlsl-vector-indexing.shader_test \
tests/hlsl-vector-indexing-uniform.shader_test \
tests/lit.shader_test \
tests/load-level.shader_test \
tests/log.shader_test \
tests/logic-operations.shader_test \
tests/majority-syntax.shader_test \

View File

@ -0,0 +1,51 @@
[require]
shader model >= 4.0
[texture 0]
size (2, 2)
levels 2
1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0
1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0
0.0 0.0 1.0 0.0
[pixel shader]
sampler s;
Texture2D t;
uniform uint level;
float4 main() : sv_target
{
return t.Load(uint3(0, 0, level));
}
[test]
uniform 0 uint 0
draw quad
probe all rgba (1.0, 0.0, 1.0, 0.0)
uniform 0 uint 1
draw quad
probe all rgba (0.0, 0.0, 1.0, 0.0)
[pixel shader fail]
sampler s;
Texture2D t;
float4 main() : sv_target
{
return t[uint3(0, 0, 0)];
}
[pixel shader]
sampler s;
Texture2D t;
float4 main() : sv_target
{
return t[uint2(0, 0)];
}
[test]
draw quad
probe all rgba (1.0, 0.0, 1.0, 0.0)