From: Francisco Casas fcasas@codeweavers.com
These tests should actually compile and run, which is possible now that we are passing the int and uint uniforms in the expected IEEE 754 float format for SM1 shaders.
Adding some todo(sm<4) qualifiers is required. --- tests/hlsl/any.shader_test | 22 ++++---- tests/hlsl/bool-cast.shader_test | 12 ++-- tests/hlsl/cast-to-float.shader_test | 8 +-- tests/hlsl/cast-to-half.shader_test | 9 +-- tests/hlsl/cast-to-int.shader_test | 9 +-- tests/hlsl/cast-to-uint.shader_test | 4 +- tests/hlsl/ceil.shader_test | 7 +-- tests/hlsl/floor.shader_test | 6 +- tests/hlsl/function-cast.shader_test | 2 - tests/hlsl/ldexp.shader_test | 6 +- tests/hlsl/lerp.shader_test | 6 +- tests/hlsl/sign.shader_test | 17 +++--- tests/hlsl/switch.shader_test | 84 +++++++++++++++------------- tests/hlsl/trunc.shader_test | 6 +- 14 files changed, 88 insertions(+), 110 deletions(-)
diff --git a/tests/hlsl/any.shader_test b/tests/hlsl/any.shader_test index afaf81fac..f2d6533c3 100644 --- a/tests/hlsl/any.shader_test +++ b/tests/hlsl/any.shader_test @@ -48,10 +48,8 @@ uniform 0 float4 -1.0 0.0 0.0 0.0 todo(sm<4) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
-[require] -shader model >= 4.0
-[pixel shader] +[pixel shader todo(sm<4)] uniform uint4 b;
float4 main() : sv_target @@ -61,25 +59,25 @@ float4 main() : sv_target
[test] uniform 0 uint4 1 1 1 1 -draw quad +todo(sm<4) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 uint4 1 0 0 0 -draw quad +todo(sm<4) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 uint4 0 1 0 0 -draw quad +todo(sm<4) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 uint4 0 0 1 0 -draw quad +todo(sm<4) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 uint4 0 0 0 1 -draw quad +todo(sm<4) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 uint4 0 0 0 0 -draw quad +todo(sm<4) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
-[pixel shader] +[pixel shader todo(sm<4)] uniform uint b;
float4 main() : sv_target @@ -89,8 +87,8 @@ float4 main() : sv_target
[test] uniform 0 uint4 1 0 0 0 -draw quad +todo(sm<4) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 uint4 0 0 0 0 -draw quad +todo(sm<4) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0) diff --git a/tests/hlsl/bool-cast.shader_test b/tests/hlsl/bool-cast.shader_test index 09ca12e2b..4a76a19ba 100644 --- a/tests/hlsl/bool-cast.shader_test +++ b/tests/hlsl/bool-cast.shader_test @@ -14,11 +14,7 @@ draw quad probe all rgba (0.0, 0.0, 1.0, 1.0)
-[require] -shader model >= 4.0 - - -[pixel shader] +[pixel shader todo(sm<4)] uniform float4 x; uniform int4 y;
@@ -30,11 +26,11 @@ float4 main() : SV_TARGET [test] uniform 0 float4 0.0 0.0 2.0 4.0 uniform 4 int4 0 1 0 10 -draw quad +todo(sm<4) draw quad probe all rgba (0.0, 10.0, 1.0, 11.0)
-[pixel shader] +[pixel shader todo(sm<4)] uniform bool4 b;
float4 main() : sv_target @@ -44,5 +40,5 @@ float4 main() : sv_target
[test] uniform 0 uint4 0x00000001 0x00000002 0x80000000 0x00000000 -draw quad +todo(sm<4) draw quad probe all rgba (2.0, 2.0, 2.0, 0.0) diff --git a/tests/hlsl/cast-to-float.shader_test b/tests/hlsl/cast-to-float.shader_test index caaf98c02..1cb34dfc4 100644 --- a/tests/hlsl/cast-to-float.shader_test +++ b/tests/hlsl/cast-to-float.shader_test @@ -1,7 +1,4 @@ -[require] -shader model >= 4.0 - -[pixel shader] +[pixel shader todo(sm<4)] uniform int i; uniform uint u; uniform bool b; @@ -17,11 +14,10 @@ uniform 0 int -1 uniform 1 uint 3 uniform 2 int -2 uniform 3 float 0.5 -draw quad +todo(sm<4) draw quad probe all rgba (0.5, 0.5, 0.5, 0.5)
[pixel shader] - float4 main() : sv_target { int i = -1; diff --git a/tests/hlsl/cast-to-half.shader_test b/tests/hlsl/cast-to-half.shader_test index b8feb6760..62439041a 100644 --- a/tests/hlsl/cast-to-half.shader_test +++ b/tests/hlsl/cast-to-half.shader_test @@ -1,7 +1,4 @@ -[require] -shader model >= 4.0 - -[pixel shader] +[pixel shader todo(sm<4)] uniform int i; uniform uint u; uniform bool b; @@ -17,11 +14,11 @@ uniform 0 int -1 uniform 1 uint 3 uniform 2 int -2 uniform 3 float 0.5 -draw quad +todo(sm<4) draw quad probe all rgba (0.5, 0.5, 0.5, 0.5)
-[pixel shader]
+[pixel shader] float4 main() : sv_target { int i = -1; diff --git a/tests/hlsl/cast-to-int.shader_test b/tests/hlsl/cast-to-int.shader_test index 3e850fb5b..4e3711cc0 100644 --- a/tests/hlsl/cast-to-int.shader_test +++ b/tests/hlsl/cast-to-int.shader_test @@ -1,7 +1,4 @@ -[require] -shader model >= 4.0 - -[pixel shader] +[pixel shader todo(sm<4)] uniform float f; uniform uint u; uniform bool b; @@ -23,11 +20,11 @@ uniform 0 float 2.6 uniform 1 int -2 uniform 2 int -2 uniform 3 float -3.6 -draw quad +todo(sm<4) draw quad probe all rgba (0.5, 0.5, 0.5, 0.5)
-[pixel shader]
+[pixel shader] float4 main() : sv_target { float f = 2.6; diff --git a/tests/hlsl/cast-to-uint.shader_test b/tests/hlsl/cast-to-uint.shader_test index 07479984a..9344fffc8 100644 --- a/tests/hlsl/cast-to-uint.shader_test +++ b/tests/hlsl/cast-to-uint.shader_test @@ -1,6 +1,8 @@ +% On SM1, uints can only be used with known-positive values. [require] shader model >= 4.0
+ [pixel shader] uniform float f; uniform int i; @@ -26,8 +28,8 @@ uniform 3 float -3.6 draw quad probe all rgba (0.5, 0.5, 0.5, 0.5)
-[pixel shader]
+[pixel shader] float4 main() : sv_target { float f = 2.6; diff --git a/tests/hlsl/ceil.shader_test b/tests/hlsl/ceil.shader_test index 46414a92b..0082c8f4e 100644 --- a/tests/hlsl/ceil.shader_test +++ b/tests/hlsl/ceil.shader_test @@ -37,10 +37,7 @@ uniform 0 float4 -0.5 6.5 7.5 3.4 todo(sm<4) draw quad probe all rgba (7.0, 8.0, 0.0, 4.0) 4
-[require] -shader model >= 4.0 - -[pixel shader] +[pixel shader todo(sm<4)] uniform int4 u;
float4 main() : sv_target @@ -53,5 +50,5 @@ float4 main() : sv_target
[test] uniform 0 int4 -1 6 7 3 -draw quad +todo(sm<4) draw quad probe all rgba (6.0, 7.0, -1.0, 3.0) 4 diff --git a/tests/hlsl/floor.shader_test b/tests/hlsl/floor.shader_test index 89e1f12ef..dc9e31f79 100644 --- a/tests/hlsl/floor.shader_test +++ b/tests/hlsl/floor.shader_test @@ -37,10 +37,8 @@ uniform 0 float4 -0.5 6.5 7.5 3.4 todo(sm<4) draw quad probe all rgba (6.0, 7.0, -1.0, 3.0) 4
-[require] -shader model >= 4.0
-[pixel shader] +[pixel shader todo(sm<4)] uniform int4 u;
float4 main() : sv_target @@ -53,5 +51,5 @@ float4 main() : sv_target
[test] uniform 0 int4 -1 6 7 3 -draw quad +todo(sm<4) draw quad probe all rgba (6.0, 7.0, -1.0, 3.0) 4 diff --git a/tests/hlsl/function-cast.shader_test b/tests/hlsl/function-cast.shader_test index c92289863..620e27d69 100644 --- a/tests/hlsl/function-cast.shader_test +++ b/tests/hlsl/function-cast.shader_test @@ -69,8 +69,6 @@ uniform 0 float4 -1.9 -1.0 2.9 4.0 todo draw quad probe all rgba (-1.0, -1.0, 2.0, 4.0)
-[require] -shader model >= 4.0
[pixel shader todo] uniform int4 i; diff --git a/tests/hlsl/ldexp.shader_test b/tests/hlsl/ldexp.shader_test index f8ad40d8e..3becf5f60 100644 --- a/tests/hlsl/ldexp.shader_test +++ b/tests/hlsl/ldexp.shader_test @@ -13,10 +13,8 @@ uniform 4 float4 0.0 -10.0 10.0 100.0 draw quad probe all rgba (2.0, 0.00292968750, 4096.0, 6.33825300e+030) 2
-[require] -shader model >= 4.0
-[pixel shader] +[pixel shader todo(sm<4)] uniform int4 x; uniform int4 y;
@@ -28,7 +26,7 @@ float4 main() : SV_TARGET [test] uniform 0 int4 2 3 4 5 uniform 4 int4 0 -10 10 100 -draw quad +todo(sm<4) draw quad probe all rgba (2.0, 0.00292968750, 4096.0, 6.33825300e+030) 2
diff --git a/tests/hlsl/lerp.shader_test b/tests/hlsl/lerp.shader_test index 15e90cef9..e3dbc1e89 100644 --- a/tests/hlsl/lerp.shader_test +++ b/tests/hlsl/lerp.shader_test @@ -15,10 +15,8 @@ uniform 8 float4 0.0 1.0 -1.0 0.75 draw quad probe all rgba (2.0, -10.0, -2.0, 76.25)
-[require] -shader model >= 4.0
-[pixel shader] +[pixel shader todo(sm<4)] uniform int4 x; uniform int4 y; uniform int4 s; @@ -32,7 +30,7 @@ float4 main() : SV_TARGET uniform 0 int4 2 3 4 0 uniform 4 int4 0 -10 10 1000000 uniform 8 int4 0 1 -1 1000000 -draw quad +todo(sm<4) draw quad probe all rgba (2.0, -10.0, -2.0, 1e12)
diff --git a/tests/hlsl/sign.shader_test b/tests/hlsl/sign.shader_test index 6ec5a571d..b72ec27c8 100644 --- a/tests/hlsl/sign.shader_test +++ b/tests/hlsl/sign.shader_test @@ -17,6 +17,7 @@ uniform 0 float4 0.0 0.0 0.0 0.0 todo(sm<4) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
+ [pixel shader todo(sm<4)] uniform float4 f;
@@ -30,6 +31,7 @@ uniform 0 float4 1.0 2.0 3.0 4.0 todo(sm<4) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
+ [pixel shader todo(sm<4)] uniform float2x2 f;
@@ -44,9 +46,6 @@ uniform 4 float4 3.0 4.0 0.0 0.0 todo(sm<4) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
-[require] -% SM1-3 doesn't support integral types -shader model >= 4.0
[pixel shader todo(sm<4)] uniform int f; @@ -58,15 +57,16 @@ float4 main() : sv_target
[test] uniform 0 int4 1 0 0 0 -draw quad +todo(sm<4) draw quad probe all rgba (1, 1, 1, 1) uniform 0 int4 -1 0 0 0 -draw quad +todo(sm<4) draw quad probe all rgba (-1, -1, -1, -1) uniform 0 int4 0 0 0 0 -draw quad +todo(sm<4) draw quad probe all rgba (0, 0, 0, 0)
+ [pixel shader todo(sm<4)] uniform int4 f;
@@ -77,9 +77,10 @@ float4 main() : sv_target
[test] uniform 0 int4 1 2 3 4 -draw quad +todo(sm<4) draw quad probe all rgba (1, 1, 1, 1)
+ [pixel shader todo(sm<4)] uniform int2x2 f;
@@ -91,5 +92,5 @@ float4 main() : sv_target [test] uniform 0 int4 1 2 0 0 uniform 4 int4 3 4 0 0 -draw quad +todo(sm<4) draw quad probe all rgba (1, 1, 1, 1) diff --git a/tests/hlsl/switch.shader_test b/tests/hlsl/switch.shader_test index 01624f97c..7b988cd7a 100644 --- a/tests/hlsl/switch.shader_test +++ b/tests/hlsl/switch.shader_test @@ -1,7 +1,4 @@ -[require] -shader model >= 4.0 - -[pixel shader] +[pixel shader todo(sm<4)] uint4 v;
float4 main() : sv_target @@ -19,17 +16,18 @@ float4 main() : sv_target
[test] uniform 0 uint4 3 0 0 0 -draw quad +todo(sm<4) draw quad probe all rgba (5.0, 5.0, 5.0, 5.0) uniform 0 uint4 1 0 0 0 -draw quad +todo(sm<4) draw quad probe all rgba (4.0, 4.0, 4.0, 4.0) uniform 0 uint4 0 0 0 0 -draw quad +todo(sm<4) draw quad probe all rgba (3.0, 3.0, 3.0, 3.0)
+ % just a default case -[pixel shader] +[pixel shader todo(sm<4)] uint4 v;
float4 main() : sv_target @@ -43,15 +41,16 @@ float4 main() : sv_target
[test] uniform 0 uint4 3 0 0 0 -draw quad +todo(sm<4) draw quad probe all rgba (5.0, 5.0, 5.0, 5.0) uniform 0 uint4 1 0 0 0 -draw quad +todo(sm<4) draw quad probe all rgba (5.0, 5.0, 5.0, 5.0) uniform 0 uint4 0 0 0 0 -draw quad +todo(sm<4) draw quad probe all rgba (5.0, 5.0, 5.0, 5.0)
+ % completely empty [pixel shader fail] uint4 v; @@ -63,8 +62,9 @@ float4 main() : sv_target } }
+ % falling through is only supported for empty case statements -[pixel shader] +[pixel shader todo(sm<4)] uint4 v;
float4 main() : sv_target @@ -84,17 +84,18 @@ float4 main() : sv_target
[test] uniform 0 uint4 2 0 0 0 -draw quad +todo(sm<4) draw quad probe all rgba (1.0, 2.0, 3.0, 4.0) uniform 0 uint4 1 0 0 0 -draw quad +todo(sm<4) draw quad probe all rgba (1.1, 2.0, 3.0, 4.0) uniform 0 uint4 0 0 0 0 -draw quad +todo(sm<4) draw quad probe all rgba (1.1, 2.0, 3.0, 4.0)
+ % case value evaluation -[pixel shader] +[pixel shader todo(sm<4)] uint4 v;
float4 main() : sv_target @@ -116,14 +117,15 @@ float4 main() : sv_target
[test] uniform 0 uint4 2 0 0 0 -todo(sm>=6) draw quad +todo(sm<4 | sm>=6) draw quad probe all rgba (1.1, 2.1, 3.1, 4.1) uniform 0 uint4 1 0 0 0 -todo(sm>=6) draw quad +todo(sm<4 | sm>=6) draw quad probe all rgba (1.0, 2.0, 3.0, 4.0)
+ % floats are accepted -[pixel shader fail(sm>=6)] +[pixel shader fail(sm>=6) todo(sm<4)] uint4 v;
float4 main() : sv_target @@ -145,13 +147,13 @@ float4 main() : sv_target
[test] uniform 0 uint4 2 0 0 0 -todo(sm>=6) draw quad +todo(sm<4 | sm>=6) draw quad probe all rgba (1.1, 2.1, 3.1, 4.1) uniform 0 uint4 1 0 0 0 -todo(sm>=6) draw quad +todo(sm<4 | sm>=6) draw quad probe all rgba (1.0, 2.0, 3.0, 4.0)
-[pixel shader fail(sm>=6)] +[pixel shader fail(sm<4 | sm>=6) todo(sm<4)] float4 v;
float4 main() : sv_target @@ -173,10 +175,10 @@ float4 main() : sv_target
[test] uniform 0 float4 2.0 0.0 0.0 0.0 -todo(sm>=6) draw quad +todo(sm<4 | sm>=6) draw quad probe all rgba (1.1, 2.1, 3.1, 4.1) uniform 0 float4 1.0 0.0 0.0 0.0 -todo(sm>=6) draw quad +todo(sm<4 | sm>=6) draw quad probe all rgba (1.0, 2.0, 3.0, 4.0)
[pixel shader fail] @@ -347,7 +349,7 @@ float4 main() : sv_target }
% more complicated breaks -[pixel shader] +[pixel shader todo(sm<4)] uint4 v;
float4 main() : sv_target @@ -374,17 +376,17 @@ float4 main() : sv_target
[test] uniform 0 uint4 2 0 0 0 -todo(sm>=6) draw quad +todo(sm<4 | sm>=6) draw quad probe all rgba (1.1, 2.1, 3.1, 4.1) uniform 0 uint4 1 0 0 0 -todo(sm>=6) draw quad +todo(sm<4 | sm>=6) draw quad probe all rgba (1.2, 2.2, 3.2, 4.2) uniform 0 uint4 0 0 0 0 -todo(sm>=6) draw quad +todo(sm<4 | sm>=6) draw quad probe all rgba (1.0, 2.0, 3.0, 4.0)
% switch breaks within a loop -[pixel shader] +[pixel shader todo(sm<4)] uint4 v;
float4 main() : sv_target @@ -412,11 +414,12 @@ float4 main() : sv_target
[test] uniform 0 uint4 2 0 0 0 -todo(sm>=6) draw quad +todo(sm<4 | sm>=6) draw quad probe all rgba (5.0, 6.0, 7.0, 8.0)
+ % default case placement -[pixel shader] +[pixel shader todo(sm<4)] uint4 v;
float4 main() : sv_target @@ -443,16 +446,17 @@ float4 main() : sv_target
[test] uniform 0 uint4 0 0 0 0 -todo(sm>=6) draw quad +todo(sm<4 | sm>=6) draw quad probe all rgba (4.0, 5.0, 6.0, 7.0) uniform 0 uint4 2 0 0 0 -todo(sm>=6) draw quad +todo(sm<4 | sm>=6) draw quad probe all rgba (2.0, 3.0, 4.0, 5.0) uniform 0 uint4 3 0 0 0 -todo(sm>=6) draw quad +todo(sm<4 | sm>=6) draw quad probe all rgba (4.0, 5.0, 6.0, 7.0)
-[pixel shader] + +[pixel shader todo(sm<4)] uint4 v;
float4 main() : sv_target @@ -480,13 +484,13 @@ float4 main() : sv_target
[test] uniform 0 uint4 3 0 0 0 -todo(sm>=6) draw quad +todo(sm<4 | sm>=6) draw quad probe all rgba (1.0, 2.0, 3.0, 4.0) uniform 0 uint4 0 0 0 0 -todo(sm>=6) draw quad +todo(sm<4 | sm>=6) draw quad probe all rgba (4.0, 5.0, 6.0, 7.0) uniform 0 uint4 5 0 0 0 -todo(sm>=6) draw quad +todo(sm<4 | sm>=6) draw quad probe all rgba (1.0, 2.0, 3.0, 4.0)
% 'continue' is not supported in switches @@ -515,7 +519,7 @@ float4 main() : sv_target return c; }
-[pixel shader] +[pixel shader fail(sm<4) todo(sm<4)] uint4 v;
float4 main() : sv_target @@ -553,7 +557,7 @@ todo(sm>=6) draw quad probe all rgba (7.0, 8.0, 9.0, 10.0)
% return from a switch nested in a loop -[pixel shader] +[pixel shader fail(sm<4) todo(sm<4)] uint4 v;
float4 main() : sv_target diff --git a/tests/hlsl/trunc.shader_test b/tests/hlsl/trunc.shader_test index f1d23bf82..8ea43f67b 100644 --- a/tests/hlsl/trunc.shader_test +++ b/tests/hlsl/trunc.shader_test @@ -30,10 +30,8 @@ uniform 0 float4 -0.5 6.5 7.5 3.4 todo(sm<4) draw quad probe all rgba (6.0, 7.0, 0.0, 3.0)
-[require] -shader model >= 4.0
-[pixel shader] +[pixel shader todo(sm<4)] uniform int4 u;
float4 main() : sv_target @@ -46,5 +44,5 @@ float4 main() : sv_target
[test] uniform 0 int4 -1 6 7 3 -draw quad +todo(sm<4) draw quad probe all rgba (6.0, 7.0, -1.0, 3.0)