Francisco Casas : tests: Make ddx() and ddy() test behave correctly for shader models < 4.
Module: vkd3d Branch: master Commit: f0584cad6279e7183d039ce31963c7025014591a URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/f0584cad6279e7183d039ce31963c7... Author: Francisco Casas <fcasas(a)codeweavers.com> Date: Mon Jun 19 10:40:57 2023 -0400 tests: Make ddx() and ddy() test behave correctly for shader models < 4. --- tests/hlsl/ddxddy.shader_test | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/hlsl/ddxddy.shader_test b/tests/hlsl/ddxddy.shader_test index 8becf524..da1414b1 100644 --- a/tests/hlsl/ddxddy.shader_test +++ b/tests/hlsl/ddxddy.shader_test @@ -1,3 +1,6 @@ +[require] +shader model >= 3.0 + [pixel shader] float4 main(float4 pos : sv_position) : sv_target { @@ -8,9 +11,15 @@ float4 main(float4 pos : sv_position) : sv_target draw quad probe all rgba (1.0, 1.0, 0.0, 0.0) + [pixel shader] float4 main(float4 pos : sv_position) : sv_target { + // Shader models < 4 don't add 0.5 to sv_position, so this adjustment is required to get the + // same outputs. + pos.x = floor(pos.x) + 0.5; + pos.y = floor(pos.y) + 0.5; + pos /= 10.0; float nonlinear = pos.x * pos.y - pos.x * (pos.x + 0.5); return float4(nonlinear, ddx(nonlinear), ddy(nonlinear), 0.0);
participants (1)
-
Alexandre Julliard