From c3f10fe2712c35317eab4bf3b49e471fda90cfde Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Tue, 2 May 2023 21:26:09 -0400 Subject: [PATCH] tests: Add a test for SampleGrad() method. Signed-off-by: Ethan Lee --- Makefile.am | 1 + tests/sample-grad.shader_test | 36 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 tests/sample-grad.shader_test diff --git a/Makefile.am b/Makefile.am index 8db1bf8c..0a61365d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 \ diff --git a/tests/sample-grad.shader_test b/tests/sample-grad.shader_test new file mode 100644 index 00000000..db509730 --- /dev/null +++ b/tests/sample-grad.shader_test @@ -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)