From 7450c4a36870b836fe29c3d04ad758d74ac33f64 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Tue, 5 Nov 2024 21:56:26 +0100 Subject: [PATCH] tests: Mark some tests in wave-reconvergence.shader_test as buggy on MoltenVK. --- tests/hlsl/wave-reconvergence.shader_test | 27 ++++++++------ tests/shader_runner.c | 43 ++++++++++++++++------- tests/shader_runner.h | 1 + 3 files changed, 48 insertions(+), 23 deletions(-) diff --git a/tests/hlsl/wave-reconvergence.shader_test b/tests/hlsl/wave-reconvergence.shader_test index 8d31f333..a91e4270 100644 --- a/tests/hlsl/wave-reconvergence.shader_test +++ b/tests/hlsl/wave-reconvergence.shader_test @@ -1,3 +1,8 @@ +% Many of these tests fail on MoltenVK because of a bug in Metal, which causes +% SIMD operations (i.e., wave operations for Apple) to be hoisted out of the +% "if"statement, thereby changing which threads (i.e., wave groups for Apple) +% appear as active. This was reported to Apple as FB15624583. + [require] shader model >= 6.0 format r32-uint uav-load @@ -59,25 +64,25 @@ void main(uint id : SV_GroupIndex) [test] dispatch 1 1 1 probe uav 2 (0) rui (0xf01) -probe uav 2 (1) rui (0x503) +bug(mvk) probe uav 2 (1) rui (0x503) probe uav 2 (2) rui (0x511) -probe uav 2 (3) rui (0x113) +bug(mvk) probe uav 2 (3) rui (0x113) probe uav 2 (4) rui (0xf24) probe uav 2 (5) rui (0xf01) -probe uav 2 (6) rui (0xa02) +bug(mvk) probe uav 2 (6) rui (0xa02) probe uav 2 (7) rui (0xf04) probe uav 2 (8) rui (0) probe uav 2 (9) rui (0) probe uav 2 (10) rui (0xf01) -probe uav 2 (11) rui (0x503) +bug(mvk) probe uav 2 (11) rui (0x503) probe uav 2 (12) rui (0x511) -probe uav 2 (13) rui (0x412) +bug(mvk) probe uav 2 (13) rui (0x412) probe uav 2 (14) rui (0xf14) probe uav 2 (15) rui (0xf01) -probe uav 2 (16) rui (0xa02) +bug(mvk) probe uav 2 (16) rui (0xa02) probe uav 2 (17) rui (0xf04) probe uav 2 (18) rui (0) probe uav 2 (19) rui (0) @@ -127,21 +132,21 @@ void main(uint id : SV_GroupIndex) [test] dispatch 1 1 1 probe uav 2 (0) rui (0x701) -probe uav 2 (1) rui (0x503) +bug(mvk) probe uav 2 (1) rui (0x503) probe uav 2 (2) rui (0x511) -probe uav 2 (3) rui (0x113) +bug(mvk) probe uav 2 (3) rui (0x113) probe uav 2 (4) rui (0x724) probe uav 2 (5) rui (0x701) -probe uav 2 (6) rui (0x202) +bug(mvk) probe uav 2 (6) rui (0x202) probe uav 2 (7) rui (0x704) probe uav 2 (8) rui (0) probe uav 2 (9) rui (0) probe uav 2 (10) rui (0x701) -probe uav 2 (11) rui (0x503) +bug(mvk) probe uav 2 (11) rui (0x503) probe uav 2 (12) rui (0x511) -probe uav 2 (13) rui (0x412) +bug(mvk) probe uav 2 (13) rui (0x412) probe uav 2 (14) rui (0x714) probe uav 2 (15) rui (0) diff --git a/tests/shader_runner.c b/tests/shader_runner.c index c754410b..3878d344 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -879,6 +879,7 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) int ret; runner->is_todo = false; + runner->is_bug = false; while (match) { @@ -890,6 +891,12 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) match = true; } + if (match_string_with_args(runner, line, "bug", &line)) + { + runner->is_bug = true; + match = true; + } + line_ini = line; if (match_string_with_args(runner, line, "if", &line)) { @@ -923,7 +930,8 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) fatal_error("Malformed dispatch arguments '%s'.\n", line); runner->last_render_failed = !runner->ops->dispatch(runner, x, y, z); - todo_if(runner->is_todo) ok(!runner->last_render_failed, "Dispatch failed.\n"); + todo_if(runner->is_todo) bug_if(runner->is_bug) + ok(!runner->last_render_failed, "Dispatch failed.\n"); } else if (match_string(line, "clear rtv", &line)) { @@ -1025,7 +1033,8 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) } runner->last_render_failed = !runner->ops->draw(runner, D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST, 3, 1); - todo_if(runner->is_todo) ok(!runner->last_render_failed, "Draw failed.\n"); + todo_if(runner->is_todo) bug_if(runner->is_bug) + ok(!runner->last_render_failed, "Draw failed.\n"); } else if (match_string(line, "draw", &line)) { @@ -1070,7 +1079,8 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) } runner->last_render_failed = !runner->ops->draw(runner, topology, vertex_count, instance_count); - todo_if(runner->is_todo) ok(!runner->last_render_failed, "Draw failed.\n"); + todo_if(runner->is_todo) bug_if(runner->is_bug) + ok(!runner->last_render_failed, "Draw failed.\n"); } else if (match_string(line, "copy", &line)) { @@ -1090,7 +1100,8 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) fatal_error("Resource dimensions don't match.\n"); ret = runner->ops->copy(runner, src, dst); - todo_if(runner->is_todo) ok(ret, "Failed to copy resource.\n"); + todo_if(runner->is_todo) bug_if(runner->is_bug) + ok(ret, "Failed to copy resource.\n"); } else if (match_string(line, "probe", &line)) { @@ -1164,7 +1175,8 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) ++line; read_uint4(&line, &v, false); line = close_parentheses(line); - todo_if(runner->is_todo) check_readback_data_uvec4(rb, &rect, &v); + todo_if(runner->is_todo) bug_if(runner->is_bug) + check_readback_data_uvec4(rb, &rect, &v); } else if (match_string(line, "rgbai", &line)) { @@ -1175,7 +1187,8 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) ++line; read_int4(&line, &v, false); line = close_parentheses(line); - todo_if(runner->is_todo) check_readback_data_ivec4(rb, &rect, &v); + todo_if(runner->is_todo) bug_if(runner->is_bug) + check_readback_data_ivec4(rb, &rect, &v); } else if (match_string(line, "rgba", &line)) { @@ -1186,7 +1199,8 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) fatal_error("Malformed probe arguments '%s'.\n", line); if (ret < 5) ulps = 0; - todo_if(runner->is_todo) check_readback_data_vec4(rb, &rect, &v, ulps); + todo_if(runner->is_todo) bug_if(runner->is_bug) + check_readback_data_vec4(rb, &rect, &v, ulps); } else if (match_string(line, "rg", &line)) { @@ -1197,7 +1211,8 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) fatal_error("Malformed probe arguments '%s'.\n", line); if (ret < 3) ulps = 0; - todo_if(runner->is_todo) check_readback_data_vec2(rb, &rect, &v, ulps); + todo_if(runner->is_todo) bug_if(runner->is_bug) + check_readback_data_vec2(rb, &rect, &v, ulps); } else if (match_string(line, "rui", &line) || (is_signed = match_string(line, "ri", &line))) { @@ -1218,7 +1233,8 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) else read_uint(&line, &expect, false); line = close_parentheses(line); - todo_if(runner->is_todo) check_readback_data_uint(rb, &box, expect, 0); + todo_if(runner->is_todo) bug_if(runner->is_bug) + check_readback_data_uint(rb, &box, expect, 0); } else if (match_string(line, "rui64", &line) || (is_signed = match_string(line, "ri64", &line))) { @@ -1239,7 +1255,8 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) else read_uint64(&line, &expect, false); line = close_parentheses(line); - todo_if(runner->is_todo) check_readback_data_uint64(rb, &box, expect, 0); + todo_if(runner->is_todo) bug_if(runner->is_bug) + check_readback_data_uint64(rb, &box, expect, 0); } else if (match_string(line, "rd", &line)) { @@ -1250,7 +1267,8 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) fatal_error("Malformed probe arguments '%s'.\n", line); if (ret < 2) ulps = 0; - todo_if(runner->is_todo) check_readback_data_double(rb, &rect, expect, ulps); + todo_if(runner->is_todo) bug_if(runner->is_bug) + check_readback_data_double(rb, &rect, expect, ulps); } else if (match_string(line, "r", &line)) { @@ -1261,7 +1279,8 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) fatal_error("Malformed probe arguments '%s'.\n", line); if (ret < 2) ulps = 0; - todo_if(runner->is_todo) check_readback_data_float(rb, &rect, expect, ulps); + todo_if(runner->is_todo) bug_if(runner->is_bug) + check_readback_data_float(rb, &rect, expect, ulps); } else { diff --git a/tests/shader_runner.h b/tests/shader_runner.h index 7cf69a33..88809cc5 100644 --- a/tests/shader_runner.h +++ b/tests/shader_runner.h @@ -179,6 +179,7 @@ struct shader_runner const struct shader_runner_caps *caps; bool is_todo; + bool is_bug; char *shader_source[SHADER_TYPE_COUNT]; enum shader_model minimum_shader_model;