tests/shader-runner: Add tests for atan and atan2 trig intrinsics.

Extracted by Conor McCarthy from an HLSL patch, with ulp values
doubled in some cases to cover SM 6 results.
This commit is contained in:
Petrichor Park 2023-12-07 11:07:42 -06:00 committed by Alexandre Julliard
parent 92044d5e41
commit e6746cbbdc
Notes: Alexandre Julliard 2024-02-06 23:43:29 +01:00
Approved-by: Conor McCarthy (@cmccarthy)
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/602

View File

@ -90,3 +90,107 @@ probe all rgba (10472.0, 0.0, 0.0, 0.0) 4096
uniform 0 float4 1.0 0.0 0.0 0.0
todo draw quad
probe all rgba (31416.0, 0.0, 0.0, 0.0)
[pixel shader todo]
uniform float4 a;
float4 main() : sv_target
{
return float4(atan(a.x), 0.0, 0.0, 0.0);
}
[test]
uniform 0 float4 -1.0 0.0 0.0 0.0
todo draw quad
probe all rgba (-0.785409629, 0.0, 0.0, 0.0) 512
uniform 0 float4 -0.5 0.0 0.0 0.0
todo draw quad
probe all rgba (-0.4636476, 0.0, 0.0, 0.0) 256
uniform 0 float4 0.0 0.0 0.0 0.0
todo draw quad
probe all rgba (0.0, 0.0, 0.0, 0.0) 256
uniform 0 float4 0.5 0.0 0.0 0.0
todo draw quad
probe all rgba (0.4636476, 0.0, 0.0, 0.0) 256
uniform 0 float4 1.0 0.0 0.0 0.0
todo draw quad
probe all rgba (0.785409629, 0.0, 0.0, 0.0) 512
[pixel shader todo]
uniform float4 a;
float4 main() : sv_target
{
// The argument order is (y,x), and test case inputs are (y,x) also.
return float4(atan2(a.x, a.y), 0.0, 0.0, 0.0);
}
[test]
% Non-degenerate cases
uniform 0 float4 1.0 1.0 0.0 0.0
todo draw quad
probe all rgba (0.785385, 0.0, 0.0, 0.0) 512
uniform 0 float4 5.0 -5.0 0.0 0.0
todo draw quad
probe all rgba (2.356194, 0.0, 0.0, 0.0) 256
uniform 0 float4 -3.0 -3.0 0.0 0.0
todo draw quad
probe all rgba (-2.356194, 0.0, 0.0, 0.0) 256
uniform 0 float4 1.0 0.0 0.0 0.0
todo draw quad
probe all rgba (1.570796, 0.0, 0.0, 0.0) 256
uniform 0 float4 -1.0 0.0 0.0 0.0
todo draw quad
probe all rgba (-1.570796, 0.0, 0.0, 0.0) 256
uniform 0 float4 0.0 1.0 0.0 0.0
todo draw quad
probe all rgba (0.0, 0.0, 0.0, 0.0) 256
uniform 0 float4 0.0 -1.0 0.0 0.0
todo draw quad
probe all rgba (3.1415927, 0.0, 0.0, 0.0) 256
% Degenerate cases
uniform 0 float4 0.00001 0.00002 0.0 0.0
todo draw quad
probe all rgba (0.463647, 0.0, 0.0, 0.0) 256
uniform 0 float4 0.00001 -0.00002 0.0 0.0
todo draw quad
probe all rgba (2.677945, 0.0, 0.0, 0.0) 256
uniform 0 float4 -0.00001 100000.0 0.0 0.0
todo draw quad
probe all rgba (-0.000000000099986595, 0.0, 0.0, 0.0) 2048
uniform 0 float4 10000000.0 0.00000001 0.0 0.0
todo draw quad
probe all rgba (1.570796, 0.0, 0.0, 0.0) 256
% Negative zero behavior should be to treat it the
% same as normal zero.
uniform 0 float4 1000000000.0 0.0 0.0 0.0
todo draw quad
probe all rgba (1.570796, 0.0, 0.0, 0.0) 256
uniform 0 float4 1000000000.0 -0.0 0.0 0.0
todo draw quad
probe all rgba (1.570796, 0.0, 0.0, 0.0) 256
uniform 0 float4 0.0 -1.0 0.0 0.0
todo draw quad
probe all rgba (3.1415927, 0.0, 0.0, 0.0) 256
uniform 0 float4 -0.0 -1.0 0.0 0.0
todo draw quad
probe all rgba (3.1415927, 0.0, 0.0, 0.0) 256