From: Ethan Lee flibitijibibo@gmail.com
--- tests/sampler.shader_test | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
diff --git a/tests/sampler.shader_test b/tests/sampler.shader_test index 2cb70a0b..285d42b2 100644 --- a/tests/sampler.shader_test +++ b/tests/sampler.shader_test @@ -45,3 +45,34 @@ 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, ddx, ddy; + + p.x = position.x / 640.0f; + p.y = position.y / 480.0f; + ddx = float2(0, 0); // FIXME: asserts when dd.xy + ddy = float2(0, 0); // FIXME: asserts when dd.zw + return t.SampleGrad(s, p, ddx, ddy); +} + +[test] +uniform 0 float4 0.0 0.0 0.0 0.0 +draw quad +probe all rgba (0.25, 0, 0.25, 0) +uniform 0 float4 0.3 0.0 0.0 0.0 +draw quad +probe all rgba (0.25, 0, 0.25, 0) +uniform 0 float4 0.4 0.0 0.0 0.0 +draw quad +probe all rgba (0.25, 0, 0.25, 0) +uniform 0 float4 1.0 0.0 0.0 0.0 +draw quad +probe all rgba (0.25, 0, 0.25, 0)