mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
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.
79 lines
1.2 KiB
Plaintext
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)
|