[PATCH vkd3d 3/5] tests: Try to avoid using SV_Position from shaders which can be tested with SM2.
Zebediah Figura
zfigura at codeweavers.com
Wed Apr 6 16:05:36 CDT 2022
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
tests/conditional.shader_test | 11 +++++---
tests/hlsl-for.shader_test | 17 +++++++-----
tests/hlsl-struct-semantics.shader_test | 35 ++++++++++++++++++++-----
tests/trigonometry.shader_test | 31 +++++++++-------------
4 files changed, 60 insertions(+), 34 deletions(-)
diff --git a/tests/conditional.shader_test b/tests/conditional.shader_test
index 70718f117..377ec0cb8 100644
--- a/tests/conditional.shader_test
+++ b/tests/conditional.shader_test
@@ -1,13 +1,16 @@
[pixel shader]
-float4 main(float4 pos : SV_POSITION) : SV_TARGET
+float4 main(uniform float u) : SV_TARGET
{
- if(pos.x > 200.0)
+ if (u > 200.0)
return float4(0.1, 0.2, 0.3, 0.4);
else
return float4(0.9, 0.8, 0.7, 0.6);
}
[test]
+uniform 0 float 123.0
draw quad
-probe rect rgba (0, 0, 200, 480) (0.9, 0.8, 0.7, 0.6)
-probe rect rgba (200, 0, 440, 480) (0.1, 0.2, 0.3, 0.4)
+probe all rgba (0.9, 0.8, 0.7, 0.6)
+uniform 0 float 456.0
+draw quad
+probe all rgba (0.1, 0.2, 0.3, 0.4)
diff --git a/tests/hlsl-for.shader_test b/tests/hlsl-for.shader_test
index b133ce996..14a23d6e2 100644
--- a/tests/hlsl-for.shader_test
+++ b/tests/hlsl-for.shader_test
@@ -1,14 +1,14 @@
[pixel shader]
-float4 main(float4 pos : SV_POSITION) : SV_TARGET
+float4 main(uniform float u) : SV_TARGET
{
int i;
float x = 0.0;
for (i = 0; i < 10; i++)
{
x += i;
- if (pos.x == 1.5 && i == 5)
+ if (u == 1.0 && i == 5)
break;
- if (pos.x == 2.5 && i >= 7)
+ if (u == 2.0 && i >= 7)
continue;
x -= 1;
}
@@ -16,7 +16,12 @@ float4 main(float4 pos : SV_POSITION) : SV_TARGET
}
[test]
+uniform 0 float 0
draw quad
-probe rgba (0, 0) (10.0, 35.0, 0.0, 0.0)
-probe rgba (1, 0) (5.0, 10.0, 0.0, 0.0)
-probe rgba (2, 0) (10.0, 38.0, 0.0, 0.0)
+probe all rgba (10.0, 35.0, 0.0, 0.0)
+uniform 0 float 1
+draw quad
+probe all rgba (5.0, 10.0, 0.0, 0.0)
+uniform 0 float 2
+draw quad
+probe all rgba (10.0, 38.0, 0.0, 0.0)
diff --git a/tests/hlsl-struct-semantics.shader_test b/tests/hlsl-struct-semantics.shader_test
index b623a998c..c1dd87fe6 100644
--- a/tests/hlsl-struct-semantics.shader_test
+++ b/tests/hlsl-struct-semantics.shader_test
@@ -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 -1.0 -1.0
+0.0 1.0 0.0 1.0 -1.0 1.0
+0.0 1.0 0.0 1.0 1.0 -1.0
+0.0 1.0 0.0 1.0 1.0 1.0
+
+[vertex shader]
+
+struct vertex
+{
+ struct
+ {
+ float4 texcoord : texcoord;
+ float4 pos : sv_position;
+ } m;
+};
+
+void main(inout struct vertex v)
+{
+}
+
[pixel shader]
struct input
{
struct
{
- float4 pos : sv_position;
+ float4 texcoord : texcoord;
} m;
};
@@ -18,12 +43,10 @@ struct output
struct output main(struct input i)
{
struct output o;
- o.m.color = i.m.pos;
+ o.m.color = i.m.texcoord;
return o;
}
[test]
-draw quad
-probe rgba (0, 1) (0.5, 1.5, 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)
+draw triangle strip 4
+probe all rgba (0.0, 1.0, 0.0, 1.0)
diff --git a/tests/trigonometry.shader_test b/tests/trigonometry.shader_test
index 07a280a02..c8c672fe7 100644
--- a/tests/trigonometry.shader_test
+++ b/tests/trigonometry.shader_test
@@ -1,24 +1,19 @@
[pixel shader]
-float4 main(float4 pos : SV_POSITION) : SV_TARGET
+float4 main(uniform float f) : SV_TARGET
{
- return float4(sin(pos.x - 0.5), cos(pos.x - 0.5), 0, 0);
+ return float4(sin(f), cos(f), sin(f + 1.0), cos(f + 1.0));
}
[test]
+uniform 0 float 0.0
draw quad
-probe rgba ( 0, 0) ( 0.00000000, 1.00000000, 0.0, 0.0)
-probe rgba ( 1, 0) ( 0.84147098, 0.54030231, 0.0, 0.0) 1024
-probe rgba ( 2, 0) ( 0.90929743, -0.41614684, 0.0, 0.0) 1024
-probe rgba ( 3, 0) ( 0.14112001, -0.98999250, 0.0, 0.0) 1024
-probe rgba ( 4, 0) (-0.75680250, -0.65364362, 0.0, 0.0) 1024
-probe rgba ( 5, 0) (-0.95892427, 0.28366219, 0.0, 0.0) 1024
-probe rgba ( 6, 0) (-0.27941550, 0.96017029, 0.0, 0.0) 1024
-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 ( 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 (11, 0) (-0.99999021, 0.00442570, 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 (14, 0) ( 0.99060736, 0.13673722, 0.0, 0.0) 1024
-probe rgba (15, 0) ( 0.65028784, -0.75968791, 0.0, 0.0) 1024
+probe all rgba ( 0.00000000, 1.00000000, 0.84147098, 0.54030231) 1024
+uniform 0 float 2.0
+draw quad
+probe all rgba ( 0.90929743, -0.41614684, 0.14112001, -0.98999250) 1024
+uniform 0 float 4.0
+draw quad
+probe all rgba (-0.75680250, -0.65364362, -0.95892427, 0.28366219) 1024
+uniform 0 float 6.0
+draw quad
+probe all rgba (-0.27941550, 0.96017029, 0.65698660, 0.75390225) 1024
--
2.35.1
More information about the wine-devel
mailing list