From 007792c33b9993a1749fcc26d05ac441653c2c62 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 2 Sep 2025 20:57:51 +0200 Subject: [PATCH] vkd3d-shader/msl: Handle VSIR_DATA_BOOL operands. --- libs/vkd3d-shader/msl.c | 7 ++-- tests/hlsl/all.shader_test | 14 ++++---- tests/hlsl/any.shader_test | 36 +++++++++---------- tests/hlsl/bool-cast.shader_test | 4 +-- tests/hlsl/cast-to-float.shader_test | 2 +- tests/hlsl/cast-to-half.shader_test | 2 +- tests/hlsl/cast-to-int.shader_test | 2 +- tests/hlsl/cast-to-uint.shader_test | 2 +- tests/hlsl/cf-cond-types.shader_test | 4 +-- tests/hlsl/clip.shader_test | 12 +++---- tests/hlsl/conditional.shader_test | 37 +++++++++----------- tests/hlsl/faceforward.shader_test | 14 ++++---- tests/hlsl/float-comparison.shader_test | 2 +- tests/hlsl/fmod.shader_test | 8 ++--- tests/hlsl/for.shader_test | 4 +-- tests/hlsl/frexp.shader_test | 20 +++++------ tests/hlsl/function-return.shader_test | 28 +++++++-------- tests/hlsl/hard-copy-prop.shader_test | 14 ++++---- tests/hlsl/lit.shader_test | 8 ++--- tests/hlsl/logic-operations.shader_test | 8 ++--- tests/hlsl/loop.shader_test | 6 ++-- tests/hlsl/refract.shader_test | 24 ++++++------- tests/hlsl/return.shader_test | 44 ++++++++++++------------ tests/hlsl/sm6-ternary.shader_test | 8 ++--- tests/hlsl/step.shader_test | 2 +- tests/hlsl/switch.shader_test | 41 ++++++++++------------ tests/hlsl/unroll.shader_test | 2 +- tests/hlsl/vertex-shader-ops.shader_test | 13 +++---- 28 files changed, 178 insertions(+), 190 deletions(-) diff --git a/libs/vkd3d-shader/msl.c b/libs/vkd3d-shader/msl.c index 9150e77e2..2005e8422 100644 --- a/libs/vkd3d-shader/msl.c +++ b/libs/vkd3d-shader/msl.c @@ -167,6 +167,7 @@ static void msl_print_register_datatype(struct vkd3d_string_buffer *buffer, case VSIR_DATA_F32: vkd3d_string_buffer_printf(buffer, "f"); break; + case VSIR_DATA_BOOL: case VSIR_DATA_I32: vkd3d_string_buffer_printf(buffer, "i"); break; @@ -799,6 +800,7 @@ static void msl_relop(struct msl_generator *gen, const struct vkd3d_shader_instr static void msl_cast(struct msl_generator *gen, const struct vkd3d_shader_instruction *ins, const char *constructor) { unsigned int component_count; + const char *negate; struct msl_src src; struct msl_dst dst; uint32_t mask; @@ -806,10 +808,11 @@ static void msl_cast(struct msl_generator *gen, const struct vkd3d_shader_instru mask = msl_dst_init(&dst, gen, ins, &ins->dst[0]); msl_src_init(&src, gen, &ins->src[0], mask); + negate = ins->opcode == VSIR_OP_UTOF && data_type_is_bool(ins->src[0].reg.data_type) ? "-" : ""; if ((component_count = vsir_write_mask_component_count(mask)) > 1) - msl_print_assignment(gen, &dst, "%s%u(%s)", constructor, component_count, src.str->buffer); + msl_print_assignment(gen, &dst, "%s%u(%s%s)", constructor, component_count, negate, src.str->buffer); else - msl_print_assignment(gen, &dst, "%s(%s)", constructor, src.str->buffer); + msl_print_assignment(gen, &dst, "%s(%s%s)", constructor, negate, src.str->buffer); msl_src_cleanup(&src, &gen->string_buffers); msl_dst_cleanup(&dst, &gen->string_buffers); diff --git a/tests/hlsl/all.shader_test b/tests/hlsl/all.shader_test index 71267e33e..51b41a3d7 100644 --- a/tests/hlsl/all.shader_test +++ b/tests/hlsl/all.shader_test @@ -11,17 +11,17 @@ float4 main() : sv_target [test] uniform 0 float4 -1.1 1.6 1.3 0.5 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) [test] uniform 0 float4 0.0 1.6 1.3 0.5 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) [test] uniform 0 float4 1.0 0.0 1.3 0.5 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) [pixel shader] @@ -34,12 +34,12 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 0.0 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) [test] uniform 0 float4 0.0 0.0 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) [pixel shader] @@ -53,11 +53,11 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 0.0 0.0 uniform 4 float4 3.0 4.0 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) [test] uniform 0 float4 1.0 2.0 0.0 0.0 uniform 4 float4 0.0 4.0 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) diff --git a/tests/hlsl/any.shader_test b/tests/hlsl/any.shader_test index a6714d5ea..c939b7cde 100644 --- a/tests/hlsl/any.shader_test +++ b/tests/hlsl/any.shader_test @@ -8,25 +8,25 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 1.0 1.0 1.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 1.0 0.0 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 1.0 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 0.0 1.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 0.0 0.0 1.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 0.0 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) uniform 0 float4 -1.0 -1.0 -1.0 -1.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) [pixel shader] @@ -39,13 +39,13 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 0.0 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 0.0 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) uniform 0 float4 -1.0 0.0 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) @@ -60,27 +60,27 @@ float4 main() : sv_target [test] if(sm<4) uniform 0 float4 1 1 1 1 if(sm>=4) uniform 0 uint4 1 1 1 1 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) if(sm<4) uniform 0 float4 1 0 0 0 if(sm>=4) uniform 0 uint4 1 0 0 0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) if(sm<4) uniform 0 float4 0 1 0 0 if(sm>=4) uniform 0 uint4 0 1 0 0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) if(sm<4) uniform 0 float4 0 0 1 0 if(sm>=4) uniform 0 uint4 0 0 1 0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) if(sm<4) uniform 0 float4 0 0 0 1 if(sm>=4) uniform 0 uint4 0 0 0 1 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) if(sm<4) uniform 0 float4 0 0 0 0 if(sm>=4) uniform 0 uint4 0 0 0 0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) [pixel shader] @@ -94,9 +94,9 @@ float4 main() : sv_target [test] if(sm<4) uniform 0 float4 1 0 0 0 if(sm>=4) uniform 0 uint4 1 0 0 0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) if(sm<4) uniform 0 float4 0 0 0 0 if(sm>=4) uniform 0 uint4 0 0 0 0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) 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 c8936eb00..6aeec9537 100644 --- a/tests/hlsl/bool-cast.shader_test +++ b/tests/hlsl/bool-cast.shader_test @@ -27,7 +27,7 @@ float4 main() : SV_TARGET uniform 0 float4 0.0 0.0 2.0 4.0 if(sm<4) uniform 4 float4 0 1 0 10 if(sm>=4) uniform 4 int4 0 1 0 10 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.0, 10.0, 1.0, 11.0) @@ -42,5 +42,5 @@ float4 main() : sv_target [test] if(sm<4) uniform 0 float4 1.0 1.0 1.0 0.0 if(sm>=4) uniform 0 uint4 0x00000001 0x00000002 0x80000000 0x00000000 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) 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 2c7360aef..e1f9f9cd7 100644 --- a/tests/hlsl/cast-to-float.shader_test +++ b/tests/hlsl/cast-to-float.shader_test @@ -18,7 +18,7 @@ if(sm>=4) uniform 0 int -1 if(sm>=4) uniform 1 uint 3 if(sm>=4) uniform 2 int -2 if(sm>=4) uniform 3 float 0.5 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.5, 0.5, 0.5, 0.5) diff --git a/tests/hlsl/cast-to-half.shader_test b/tests/hlsl/cast-to-half.shader_test index ba078048a..a6846c084 100644 --- a/tests/hlsl/cast-to-half.shader_test +++ b/tests/hlsl/cast-to-half.shader_test @@ -18,7 +18,7 @@ if(sm>=4) uniform 0 int -1 if(sm>=4) uniform 1 uint 3 if(sm>=4) uniform 2 int -2 if(sm>=4) uniform 3 float 0.5 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.5, 0.5, 0.5, 0.5) diff --git a/tests/hlsl/cast-to-int.shader_test b/tests/hlsl/cast-to-int.shader_test index 2f8b7b3e7..48ea569f5 100644 --- a/tests/hlsl/cast-to-int.shader_test +++ b/tests/hlsl/cast-to-int.shader_test @@ -59,7 +59,7 @@ if(sm>=4) uniform 0 float 2.6 if(sm>=4) uniform 1 int -2 if(sm>=4) uniform 2 int -2 if(sm>=4) uniform 3 float -3.6 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.5, 0.5, 0.5, 0.5) diff --git a/tests/hlsl/cast-to-uint.shader_test b/tests/hlsl/cast-to-uint.shader_test index 94d30b0ef..caf786cc6 100644 --- a/tests/hlsl/cast-to-uint.shader_test +++ b/tests/hlsl/cast-to-uint.shader_test @@ -25,7 +25,7 @@ uniform 0 float 2.6 uniform 1 int 2 uniform 2 int -2 uniform 3 float -3.6 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.5, 0.5, 0.5, 0.5) diff --git a/tests/hlsl/cf-cond-types.shader_test b/tests/hlsl/cf-cond-types.shader_test index f14c639df..ce49600a2 100644 --- a/tests/hlsl/cf-cond-types.shader_test +++ b/tests/hlsl/cf-cond-types.shader_test @@ -124,8 +124,8 @@ float4 main() : sv_target [test] uniform 0 float4 -2.0 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 -0.0 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) diff --git a/tests/hlsl/clip.shader_test b/tests/hlsl/clip.shader_test index 03dd8ce48..bb7597cfd 100644 --- a/tests/hlsl/clip.shader_test +++ b/tests/hlsl/clip.shader_test @@ -9,20 +9,20 @@ float4 main() : sv_target [test] uniform 0 float4 1 2 3 4 -todo(glsl | msl & sm>=6) draw quad +todo(glsl) draw quad probe (0, 0) rgba (1, 2, 3, 4) uniform 0 float4 9 8 7 6 -todo(glsl | msl & sm>=6) draw quad +todo(glsl) draw quad probe (0, 0) rgba (9, 8, 7, 6) uniform 0 float4 -1 8 7 6 -todo(glsl | msl & sm>=6) draw quad +todo(glsl) draw quad probe (0, 0) rgba (9, 8, 7, 6) uniform 0 float4 9 0 7 6 -todo(glsl | msl & sm>=6) draw quad +todo(glsl) draw quad probe (0, 0) rgba (9, 0, 7, 6) uniform 0 float4 3 -8 3 0 -todo(glsl | msl & sm>=6) draw quad +todo(glsl) draw quad probe (0, 0) rgba (9, 0, 7, 6) uniform 0 float4 3 3 3 -1 -todo(glsl | msl & sm>=6) draw quad +todo(glsl) draw quad probe (0, 0) rgba (9, 0, 7, 6) diff --git a/tests/hlsl/conditional.shader_test b/tests/hlsl/conditional.shader_test index 26c29485d..d4c6b432d 100644 --- a/tests/hlsl/conditional.shader_test +++ b/tests/hlsl/conditional.shader_test @@ -11,10 +11,10 @@ float4 main() : sv_target [test] uniform 0 float4 0.0 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.9, 0.8, 0.7, 0.6) uniform 0 float4 0.1 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4) [pixel shader todo(sm<4)] @@ -43,7 +43,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.0 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.9, 0.8, 0.7, 0.6) [pixel shader fail(sm<6)] @@ -87,13 +87,12 @@ float4 main() : sv_target [test] uniform 0 float -2 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1, 2, 3, 4) uniform 0 float 10 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (10, 20, 30, 40) - [pixel shader] uniform float4 u; @@ -108,7 +107,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.0 0.0 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.9, 0.8, 0.7, 0.6) [pixel shader] @@ -145,22 +144,21 @@ if(sm<4) uniform 0 float 8 if(sm<4) uniform 4 float 9 if(sm>=4) uniform 0 int 8 if(sm>=4) uniform 1 int 9 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (-1.0, -1.0, -1.0, -1.0) if(sm<4) uniform 0 float -3 if(sm<4) uniform 4 float -4 if(sm>=4) uniform 0 int -3 if(sm>=4) uniform 1 int -4 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) if(sm<4) uniform 0 float 7 if(sm<4) uniform 4 float 7 if(sm>=4) uniform 0 int 7 if(sm>=4) uniform 1 int 7 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) - [pixel shader] int a, b; @@ -177,22 +175,21 @@ if(sm<4) uniform 0 float 8 if(sm<4) uniform 4 float 9 if(sm>=4) uniform 0 int 8 if(sm>=4) uniform 1 int 9 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (-1.0, -1.0, -1.0, -1.0) if(sm<4) uniform 0 float -3 if(sm<4) uniform 4 float -4 if(sm>=4) uniform 0 int -3 if(sm>=4) uniform 1 int -4 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) if(sm<4) uniform 0 float 7 if(sm<4) uniform 4 float 7 if(sm>=4) uniform 0 int 7 if(sm>=4) uniform 1 int 7 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (-1.0, -1.0, -1.0, -1.0) - [pixel shader] int a, b; @@ -209,16 +206,15 @@ if(sm<4) uniform 0 float -3 if(sm<4) uniform 4 float -2 if(sm>=4) uniform 0 int -3 if(sm>=4) uniform 1 int -2 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (-1.0, -1.0, -1.0, -1.0) if(sm<4) uniform 0 float 4 if(sm<4) uniform 4 float 4 if(sm>=4) uniform 0 int 4 if(sm>=4) uniform 1 int 4 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) - % Test "if" conditionals, using resource loads to ensure we aren't removing these instruction with optimizations. [srv 0] size (2d, 2, 2) @@ -243,13 +239,12 @@ float4 main() : sv_target [test] uniform 0 float -2 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 4.0) uniform 0 float 4 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0) - [pixel shader] Texture2D tex; sampler sam; diff --git a/tests/hlsl/faceforward.shader_test b/tests/hlsl/faceforward.shader_test index cce24775e..283594c2f 100644 --- a/tests/hlsl/faceforward.shader_test +++ b/tests/hlsl/faceforward.shader_test @@ -12,41 +12,41 @@ float4 main() : sv_target uniform 0 float4 10.0 20.0 30.0 40.0 uniform 4 float4 1.0 0.0 0.0 0.0 uniform 8 float4 1.0 0.2 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (-10.0, -20.0, -30.0, -40.0) uniform 0 float4 10.0 20.0 30.0 40.0 uniform 4 float4 1.0 0.0 0.0 0.0 uniform 8 float4 1.0 -0.2 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (-10.0, -20.0, -30.0, -40.0) uniform 0 float4 10.0 20.0 30.0 40.0 uniform 4 float4 1.0 0.0 0.0 0.0 uniform 8 float4 -1.0 0.0 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (10.0, 20.0, 30.0, 40.0) uniform 0 float4 10.0 20.0 30.0 40.0 uniform 4 float4 0.0 -1.0 0.0 0.0 uniform 8 float4 0.0 1.0 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (10.0, 20.0, 30.0, 40.0) uniform 0 float4 10.0 20.0 30.0 40.0 uniform 4 float4 1.0 0.0 0.0 0.0 uniform 8 float4 0.0 1.0 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (-10.0, -20.0, -30.0, -40.0) uniform 0 float4 10.0 20.0 30.0 40.0 uniform 4 float4 0.0 0.0 0.0 0.0 uniform 8 float4 0.0 1.0 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (-10.0, -20.0, -30.0, -40.0) uniform 0 float4 10.0 20.0 30.0 40.0 uniform 4 float4 0.0 0.0 0.0 0.0 uniform 8 float4 0.0 0.0 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (-10.0, -20.0, -30.0, -40.0) diff --git a/tests/hlsl/float-comparison.shader_test b/tests/hlsl/float-comparison.shader_test index 1818e145a..df5d8007b 100644 --- a/tests/hlsl/float-comparison.shader_test +++ b/tests/hlsl/float-comparison.shader_test @@ -9,7 +9,7 @@ float4 main() : sv_target [test] uniform 0 float 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) diff --git a/tests/hlsl/fmod.shader_test b/tests/hlsl/fmod.shader_test index e24c2a206..7d51ac7f6 100644 --- a/tests/hlsl/fmod.shader_test +++ b/tests/hlsl/fmod.shader_test @@ -8,10 +8,10 @@ float4 main() : sv_target [test] uniform 0 float4 -0.5 6.5 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (-0.5, 0.0, 0.0, 0.0) 4 uniform 0 float4 1.1 0.3 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.2, 0.0, 0.0, 0.0) 4 [pixel shader] @@ -24,8 +24,8 @@ float4 main() : sv_target [test] uniform 0 float4 -0.5 6.5 2.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (-0.5, 0.5, 0.0, 0.0) 4 uniform 0 float4 1.1 0.3 3.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.1, 0.3, 0.0, 0.0) 4 diff --git a/tests/hlsl/for.shader_test b/tests/hlsl/for.shader_test index 07f8fe4b7..e49cf09e3 100644 --- a/tests/hlsl/for.shader_test +++ b/tests/hlsl/for.shader_test @@ -23,7 +23,7 @@ float4 main(float tex : texcoord) : sv_target } [test] -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) 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) @@ -54,7 +54,7 @@ float4 main(float tex : texcoord) : sv_target [test] uniform 0 uint4 10 0 0 0 -todo(msl & sm>=6) draw quad +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) diff --git a/tests/hlsl/frexp.shader_test b/tests/hlsl/frexp.shader_test index bbea71825..3d9b75b7f 100644 --- a/tests/hlsl/frexp.shader_test +++ b/tests/hlsl/frexp.shader_test @@ -10,49 +10,49 @@ float4 main() : sv_target [test] uniform 0 float4 3.1415927 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) f32(2.0, 0.785398185, 0.0, 0.0) uniform 0 float4 -3.1415927 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad if(sm<4) probe (0, 0) f32(2.0, -0.785398185, 0.0, 0.0) % Starting with shader model 4, negative inputs give positive mantissa. if(sm>=4) probe (0, 0) f32(2.0, 0.785398185, 0.0, 0.0) uniform 0 float4 7604.123 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) f32(13.0, 0.92823765, 0.0, 0.0) uniform 0 float4 0.00001234 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) f32(-16.0, 0.8087142, 0.0, 0.0) uniform 0 float4 0.0 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) f32(0.0, 0.0, 0.0, 0.0) uniform 0 float4 -0.0 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) f32(0.0, 0.0, 0.0, 0.0) uniform 0 float4 INF 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad if(sm<4) probe (0, 0) f32(-NAN, -NAN, 0, 0) if(sm>=4) probe (0, 0) f32(129, 0.5, 0, 0) uniform 0 float4 -INF 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad if(sm<4) probe (0, 0) f32(-NAN, -NAN, 0, 0) if(sm>=4) probe (0, 0) f32(129, 0.5, 0, 0) uniform 0 float4 NAN 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad if(sm<4) probe (0, 0) f32(NAN, NAN, 0, 0) if(sm>=4) probe (0, 0) f32(129, 0.75, 0, 0) % Subnormals. uniform 0 uint4 0x0007ffff 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) f32(0, 0, 0, 0) [pixel shader] diff --git a/tests/hlsl/function-return.shader_test b/tests/hlsl/function-return.shader_test index 9f799b4b5..fbfc4a3f0 100644 --- a/tests/hlsl/function-return.shader_test +++ b/tests/hlsl/function-return.shader_test @@ -79,16 +79,16 @@ float4 main() : sv_target [test] uniform 0 float 0.1 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.3, 0.2, 0.6, 0.3) 1 uniform 0 float 0.4 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.6, 0.5, 0.6, 0.3) 1 uniform 0 float 0.6 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.6, 0.5, 0.4, 0.5) 1 uniform 0 float 0.8 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.8, 0.7, 0.4, 0.5) 1 [pixel shader todo(sm<4)] @@ -235,23 +235,23 @@ float4 main() : sv_target [test] uniform 0 float 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.3, 0.2, 0.3, 0.3) 1 uniform 0 float 0.1 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.3, 0.3, 0.3, 0.3) 1 uniform 0 float 0.3 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.3, 0.5, 0.3, 0.3) 1 uniform 0 float 0.7 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.3, 0.9, 0.7, 0.6) 1 uniform 0 float 0.9 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.4, 0.1, 0.7, 0.6) 1 [pixel shader todo(sm<4)] @@ -291,21 +291,21 @@ float4 main() : sv_target uniform 0 float4 0.3 0.0 0.0 0.0 uniform 4 float4 0.0 0.0 0.0 0.0 uniform 8 float4 0.1 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.3, 0.2, 0.6, 0.6) 1 uniform 4 float4 0.35 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.3, 0.3, 0.6, 0.6) 1 uniform 8 float4 0.5 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.3, 0.5, 0.6, 0.6) 1 uniform 0 float4 1.0 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.3, 0.5, 0.6, 0.6) 1 uniform 4 float4 2.0 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.4, 0.1, 0.6, 0.6) 1 diff --git a/tests/hlsl/hard-copy-prop.shader_test b/tests/hlsl/hard-copy-prop.shader_test index b058e2100..779111b5b 100644 --- a/tests/hlsl/hard-copy-prop.shader_test +++ b/tests/hlsl/hard-copy-prop.shader_test @@ -17,10 +17,10 @@ float4 main() : sv_target [test] uniform 0 float 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (2.0, 2.0, 2.0, 2.0) uniform 0 float 1.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (-2.0, -2.0, -2.0, -2.0) @@ -43,10 +43,10 @@ float4 main() : sv_target [test] uniform 0 float 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (2.0, 2.0, 2.0, 2.0) uniform 0 float 1.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (20.0, 20.0, 20.0, 20.0) @@ -69,10 +69,10 @@ float4 main() : sv_target [test] uniform 0 float 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (1.0, 4.0, 0.0, 0.0) uniform 0 float 1.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (1.0, 40.0, 0.0, 0.0) [pixel shader] @@ -221,7 +221,7 @@ float4 main() : sv_target [test] uniform 0 float 11.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba(1, 2, 3, 5) [require] diff --git a/tests/hlsl/lit.shader_test b/tests/hlsl/lit.shader_test index 95dbced2f..846604157 100644 --- a/tests/hlsl/lit.shader_test +++ b/tests/hlsl/lit.shader_test @@ -8,17 +8,17 @@ float4 main() : sv_target [test] uniform 0 float4 -0.1 10.0 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 0.0, 0.0, 1.0) [test] uniform 0 float4 1.2 -0.1 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.2, 0.0, 1.0) [test] uniform 0 float4 1.2 2.0 3.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.2, 8.0, 1.0) [pixel shader] @@ -31,7 +31,7 @@ float4 main() : sv_target [test] uniform 0 float4 1.2 2.0 3.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (2.0, 2.4, 16.0, 2.0) [pixel shader fail] diff --git a/tests/hlsl/logic-operations.shader_test b/tests/hlsl/logic-operations.shader_test index 1e0870875..9eb0798c1 100644 --- a/tests/hlsl/logic-operations.shader_test +++ b/tests/hlsl/logic-operations.shader_test @@ -171,13 +171,13 @@ if(sm<4) uniform 0 float 5 if(sm<4) uniform 4 float 0 if(sm>=4) uniform 0 int 5 if(sm>=4) uniform 1 int 0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 0.0, 1.0) if(sm<4) uniform 0 float -1 if(sm<4) uniform 4 float 3 if(sm>=4) uniform 0 int -1 if(sm>=4) uniform 1 int 3 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.0, 1.0, 0.0, 0.0) [pixel shader] @@ -193,11 +193,11 @@ if(sm<4) uniform 0 float 0 if(sm<4) uniform 4 float 5 if(sm>=4) uniform 0 int 0 if(sm>=4) uniform 1 int 5 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) f32(1.0, 0.0, 0.0, 1.0) if(sm<4) uniform 0 float -1 if(sm<4) uniform 4 float -1 if(sm>=4) uniform 0 int -1 if(sm>=4) uniform 1 int -1 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) f32(0.0, 1.0, 1.0, 0.0) diff --git a/tests/hlsl/loop.shader_test b/tests/hlsl/loop.shader_test index fdfb38cf1..906c768f5 100644 --- a/tests/hlsl/loop.shader_test +++ b/tests/hlsl/loop.shader_test @@ -118,7 +118,7 @@ float4 main() : sv_target } [test] -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (10.0, 10.0, 10.0, 10.0) [pixel shader todo(sm<4)] @@ -137,7 +137,7 @@ float4 main() : sv_target } [test] -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (10.0, 10.0, 10.0, 10.0) [pixel shader todo(sm<4)] @@ -156,7 +156,7 @@ float4 main() : sv_target } [test] -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (10.0, 10.0, 10.0, 10.0) % unroll can't be used with fastopt or loop diff --git a/tests/hlsl/refract.shader_test b/tests/hlsl/refract.shader_test index c9326f1c2..5f6313694 100644 --- a/tests/hlsl/refract.shader_test +++ b/tests/hlsl/refract.shader_test @@ -12,10 +12,10 @@ float4 main() : sv_target uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 4 float4 0.6 0.4 -0.3 1.0 uniform 8 float 0.2 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (-0.550931, -0.453954, 0.3654653, -1.0248856) 32 uniform 8 float 100.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) [pixel shader] @@ -34,10 +34,10 @@ float4 main() : sv_target uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 4 float4 0.6 0.4 -0.3 1.0 uniform 8 float 0.2 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (-0.519904912, -0.4332699, 0.0, 0.0) 32 uniform 8 float 100.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) [pixel shader] @@ -55,10 +55,10 @@ float4 main() : sv_target uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 4 float4 0.6 0.4 -0.3 1.0 uniform 8 float 0.2 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (-0.519904912, -0.4332699, 0.0, 0.0) 32 uniform 8 float 100.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) [pixel shader] @@ -76,10 +76,10 @@ float4 main() : sv_target uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 4 float4 0.6 0.4 -0.3 1.0 uniform 8 float 0.2 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (-0.519904912, -0.4332699, 0.0, 0.0) 32 uniform 8 float 100.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) [pixel shader] @@ -98,10 +98,10 @@ float4 main() : sv_target uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 4 float4 0.6 0.4 -0.3 1.0 uniform 8 float 0.2 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (-0.524978, 0.0, 0.0, 0.0) 32 uniform 8 float 100.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) [pixel shader] @@ -118,10 +118,10 @@ float4 main() : sv_target uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 4 float4 0.6 0.4 -0.3 1.0 uniform 8 float 0.2 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (-0.5562381, -0.6762381, -0.6162381, -0.5962381) 32 uniform 8 float 100.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) [pixel shader fail(sm>=6)] diff --git a/tests/hlsl/return.shader_test b/tests/hlsl/return.shader_test index 7e1c63254..6c6ae843e 100644 --- a/tests/hlsl/return.shader_test +++ b/tests/hlsl/return.shader_test @@ -37,10 +37,10 @@ float4 main() : sv_target [test] uniform 0 float 0.2 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4) uniform 0 float 0.8 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.5, 0.6, 0.7, 0.8) [pixel shader todo(sm<4)] @@ -63,10 +63,10 @@ void main(out float4 ret : sv_target) [test] uniform 0 float 0.2 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.3, 0.4, 0.5, 0.6) uniform 0 float 0.8 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4) [pixel shader todo(sm<4)] @@ -89,13 +89,13 @@ void main(out float4 ret : sv_target) [test] uniform 0 float 0.1 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4) 1 uniform 0 float 0.5 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.2, 0.3, 0.4, 0.5) 1 uniform 0 float 0.9 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.5, 0.6, 0.7, 0.8) 1 [pixel shader todo(sm<4)] @@ -115,13 +115,13 @@ void main(out float4 ret : sv_target) [test] uniform 0 float 0.1 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4) 1 uniform 0 float 0.5 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.5, 0.6, 0.7, 0.8) 1 uniform 0 float 0.9 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.4, 0.5, 0.6, 0.7) 1 [pixel shader] @@ -160,23 +160,23 @@ void main(out float4 ret : sv_target) [test] uniform 0 float 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.1, 0.1, 0.1, 0.1) 1 uniform 0 float 0.1 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.2, 0.2, 0.2, 0.2) 1 uniform 0 float 0.3 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.4, 0.4, 0.4, 0.4) 1 uniform 0 float 0.7 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.8, 0.8, 0.8, 0.8) 1 uniform 0 float 0.9 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.9, 0.9, 0.9, 0.9) 1 [pixel shader todo(sm<4)] @@ -204,10 +204,10 @@ void main(out float4 ret : sv_target) [test] uniform 0 float 0.2 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.2, 0.2, 0.2, 0.2) uniform 0 float 0.8 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.5, 0.5, 0.5, 0.5) [pixel shader todo(sm<4)] @@ -236,21 +236,21 @@ void main(out float4 ret : sv_target) uniform 0 float4 0.3 0.0 0.0 0.0 uniform 4 float4 0.0 0.0 0.0 0.0 uniform 8 float4 0.1 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.1, 0.1, 0.1, 0.1) 1 uniform 4 float4 0.35 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.2, 0.2, 0.2, 0.2) 1 uniform 8 float4 0.5 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.4, 0.4, 0.4, 0.4) 1 uniform 0 float4 1.0 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.4, 0.4, 0.4, 0.4) 1 uniform 4 float4 2.0 0.0 0.0 0.0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (0.9, 0.9, 0.9, 0.9) 1 diff --git a/tests/hlsl/sm6-ternary.shader_test b/tests/hlsl/sm6-ternary.shader_test index cf036b032..a2b577aff 100644 --- a/tests/hlsl/sm6-ternary.shader_test +++ b/tests/hlsl/sm6-ternary.shader_test @@ -14,13 +14,12 @@ float4 main() : sv_target [test] uniform 0 float4 2.0 3.0 4.0 5.0 -todo(msl) draw quad +draw quad probe (0, 0) rgba (2.0, 3.0, 4.0, 5.0) uniform 0 float4 0.0 10.0 11.0 12.0 -todo(msl) draw quad +draw quad probe (0, 0) rgba (-1.0, 9.0, 10.0, 11.0) - [pixel shader] float4 f; @@ -33,10 +32,9 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 0.0 0.0 0.0 -todo(msl) draw quad +draw quad probe (0, 0) rgba (0.5, 0.2, 0.7, 0.0) - [pixel shader fail] float4 x, y, z; diff --git a/tests/hlsl/step.shader_test b/tests/hlsl/step.shader_test index b443692f3..c1bb14ec9 100644 --- a/tests/hlsl/step.shader_test +++ b/tests/hlsl/step.shader_test @@ -9,7 +9,7 @@ float4 main() : sv_target [test] uniform 0 float4 5.0 -2.6 3.0 2.0 uniform 4 float4 1.0 -4.3 3.0 4.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.0, 0.0, 1.0, 1.0) diff --git a/tests/hlsl/switch.shader_test b/tests/hlsl/switch.shader_test index e8e66610f..f7f102efa 100644 --- a/tests/hlsl/switch.shader_test +++ b/tests/hlsl/switch.shader_test @@ -17,18 +17,17 @@ float4 main() : sv_target [test] if(sm<4) uniform 0 float4 3 0 0 0 if(sm>=4) uniform 0 uint4 3 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (5.0, 5.0, 5.0, 5.0) if(sm<4) uniform 0 float4 1 0 0 0 if(sm>=4) uniform 0 uint4 1 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (4.0, 4.0, 4.0, 4.0) if(sm<4) uniform 0 float4 0 0 0 0 if(sm>=4) uniform 0 uint4 0 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (3.0, 3.0, 3.0, 3.0) - % just a default case [pixel shader todo(sm<4)] uint4 v; @@ -91,18 +90,17 @@ float4 main() : sv_target [test] if(sm<4) uniform 0 float4 2 0 0 0 if(sm>=4) uniform 0 uint4 2 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0) if(sm<4) uniform 0 float4 1 0 0 0 if(sm>=4) uniform 0 uint4 1 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (1.1, 2.0, 3.0, 4.0) if(sm<4) uniform 0 float4 0 0 0 0 if(sm>=4) uniform 0 uint4 0 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (1.1, 2.0, 3.0, 4.0) - % case value evaluation [pixel shader todo(sm<4)] uint4 v; @@ -127,14 +125,13 @@ float4 main() : sv_target [test] if(sm<4) uniform 0 float4 2 0 0 0 if(sm>=4) uniform 0 uint4 2 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (1.1, 2.1, 3.1, 4.1) if(sm<4) uniform 0 float4 1 0 0 0 if(sm>=4) uniform 0 uint4 1 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0) - % floats are accepted [pixel shader fail(sm>=6) todo(sm<4)] uint4 v; @@ -390,15 +387,15 @@ float4 main() : sv_target [test] if(sm<4) uniform 0 float4 2 0 0 0 if(sm>=4) uniform 0 uint4 2 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (1.1, 2.1, 3.1, 4.1) if(sm<4) uniform 0 float4 1 0 0 0 if(sm>=4) uniform 0 uint4 1 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (1.2, 2.2, 3.2, 4.2) if(sm<4) uniform 0 float4 0 0 0 0 if(sm>=4) uniform 0 uint4 0 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0) % switch breaks within a loop @@ -431,10 +428,9 @@ float4 main() : sv_target [test] if(sm<4) uniform 0 float4 2 0 0 0 if(sm>=4) uniform 0 uint4 2 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (5.0, 6.0, 7.0, 8.0) - % default case placement [pixel shader todo(sm<4)] uint4 v; @@ -464,18 +460,17 @@ float4 main() : sv_target [test] if(sm<4) uniform 0 float4 0 0 0 0 if(sm>=4) uniform 0 uint4 0 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (4.0, 5.0, 6.0, 7.0) if(sm<4) uniform 0 float4 2 0 0 0 if(sm>=4) uniform 0 uint4 2 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (2.0, 3.0, 4.0, 5.0) if(sm<4) uniform 0 float4 3 0 0 0 if(sm>=4) uniform 0 uint4 3 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (4.0, 5.0, 6.0, 7.0) - [pixel shader todo(sm<4)] uint4 v; @@ -505,15 +500,15 @@ float4 main() : sv_target [test] if(sm<4) uniform 0 float4 3 0 0 0 if(sm>=4) uniform 0 uint4 3 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0) if(sm<4) uniform 0 float4 0 0 0 0 if(sm>=4) uniform 0 uint4 0 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (4.0, 5.0, 6.0, 7.0) if(sm<4) uniform 0 float4 5 0 0 0 if(sm>=4) uniform 0 uint4 5 0 0 0 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0) % 'continue' is not supported in switches diff --git a/tests/hlsl/unroll.shader_test b/tests/hlsl/unroll.shader_test index efe5872f0..cb21079be 100644 --- a/tests/hlsl/unroll.shader_test +++ b/tests/hlsl/unroll.shader_test @@ -19,7 +19,7 @@ float4 main() : sv_target [test] uniform 0 float 1 -todo(sm<4 | msl & sm>=6) draw quad +todo(sm<4) draw quad probe (0,0) rgba(10.0, 1.0, 2.0, 3.0) [pixel shader] diff --git a/tests/hlsl/vertex-shader-ops.shader_test b/tests/hlsl/vertex-shader-ops.shader_test index 160f32823..6ed49805a 100644 --- a/tests/hlsl/vertex-shader-ops.shader_test +++ b/tests/hlsl/vertex-shader-ops.shader_test @@ -28,10 +28,9 @@ void main(out float4 res : COLOR1, in float4 pos : position, out float4 out_pos [test] if(sm<4) uniform 0 float 0.0 if(sm>=4) uniform 0 float4 0.0 0.0 0.0 0.0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) - [vertex shader] int a, b; @@ -49,15 +48,14 @@ void main(out float4 res : COLOR1, in float4 pos : position, out float4 out_pos if(sm<4) uniform 0 float 3 if(sm<4) uniform 4 float 4 if(sm>=4) uniform 0 int4 3 4 0 0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.0, 1.0, 0.0, 1.0) if(sm<4) uniform 0 float -2 if(sm<4) uniform 4 float -2 if(sm>=4) uniform 0 int4 -2 -2 0 0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 0.0, 0.0, 1.0) - [vertex shader] int a, b; @@ -75,15 +73,14 @@ void main(out float4 res : COLOR1, in float4 pos : position, out float4 out_pos if(sm<4) uniform 0 float 0 if(sm<4) uniform 4 float 2 if(sm>=4) uniform 0 int4 0 2 0 0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (0.0, 1.0, 0.0, 1.0) if(sm<4) uniform 0 float -2 if(sm<4) uniform 4 float 8 if(sm>=4) uniform 0 int4 -2 8 0 0 -todo(msl & sm>=6) draw quad +draw quad probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0) - [require] % The ternary operator works differently in sm6. See sm6-ternary.shader_test. shader model < 6.0