tests/shader-runner: Add 64-bit arithmetic tests.

This commit is contained in:
Conor McCarthy 2023-11-23 00:11:41 +10:00 committed by Alexandre Julliard
parent 8a1eb306e8
commit 27d4ccf225
Notes: Alexandre Julliard 2023-12-12 23:15:46 +01:00
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/489
2 changed files with 127 additions and 0 deletions

View File

@ -90,3 +90,53 @@ float4 main() : SV_TARGET
uniform 0 float4 1.0 0.0 0.0 0.0
draw quad
probe all rgba (1e99, 1e99, 1e99, 1e99)
[require]
shader model >= 5.0
float64
[pixel shader todo]
uniform double2 a;
float4 main() : SV_TARGET
{
double x = a.x;
double y = a.y;
return float4(x + y, x - y, x * y, x / y);
}
[test]
uniform 0 double2 7.5 -2.5
todo(sm<6) draw quad
probe all rgba (5.0, 10.0, -18.75, -3.0)
[pixel shader todo]
uniform double2 a;
float4 main() : SV_TARGET
{
double x = a.x;
double y = a.y;
return x * y;
}
[test]
uniform 0 double2 3.0e-300 2.5e300
todo(sm<6) draw quad
probe all rgba (7.5, 7.5, 7.5, 7.5)
% Note: DXC does not support modulo on doubles.
[pixel shader todo]
uniform double2 a;
float4 main() : SV_TARGET
{
double x = a.x;
double y = a.y;
return x / y;
}
[test]
uniform 0 double2 1.5e300 2.0e299
todo(sm<6) draw quad
probe all rgba (7.5, 7.5, 7.5, 7.5)

View File

@ -119,3 +119,80 @@ uniform 0 float4 45.0 5.0 50.0 10.0
uniform 4 float4 3.0 8.0 2.0 5.0
draw quad
probe all rgba (9.0, 5.0, 1.0, 3.0)
[require]
shader model >= 6.0
int64
[pixel shader]
uniform int64_t2 a;
float4 main() : SV_TARGET
{
int64_t x = a.x;
int64_t y = a.y;
return float4(x + y, x - y, x * (y >> 4), x / y);
}
[test]
uniform 0 int64_t2 5000000000 16000000000
todo draw quad
probe all rgba (21.0e9, -11.0e9, 5.0e18, 0.0) 1
[pixel shader]
uniform int64_t2 a;
float4 main() : SV_TARGET
{
int64_t x = a.x;
int64_t y = a.y;
return float4(x % y, +x, -x, y / x);
}
[test]
uniform 0 int64_t2 5000000000 16000000000
todo draw quad
probe all rgba (5.0e9, 5.0e9, -5.0e9, 3.0)
[pixel shader]
uniform int64_t2 a;
float4 main() : SV_TARGET
{
int64_t x = a.x;
int64_t y = a.y;
return float4(x / y, -x / y, x / -y, -x / -y);
}
[test]
uniform 0 int64_t2 42000000000 5000000000
todo draw quad
probe all rgba (8.0, -8.0, -8.0, 8.0)
[pixel shader]
uniform int64_t2 a;
float4 main() : SV_TARGET
{
int64_t x = a.x;
int64_t y = a.y;
return float4(x % y, -x % y, x % -y, -x % -y);
}
[test]
uniform 0 int64_t2 42000000000 5000000000
todo draw quad
probe all rgba (2.0e9, -2.0e9, 2.0e9, -2.0e9)
[pixel shader]
uniform int64_t2 a;
float4 main() : SV_TARGET
{
return float4(abs(a), 0, 0);
}
[test]
uniform 0 int64_t2 5000000000 -7000000000
todo draw quad
probe all rgba (5.0, 7.0, 0.0, 10.0)