mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
6a514ebe8e
We use vkd3d_shader_find_signature_element() in the Vulkan runner, and vkd3d-shader translates SM1 position to "POSITION".
65 lines
1.2 KiB
Plaintext
65 lines
1.2 KiB
Plaintext
[vertex shader]
|
|
void main(float4 pos : position, out float tex : texcoord, out float4 out_pos : sv_position)
|
|
{
|
|
tex = pos.x;
|
|
out_pos = pos;
|
|
}
|
|
|
|
[pixel shader]
|
|
float4 main(float tex : texcoord) : sv_target
|
|
{
|
|
int i;
|
|
float x = 0.0;
|
|
[unroll] for (i = 0; i < 10; i++)
|
|
{
|
|
x += i;
|
|
if (tex > 0.5 && i == 5)
|
|
break;
|
|
if (tex > -0.5 && i >= 7)
|
|
continue;
|
|
x -= 1;
|
|
}
|
|
return float4(i, x, 0.0, 0.0);
|
|
}
|
|
|
|
[test]
|
|
draw quad
|
|
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)
|
|
|
|
[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(sm<6)]
|
|
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);
|
|
}
|
|
|
|
[pixel shader fail]
|
|
float4 main() : sv_target
|
|
{
|
|
break;
|
|
return float4(0.0, 0.0, 0.0, 0.0);
|
|
}
|