From 29786d7efb712cbc3aa8c97d6ba2a8e6e09fdf42 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Wed, 24 Apr 2024 11:29:17 +1000 Subject: [PATCH] tests/shader-runner: Add a 'require' directive for wave ops. --- tests/hlsl/wave-ops-float.shader_test | 1 + tests/hlsl/wave-ops-int.shader_test | 1 + tests/hlsl/wave-ops-uint.shader_test | 1 + tests/shader_runner.c | 7 +++++++ tests/shader_runner.h | 2 ++ tests/shader_runner_d3d12.c | 1 + 6 files changed, 13 insertions(+) diff --git a/tests/hlsl/wave-ops-float.shader_test b/tests/hlsl/wave-ops-float.shader_test index b8589484..74254179 100644 --- a/tests/hlsl/wave-ops-float.shader_test +++ b/tests/hlsl/wave-ops-float.shader_test @@ -1,5 +1,6 @@ [require] shader model >= 6.0 +wave ops [uav 0] format r32g32b32a32 float diff --git a/tests/hlsl/wave-ops-int.shader_test b/tests/hlsl/wave-ops-int.shader_test index e3a44621..5c9a365f 100644 --- a/tests/hlsl/wave-ops-int.shader_test +++ b/tests/hlsl/wave-ops-int.shader_test @@ -1,5 +1,6 @@ [require] shader model >= 6.0 +wave ops [uav 0] format r32g32b32a32 sint diff --git a/tests/hlsl/wave-ops-uint.shader_test b/tests/hlsl/wave-ops-uint.shader_test index 033ac45b..de65e47d 100644 --- a/tests/hlsl/wave-ops-uint.shader_test +++ b/tests/hlsl/wave-ops-uint.shader_test @@ -1,5 +1,6 @@ [require] shader model >= 6.0 +wave ops [uav 0] format r32 uint diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 68a7a9c5..e9db04b1 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -339,6 +339,10 @@ static void parse_require_directive(struct shader_runner *runner, const char *li { runner->require_rov = true; } + else if (match_string(line, "wave ops", &line)) + { + runner->require_wave_ops = true; + } else { fatal_error("Unknown require directive '%s'.\n", line); @@ -1545,6 +1549,8 @@ static bool check_requirements(const struct shader_runner *runner, const struct return false; if (runner->require_rov && !caps->rov) return false; + if (runner->require_wave_ops && !caps->wave_ops) + return false; return true; } @@ -1838,6 +1844,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_c runner->require_float64 = false; runner->require_int64 = false; runner->require_rov = false; + runner->require_wave_ops = false; runner->compile_options = 0; skip_tests = false; } diff --git a/tests/shader_runner.h b/tests/shader_runner.h index 0457db96..4d7e7b67 100644 --- a/tests/shader_runner.h +++ b/tests/shader_runner.h @@ -137,6 +137,7 @@ struct shader_runner_caps bool float64; bool int64; bool rov; + bool wave_ops; }; static inline unsigned int shader_runner_caps_get_feature_flags(const struct shader_runner_caps *caps) @@ -169,6 +170,7 @@ struct shader_runner bool require_float64; bool require_int64; bool require_rov; + bool require_wave_ops; bool last_render_failed; diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c index be1e10ed..d566261f 100644 --- a/tests/shader_runner_d3d12.c +++ b/tests/shader_runner_d3d12.c @@ -751,6 +751,7 @@ static void d3d12_runner_init_caps(struct d3d12_shader_runner *runner) runner->caps.float64 = options.DoublePrecisionFloatShaderOps; runner->caps.int64 = options1.Int64ShaderOps; runner->caps.rov = options.ROVsSupported; + runner->caps.wave_ops = options1.WaveOps; } static bool device_supports_shader_model_6_0(ID3D12Device *device)