tests: Add a test for SampleGrad() method.

Signed-off-by: Ethan Lee <flibitijibibo@gmail.com>
This commit is contained in:
Ethan Lee 2023-05-02 21:26:09 -04:00 committed by Alexandre Julliard
parent 1af662ae50
commit c3f10fe271
Notes: Alexandre Julliard 2023-05-23 23:13:12 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/184
2 changed files with 37 additions and 0 deletions

View File

@ -158,6 +158,7 @@ vkd3d_shader_tests = \
tests/return.shader_test \
tests/round.shader_test \
tests/sample-bias.shader_test \
tests/sample-grad.shader_test \
tests/sample-level.shader_test \
tests/sampler.shader_test \
tests/sampler-offset.shader_test \

View File

@ -0,0 +1,36 @@
[require]
shader model >= 4.0
[sampler 0]
filter linear linear linear
address clamp clamp clamp
[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 todo]
sampler s;
Texture2D t;
uniform float4 grad;
float4 main() : sv_target
{
return t.SampleGrad(s, float2(0.5, 0.5), grad.xy, grad.zw);
}
[test]
uniform 0 float4 0.0 0.0 0.0 0.0
todo draw quad
todo probe all rgba (1.0, 0.0, 1.0, 0.0)
uniform 0 float4 1.0 1.0 1.0 1.0
todo draw quad
todo probe all rgba (0.0, 0.0, 1.0, 0.0)
uniform 0 float4 2.0 2.0 2.0 2.0
todo draw quad
todo probe all rgba (0.0, 0.0, 1.0, 0.0)