2022-03-07 19:55:40 -06:00
|
|
|
[pixel shader]
|
|
|
|
float4 main() : SV_TARGET
|
|
|
|
{
|
|
|
|
int x = 5;
|
|
|
|
int y = 15;
|
|
|
|
|
2024-12-18 00:21:35 -06:00
|
|
|
return float4(x + y, x - y, x * y, x / y) / 100.0;
|
2022-03-07 19:55:40 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-11-22 15:45:54 +08:00
|
|
|
draw quad
|
2024-12-18 00:21:35 -06:00
|
|
|
probe (0, 0) rgba (0.20, -0.10, 0.75, 0.0) 1
|
2022-03-07 19:55:40 -06:00
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
float4 main() : SV_TARGET
|
|
|
|
{
|
|
|
|
int x = 5;
|
|
|
|
int y = 15;
|
|
|
|
|
2024-12-18 00:21:35 -06:00
|
|
|
return float4(x % y, +x, -x, y / x) / 10.0;
|
2022-03-07 19:55:40 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-11-22 15:45:54 +08:00
|
|
|
draw quad
|
2024-12-18 00:21:35 -06:00
|
|
|
probe (0, 0) rgba (0.5, 0.5, -0.5, 0.3)
|
2022-04-14 12:52:39 +02:00
|
|
|
|
2022-10-14 15:10:13 +02:00
|
|
|
[pixel shader]
|
|
|
|
float4 main() : SV_TARGET
|
|
|
|
{
|
|
|
|
int x = 42;
|
|
|
|
int y = 5;
|
|
|
|
|
2024-12-18 00:21:35 -06:00
|
|
|
return float4(x / y, -x / y, x / -y, -x / -y) / 10.0;
|
2022-10-14 15:10:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-11-22 15:45:54 +08:00
|
|
|
draw quad
|
2024-12-18 00:21:35 -06:00
|
|
|
probe (0, 0) rgba (0.8, -0.8, -0.8, 0.8)
|
2022-10-14 15:10:13 +02:00
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
float4 main() : SV_TARGET
|
|
|
|
{
|
|
|
|
int x = 42;
|
|
|
|
int y = 5;
|
|
|
|
|
2024-12-18 00:21:35 -06:00
|
|
|
return float4(x % y, -x % y, x % -y, -x % -y) / 10.0;
|
2022-10-14 15:10:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-11-22 15:45:54 +08:00
|
|
|
draw quad
|
2024-12-18 00:21:35 -06:00
|
|
|
probe (0, 0) rgba (0.2, -0.2, 0.2, -0.2)
|
2022-10-14 15:10:13 +02:00
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
float4 main() : SV_TARGET
|
|
|
|
{
|
|
|
|
int x = 45;
|
|
|
|
int y = 5;
|
|
|
|
|
2024-12-18 00:21:35 -06:00
|
|
|
return float4(x / y, -x / y, x / -y, -x / -y) / 10.0;
|
2022-10-14 15:10:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-11-22 15:45:54 +08:00
|
|
|
draw quad
|
2024-12-18 00:21:35 -06:00
|
|
|
probe (0, 0) rgba (0.9, -0.9, -0.9, 0.9) 1
|
2022-10-14 15:10:13 +02:00
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
float4 main() : SV_TARGET
|
|
|
|
{
|
|
|
|
int x = 45;
|
|
|
|
int y = 5;
|
|
|
|
|
|
|
|
return float4(x % y, -x % y, x % -y, -x % -y);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-11-22 15:45:54 +08:00
|
|
|
draw quad
|
2024-02-10 13:16:22 -06:00
|
|
|
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
|
2022-10-14 15:10:13 +02:00
|
|
|
|
2024-12-18 00:21:35 -06:00
|
|
|
[pixel shader fail(sm>=2&sm<6)]
|
2022-04-14 12:52:39 +02:00
|
|
|
float4 main() : SV_TARGET
|
|
|
|
{
|
|
|
|
int x = 1;
|
|
|
|
int y = 0;
|
|
|
|
|
|
|
|
return x / y;
|
|
|
|
}
|
2022-04-14 12:52:40 +02:00
|
|
|
|
2023-09-14 19:29:24 +10:00
|
|
|
[test]
|
2021-08-20 01:30:58 +05:30
|
|
|
draw quad
|
2024-02-10 13:16:22 -06:00
|
|
|
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
|
2023-09-14 19:29:24 +10:00
|
|
|
|
2024-12-18 00:21:35 -06:00
|
|
|
% Allowed regardless of shader model on 31 and below
|
|
|
|
[pixel shader fail(sm>=2&sm<6)]
|
2022-04-14 12:52:40 +02:00
|
|
|
float4 main() : SV_TARGET
|
|
|
|
{
|
|
|
|
int x = 1;
|
|
|
|
int y = 0;
|
|
|
|
|
|
|
|
return x % y;
|
|
|
|
}
|
2022-04-27 10:56:21 +02:00
|
|
|
|
2023-09-14 19:29:24 +10:00
|
|
|
[test]
|
2021-08-20 01:30:58 +05:30
|
|
|
draw quad
|
2024-02-10 13:16:22 -06:00
|
|
|
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
|
2023-09-14 19:29:24 +10:00
|
|
|
|
2024-01-29 20:07:39 -03:00
|
|
|
|
2022-04-27 10:56:21 +02:00
|
|
|
[require]
|
2024-12-18 00:21:35 -06:00
|
|
|
% Skip 1.x because of clamping.
|
|
|
|
shader model >= 2.0
|
2022-04-27 10:56:21 +02:00
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
float4 main() : SV_TARGET
|
|
|
|
{
|
|
|
|
int x = -2147483648;
|
|
|
|
int y = -1;
|
|
|
|
|
|
|
|
return x / y;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-11-22 15:45:54 +08:00
|
|
|
draw quad
|
2024-12-18 00:21:35 -06:00
|
|
|
if(sm<4) todo probe (0,0) rgba ( 2147483648.0, 2147483648.0, 2147483648.0, 2147483648.0)
|
|
|
|
if(sm>=4&sm<6) probe (0,0) rgba (-2147483648.0, -2147483648.0, -2147483648.0, -2147483648.0)
|
2024-02-10 13:16:22 -06:00
|
|
|
if(sm>=6) probe (0,0) rgba (0.0, 0.0, 0.0, 0.0)
|
2023-09-09 20:08:52 +02:00
|
|
|
|
2023-09-14 19:29:24 +10:00
|
|
|
|
2023-09-09 20:08:52 +02:00
|
|
|
[pixel shader]
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
int2 x = {5, 15};
|
|
|
|
int2 y = {2, 5};
|
|
|
|
int2 z = {3, 8};
|
|
|
|
|
|
|
|
return float4(x / y, z % y);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-11-22 15:45:54 +08:00
|
|
|
draw quad
|
2024-02-10 13:16:22 -06:00
|
|
|
probe (0, 0) rgba (2.0, 3.0, 1.0, 3.0)
|