Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- tests/d3d12.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 86a295a9..20eeac9d 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -7807,6 +7807,45 @@ static void test_shader_instructions(void) 0x00000000, 0x0100003e, }; static struct named_shader ps_loop_break = {"loop_break", ps_loop_break_code, sizeof(ps_loop_break_code)}; + static const DWORD ps_loop_end_break_code[] = + { +#if 0 + float4 src0; + + void main(out float4 dst : SV_Target) + { + float tmp = 0.0f; + for (int i = 0; i < src0.x; ++i) + { + if (i != src0.y) + { + tmp += 1.0f; + continue; + } + tmp = 1.0f; + break; + } + + dst = float4(tmp, 0, 0, 0); + } +#endif + 0x43425844, 0x0239f900, 0x5b94f73f, 0x68b75aa3, 0x27d353d2, 0x00000001, 0x000001e0, 0x00000003, + 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, + 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, + 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000168, 0x00000050, 0x0000005a, + 0x0100086a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, + 0x02000068, 0x00000001, 0x08000036, 0x00100032, 0x00000000, 0x00004002, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x01000030, 0x0500002b, 0x00100042, 0x00000000, 0x0010001a, 0x00000000, + 0x0800001d, 0x00100082, 0x00000000, 0x0010002a, 0x00000000, 0x0020800a, 0x00000000, 0x00000000, + 0x03040003, 0x0010003a, 0x00000000, 0x08000039, 0x00100042, 0x00000000, 0x0010002a, 0x00000000, + 0x0020801a, 0x00000000, 0x00000000, 0x0304001f, 0x0010002a, 0x00000000, 0x07000000, 0x00100012, + 0x00000000, 0x0010000a, 0x00000000, 0x00004001, 0x3f800000, 0x0700001e, 0x00100042, 0x00000000, + 0x0010001a, 0x00000000, 0x00004001, 0x00000001, 0x05000036, 0x00100032, 0x00000000, 0x00100086, + 0x00000000, 0x01000007, 0x01000015, 0x05000036, 0x00100012, 0x00000000, 0x00004001, 0x3f800000, + 0x01000002, 0x01000016, 0x05000036, 0x00102012, 0x00000000, 0x0010000a, 0x00000000, 0x08000036, + 0x001020e2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0100003e, + }; + static struct named_shader ps_loop_end_break = {"loop_end_break", ps_loop_end_break_code, sizeof(ps_loop_end_break_code)}; static const DWORD ps_loop_ret_code[] = { #if 0 @@ -9617,6 +9656,8 @@ static void test_shader_instructions(void) {&ps_loop_break, {{7.0f, 8.0f}}, {{7.0f}}}, {&ps_loop_break, {{7.0f, 9.0f}}, {{7.0f}}},
+ {&ps_loop_end_break, {{7.0f, 2.0f}}, {{1.0f}}}, + {&ps_loop_ret, {{0.0f, 0.0f}}, {{0.0f}}}, {&ps_loop_ret, {{1.0f, 9.0f}}, {{1.0f}}}, {&ps_loop_ret, {{2.0f, 2.0f}}, {{2.0f}}}, @@ -10350,6 +10391,12 @@ static void test_shader_instructions(void) continue; }
+ if (tests[i].ps == &ps_loop_end_break && !vkd3d_test_platform_is_windows()) + { + skip("Skipping shader '%s' test (would generate invalid SPIR-V).\n", tests[i].ps->name); + continue; + } + if (current_ps != tests[i].ps) { if (context.pipeline_state)