vkd3d/tests/hlsl/arithmetic-float.shader_test
Elizabeth Figura 8b4f0f348a 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.
2025-01-22 13:43:38 +01:00

79 lines
1.2 KiB
Plaintext

[pixel shader]
float4 main() : SV_TARGET
{
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 (0.20, -0.10, 0.0075, 0.33333333) 1
[pixel shader]
float4 main() : SV_TARGET
{
float x = 0.05;
float y = 0.15;
return float4(x % y, +x, -x, y % x);
}
[test]
draw quad
probe (0, 0) rgba (0.05, 0.05, -0.05, 0.0) 1
[pixel shader]
float4 main() : SV_TARGET
{
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 (0.02, -0.02, 0.02, -0.02) 16
[pixel shader]
float4 main() : SV_TARGET
{
float x = 45;
float y = 5;
return float4(x % y, -x % y, x % -y, -x % -y);
}
[test]
draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader]
float4 main() : sv_target
{
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 (0.5, -0.21, 0.4, 0.0) 6
[pixel shader fail(sm>=2&sm<4)]
float4 main() : SV_TARGET
{
float x = 1;
float y = 0;
return x / y;
}
[test]
draw quad
if(sm<2) probe (0, 0) rgba (0, 0, 0, 0)
if(sm>=4) probe (0, 0) rgba (1e99, 1e99, 1e99, 1e99)