2022-04-07 16:58:16 -07:00
|
|
|
[vertex shader]
|
|
|
|
void main(out float tex : texcoord, inout float4 pos : sv_position)
|
|
|
|
{
|
|
|
|
tex = pos.x;
|
|
|
|
}
|
|
|
|
|
2022-10-30 15:21:12 -07:00
|
|
|
[pixel shader todo]
|
2022-04-07 16:58:16 -07:00
|
|
|
float4 main(float tex : texcoord) : sv_target
|
2021-09-15 07:00:16 -07:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
float x = 0.0;
|
2023-04-20 23:20:32 -07:00
|
|
|
[unroll] for (i = 0; i < 10; i++)
|
2021-09-15 07:00:16 -07:00
|
|
|
{
|
|
|
|
x += i;
|
2022-04-07 16:58:16 -07:00
|
|
|
if (tex > 0.5 && i == 5)
|
2021-09-15 07:00:16 -07:00
|
|
|
break;
|
2022-04-07 16:58:16 -07:00
|
|
|
if (tex > -0.5 && i >= 7)
|
2021-09-15 07:00:16 -07:00
|
|
|
continue;
|
|
|
|
x -= 1;
|
|
|
|
}
|
|
|
|
return float4(i, x, 0.0, 0.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2022-04-14 03:52:34 -07:00
|
|
|
todo draw quad
|
2022-04-17 23:33:58 -07: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-20 23:20:32 -07: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)
|
|
|
|
|
|
|
|
[pixel shader fail]
|
|
|
|
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);
|
|
|
|
}
|