tests: Adjust arithmetic-float.shader_test to pass with 1.x.

Pixel shader 1.x constants must be between -1 and 1, or they will be clamped,
even constants defined in the shader.

Also mark 1.x-specific features if any.
This commit is contained in:
Elizabeth Figura 2024-12-18 00:13:22 -06:00 committed by Henri Verbeet
parent 5f55f5adc7
commit 8b4f0f348a
Notes: Henri Verbeet 2025-01-22 15:03:30 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1324

View File

@ -1,41 +1,41 @@
[pixel shader]
float4 main() : SV_TARGET
{
float x = 5.0;
float y = 15.0;
float x = 0.05;
float y = 0.15;
return float4(x + y, x - y, x * y, x / y);
}
[test]
draw quad
probe (0, 0) rgba (20.0, -10.0, 75.0, 0.33333333)
probe (0, 0) rgba (0.20, -0.10, 0.0075, 0.33333333) 1
[pixel shader]
float4 main() : SV_TARGET
{
float x = 5.0;
float y = 15.0;
float x = 0.05;
float y = 0.15;
return float4(x % y, +x, -x, y / x);
return float4(x % y, +x, -x, y % x);
}
[test]
draw quad
probe (0, 0) rgba (5.0, 5.0, -5.0, 3.0)
probe (0, 0) rgba (0.05, 0.05, -0.05, 0.0) 1
[pixel shader]
float4 main() : SV_TARGET
{
float x = 42;
float y = 5;
float x = 0.42;
float y = 0.05;
return float4(x % y, -x % y, x % -y, -x % -y);
}
[test]
draw quad
probe (0, 0) rgba (2.0, -2.0, 2.0, -2.0) 16
probe (0, 0) rgba (0.02, -0.02, 0.02, -0.02) 16
[pixel shader]
float4 main() : SV_TARGET
@ -53,21 +53,17 @@ probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader]
float4 main() : sv_target
{
float4 x = {5.0, -42.1, 4.0, 45.0};
float4 y = {15.0, -5.0, 4.1, 5.0};
float4 x = {0.5, -4.21, 0.4, 45.0};
float4 y = {1.5, -0.5, 0.41, 5.0};
return x % y;
}
[test]
draw quad
probe (0, 0) rgba (5.0, -2.1, 4.0, 0.0) 6
probe (0, 0) rgba (0.5, -0.21, 0.4, 0.0) 6
[require]
% Infinities are not allowed in SM1
shader model >= 4.0
[pixel shader]
[pixel shader fail(sm>=2&sm<4)]
float4 main() : SV_TARGET
{
float x = 1;
@ -78,4 +74,5 @@ float4 main() : SV_TARGET
[test]
draw quad
probe (0, 0) rgba (1e99, 1e99, 1e99, 1e99)
if(sm<2) probe (0, 0) rgba (0, 0, 0, 0)
if(sm>=4) probe (0, 0) rgba (1e99, 1e99, 1e99, 1e99)