2022-04-07 18:58:16 -05:00
|
|
|
[vertex shader]
|
|
|
|
void main(out float tex : texcoord, inout float4 pos : sv_position)
|
|
|
|
{
|
|
|
|
tex = pos.x;
|
|
|
|
}
|
|
|
|
|
2023-09-25 20:44:05 +02:00
|
|
|
[pixel shader]
|
2022-04-07 18:58:16 -05:00
|
|
|
float4 main(float tex : texcoord) : sv_target
|
2021-09-15 16:00:16 +02:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
float x = 0.0;
|
2023-04-21 08:20:32 +02:00
|
|
|
[unroll] for (i = 0; i < 10; i++)
|
2021-09-15 16:00:16 +02:00
|
|
|
{
|
|
|
|
x += i;
|
2022-04-07 18:58:16 -05:00
|
|
|
if (tex > 0.5 && i == 5)
|
2021-09-15 16:00:16 +02:00
|
|
|
break;
|
2022-04-07 18:58:16 -05:00
|
|
|
if (tex > -0.5 && i >= 7)
|
2021-09-15 16:00:16 +02:00
|
|
|
continue;
|
|
|
|
x -= 1;
|
|
|
|
}
|
|
|
|
return float4(i, x, 0.0, 0.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2023-09-14 19:29:24 +10:00
|
|
|
todo(sm>=6) draw quad
|
2022-04-18 08:33:58 +02:00
|
|
|
probe ( 0, 0, 159, 480) rgba (10.0, 35.0, 0.0, 0.0)
|
|
|
|
probe (161, 0, 479, 480) rgba (10.0, 38.0, 0.0, 0.0)
|
|
|
|
probe (481, 0, 640, 480) rgba ( 5.0, 10.0, 0.0, 0.0)
|
2023-04-21 08:20:32 +02:00
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
float4 main(float tex : texcoord) : sv_target
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
float x = 0.0;
|
|
|
|
[unroll] [attr1] for (i = 0; i < 10; i++)
|
|
|
|
{
|
|
|
|
x += i;
|
|
|
|
}
|
|
|
|
return float4(i, x, 0.0, 0.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
draw quad
|
|
|
|
probe all rgba (10.0, 45.0, 0.0, 0.0)
|
|
|
|
|
2023-09-14 19:29:24 +10:00
|
|
|
[pixel shader fail(sm<6)]
|
2023-04-21 08:20:32 +02:00
|
|
|
float4 main(float tex : texcoord) : sv_target
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
float x = 0.0;
|
|
|
|
[unroll] [unroll] for (i = 0; i < 10; i++)
|
|
|
|
{
|
|
|
|
x += i;
|
|
|
|
}
|
|
|
|
return float4(i, x, 0.0, 0.0);
|
|
|
|
}
|
2023-09-25 16:30:02 +02:00
|
|
|
|
|
|
|
[pixel shader fail]
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
return float4(0.0, 0.0, 0.0, 0.0);
|
|
|
|
}
|