From: Ethan Lee flibitijibibo@gmail.com
This is copied from the SampleGrad() test found in tests/d3d12.c.
TODO: Texture needs to be updated with the contents found in the original test!
Signed-off-by: Ethan Lee flibitijibibo@gmail.com --- tests/sampler.shader_test | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
diff --git a/tests/sampler.shader_test b/tests/sampler.shader_test index 2cb70a0b..f360e64b 100644 --- a/tests/sampler.shader_test +++ b/tests/sampler.shader_test @@ -45,3 +45,32 @@ float4 main() : sv_target [test] draw quad probe all rgba (0.25, 0, 0.25, 0) + +[pixel shader] +Texture2D t; +SamplerState s; + +float4 dd; + +float4 main(float4 position : SV_POSITION) : SV_Target +{ + float2 p; + + p.x = position.x / 640.0f; + p.y = position.y / 480.0f; + return t.SampleGrad(s, p, float2(dd.x, dd.y), float2(dd.z, dd.w)); +} + +[test] +uniform 0 float4 0.0 0.0 0.0 0.0 +draw quad +probe all rgba (0, 0, 0, 0) +uniform 0 float4 0.3 0.0 0.0 0.0 +draw quad +probe all rgba (0, 0, 0, 0) +uniform 0 float4 0.4 0.0 0.0 0.0 +draw quad +probe all rgba (0, 0, 0, 0) +uniform 0 float4 1.0 0.0 0.0 0.0 +draw quad +probe all rgba (0, 0, 0, 0)