mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
tests: Make ddx() and ddy() test behave correctly for shader models < 4.
This commit is contained in:
committed by
Alexandre Julliard
parent
62e9b86697
commit
f0584cad62
Notes:
Alexandre Julliard
2023-07-04 23:24:52 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Zebediah Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/224
@@ -1,3 +1,6 @@
|
|||||||
|
[require]
|
||||||
|
shader model >= 3.0
|
||||||
|
|
||||||
[pixel shader]
|
[pixel shader]
|
||||||
float4 main(float4 pos : sv_position) : sv_target
|
float4 main(float4 pos : sv_position) : sv_target
|
||||||
{
|
{
|
||||||
@@ -8,9 +11,15 @@ float4 main(float4 pos : sv_position) : sv_target
|
|||||||
draw quad
|
draw quad
|
||||||
probe all rgba (1.0, 1.0, 0.0, 0.0)
|
probe all rgba (1.0, 1.0, 0.0, 0.0)
|
||||||
|
|
||||||
|
|
||||||
[pixel shader]
|
[pixel shader]
|
||||||
float4 main(float4 pos : sv_position) : sv_target
|
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;
|
pos /= 10.0;
|
||||||
float nonlinear = pos.x * pos.y - pos.x * (pos.x + 0.5);
|
float nonlinear = pos.x * pos.y - pos.x * (pos.x + 0.5);
|
||||||
return float4(nonlinear, ddx(nonlinear), ddy(nonlinear), 0.0);
|
return float4(nonlinear, ddx(nonlinear), ddy(nonlinear), 0.0);
|
||||||
|
|||||||
Reference in New Issue
Block a user