2023-11-15 12:41:33 -08:00
|
|
|
[pixel shader todo(sm<4)]
|
2023-04-20 19:29:26 -07:00
|
|
|
uniform float4 x;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
2024-03-20 05:29:39 -07:00
|
|
|
if (x.x == 9.0f)
|
|
|
|
discard;
|
2023-04-20 19:29:26 -07:00
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
uniform 0 float4 1 2 3 4
|
2024-03-19 21:54:18 -07:00
|
|
|
todo(sm<4 | glsl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1, 2, 3, 4)
|
2023-04-20 19:29:26 -07:00
|
|
|
uniform 0 float4 9 8 7 6
|
2024-03-19 21:54:18 -07:00
|
|
|
todo(sm<4 | glsl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1, 2, 3, 4)
|
2024-03-20 05:29:39 -07:00
|
|
|
|
2024-04-12 05:06:36 -07:00
|
|
|
[require]
|
|
|
|
shader model >= 3.0
|
|
|
|
|
|
|
|
% Check that derivatives are still computed after discarding
|
|
|
|
% other pixels in the same quad
|
|
|
|
[pixel shader todo(sm<4)]
|
|
|
|
float4 main(float4 pos : sv_position) : sv_target
|
|
|
|
{
|
|
|
|
if (frac((floor(pos.x) + floor(pos.y)) / 2) == 0.5)
|
|
|
|
discard;
|
|
|
|
return float4(ddx(pos.x), ddx(pos.y), ddy(pos.x), ddy(pos.y));
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
todo(sm<4 | glsl) draw quad
|
|
|
|
probe (0, 0) rgba (1, 0, 0, 1)
|
|
|
|
probe (1, 0) rgba (1, 2, 3, 4)
|
|
|
|
probe (0, 1) rgba (1, 2, 3, 4)
|
|
|
|
probe (1, 1) rgba (1, 0, 0, 1)
|
|
|
|
probe (2, 0) rgba (1, 0, 0, 1)
|
|
|
|
probe (3, 0) rgba (1, 2, 3, 4)
|
|
|
|
probe (2, 1) rgba (1, 2, 3, 4)
|
|
|
|
probe (3, 1) rgba (1, 0, 0, 1)
|
|
|
|
|
2024-03-20 05:29:39 -07:00
|
|
|
[require]
|
|
|
|
shader model >= 5.0
|
|
|
|
|
|
|
|
[uav 1]
|
|
|
|
format r32 float
|
|
|
|
size (2d, 2, 1)
|
|
|
|
|
|
|
|
0.0 0.0
|
|
|
|
|
|
|
|
% Check that side effects stop happening after discard
|
|
|
|
[pixel shader]
|
|
|
|
uniform float4 x;
|
2024-04-12 04:42:56 -07:00
|
|
|
RWTexture2D<float> y : register(u1);
|
2024-03-20 05:29:39 -07:00
|
|
|
|
|
|
|
float4 main(float4 pos : sv_position) : sv_target
|
|
|
|
{
|
|
|
|
if (pos.x == 0.5 && pos.y == 0.5)
|
|
|
|
y[uint2(0, 0)] += 1;
|
|
|
|
if (x.x == 9.0f)
|
|
|
|
discard;
|
|
|
|
if (pos.x == 0.5 && pos.y == 0.5)
|
|
|
|
y[uint2(1, 0)] += 1;
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
uniform 0 float4 1 2 3 4
|
|
|
|
todo(glsl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1, 2, 3, 4)
|
2024-04-12 04:42:56 -07:00
|
|
|
probe uav 1 (0, 0) r (1.0)
|
|
|
|
probe uav 1 (1, 0) r (1.0)
|
2024-03-20 05:29:39 -07:00
|
|
|
uniform 0 float4 9 8 7 6
|
|
|
|
todo(glsl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1, 2, 3, 4)
|
2024-04-12 04:42:56 -07:00
|
|
|
probe uav 1 (0, 0) r (2.0)
|
|
|
|
probe uav 1 (1, 0) r (1.0)
|