tests: Try to avoid using SV_Position from shaders which can be tested with SM1.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2022-04-07 18:58:16 -05:00 committed by Alexandre Julliard
parent d2872fa33a
commit 90b4cbc1f2
4 changed files with 63 additions and 21 deletions

View File

@ -1,7 +1,13 @@
[pixel shader] [vertex shader]
float4 main(float4 pos : SV_POSITION) : SV_TARGET void main(out float tex : texcoord, inout float4 pos : sv_position)
{ {
if(pos.x > 200.0) tex = pos.x;
}
[pixel shader]
float4 main(float tex : texcoord) : SV_TARGET
{
if (tex > 0.0)
return float4(0.1, 0.2, 0.3, 0.4); return float4(0.1, 0.2, 0.3, 0.4);
else else
return float4(0.9, 0.8, 0.7, 0.6); return float4(0.9, 0.8, 0.7, 0.6);
@ -9,5 +15,5 @@ float4 main(float4 pos : SV_POSITION) : SV_TARGET
[test] [test]
draw quad draw quad
probe rect rgba (0, 0, 200, 480) (0.9, 0.8, 0.7, 0.6) probe rect rgba ( 0, 0, 319, 480) (0.9, 0.8, 0.7, 0.6)
probe rect rgba (200, 0, 640, 480) (0.1, 0.2, 0.3, 0.4) probe rect rgba (321, 0, 640, 480) (0.1, 0.2, 0.3, 0.4)

View File

@ -1,14 +1,20 @@
[vertex shader]
void main(out float tex : texcoord, inout float4 pos : sv_position)
{
tex = pos.x;
}
[pixel shader] [pixel shader]
float4 main(float4 pos : SV_POSITION) : SV_TARGET float4 main(float tex : texcoord) : sv_target
{ {
int i; int i;
float x = 0.0; float x = 0.0;
for (i = 0; i < 10; i++) for (i = 0; i < 10; i++)
{ {
x += i; x += i;
if (pos.x == 1.5 && i == 5) if (tex > 0.5 && i == 5)
break; break;
if (pos.x == 2.5 && i >= 7) if (tex > -0.5 && i >= 7)
continue; continue;
x -= 1; x -= 1;
} }
@ -17,6 +23,6 @@ float4 main(float4 pos : SV_POSITION) : SV_TARGET
[test] [test]
draw quad draw quad
probe rgba (0, 0) (10.0, 35.0, 0.0, 0.0) probe rect rgba ( 0, 0, 159, 480) (10.0, 35.0, 0.0, 0.0)
probe rgba (1, 0) (5.0, 10.0, 0.0, 0.0) probe rect rgba (161, 0, 479, 480) (10.0, 38.0, 0.0, 0.0)
probe rgba (2, 0) (10.0, 38.0, 0.0, 0.0) probe rect rgba (481, 0, 640, 480) ( 5.0, 10.0, 0.0, 0.0)

View File

@ -1,9 +1,34 @@
[input layout]
0 r32g32b32a32 float texcoord
0 r32g32 float sv_position
[vertex buffer 0]
0.0 1.0 0.0 1.0 -2.0 -2.0
0.0 1.0 0.0 1.0 -2.0 2.0
0.0 1.0 0.0 1.0 2.0 -2.0
0.0 1.0 0.0 1.0 2.0 2.0
[vertex shader]
struct vertex
{
struct
{
float4 texcoord : texcoord;
float4 pos : sv_position;
} m;
};
void main(inout struct vertex v)
{
}
[pixel shader] [pixel shader]
struct input struct input
{ {
struct struct
{ {
float4 pos : sv_position; float4 texcoord : texcoord;
} m; } m;
}; };
@ -18,12 +43,10 @@ struct output
struct output main(struct input i) struct output main(struct input i)
{ {
struct output o; struct output o;
o.m.color = i.m.pos; o.m.color = i.m.texcoord;
return o; return o;
} }
[test] [test]
draw quad draw triangle strip 4
probe rgba (0, 1) (0.5, 1.5, 0.0, 1.0) probe all rgba (0.0, 1.0, 0.0, 1.0)
probe rgba (1, 0) (1.5, 0.5, 0.0, 1.0)
probe rgba (3, 5) (3.5, 5.5, 0.0, 1.0)

View File

@ -1,7 +1,14 @@
[pixel shader] [vertex shader]
float4 main(float4 pos : SV_POSITION) : SV_TARGET void main(out float tex : texcoord, inout float4 pos : sv_position)
{ {
return float4(sin(pos.x - 0.5), cos(pos.x - 0.5), 0, 0); tex = (pos.x + 1) * 320;
}
[pixel shader]
float4 main(float tex : texcoord) : sv_target
{
tex = floor(tex + 0.25);
return float4(sin(tex), cos(tex), 0, 0);
} }
[test] [test]
@ -17,7 +24,7 @@ probe rgba ( 7, 0) ( 0.65698660, 0.75390225, 0.0, 0.0) 1024
probe rgba ( 8, 0) ( 0.98935825, -0.14550003, 0.0, 0.0) 1024 probe rgba ( 8, 0) ( 0.98935825, -0.14550003, 0.0, 0.0) 1024
probe rgba ( 9, 0) ( 0.41211849, -0.91113026, 0.0, 0.0) 1024 probe rgba ( 9, 0) ( 0.41211849, -0.91113026, 0.0, 0.0) 1024
probe rgba (10, 0) (-0.54402111, -0.83907153, 0.0, 0.0) 1024 probe rgba (10, 0) (-0.54402111, -0.83907153, 0.0, 0.0) 1024
probe rgba (11, 0) (-0.99999021, 0.00442570, 0.0, 0.0) 1024 probe rgba (11, 0) (-0.99999021, 0.00442570, 0.0, 0.0) 2048
probe rgba (12, 0) (-0.53657292, 0.84385396, 0.0, 0.0) 1024 probe rgba (12, 0) (-0.53657292, 0.84385396, 0.0, 0.0) 1024
probe rgba (13, 0) ( 0.42016704, 0.90744678, 0.0, 0.0) 1024 probe rgba (13, 0) ( 0.42016704, 0.90744678, 0.0, 0.0) 1024
probe rgba (14, 0) ( 0.99060736, 0.13673722, 0.0, 0.0) 1024 probe rgba (14, 0) ( 0.99060736, 0.13673722, 0.0, 0.0) 1024