From f58d76336327b6d50a938d96d9cfef89dd8fb5fa Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Thu, 19 Jan 2023 13:26:13 -0800 Subject: [PATCH] microsoft/compiler: Support emitting the SM6.6 wave size tag Part-of: --- src/microsoft/compiler/dxil_enums.h | 1 + src/microsoft/compiler/nir_to_dxil.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/microsoft/compiler/dxil_enums.h b/src/microsoft/compiler/dxil_enums.h index d8181de..f82e381 100644 --- a/src/microsoft/compiler/dxil_enums.h +++ b/src/microsoft/compiler/dxil_enums.h @@ -272,6 +272,7 @@ enum dxil_shader_tag { DXIL_SHADER_TAG_DS_STATE = 2, DXIL_SHADER_TAG_HS_STATE = 3, DXIL_SHADER_TAG_NUM_THREADS = 4, + DXIL_SHADER_TAG_WAVE_SIZE = 11, }; enum dxil_barrier_mode { diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c index 96ad74a..3c4c9ae 100644 --- a/src/microsoft/compiler/nir_to_dxil.c +++ b/src/microsoft/compiler/nir_to_dxil.c @@ -1829,6 +1829,11 @@ emit_metadata(struct ntd_context *ctx) } else if (ctx->mod.shader_kind == DXIL_COMPUTE_SHADER) { if (!emit_tag(ctx, DXIL_SHADER_TAG_NUM_THREADS, emit_threads(ctx))) return false; + if (ctx->mod.minor_version >= 6 && + ctx->shader->info.subgroup_size >= SUBGROUP_SIZE_REQUIRE_8 && + !emit_tag(ctx, DXIL_SHADER_TAG_WAVE_SIZE, + dxil_get_metadata_int32(&ctx->mod, ctx->shader->info.subgroup_size))) + return false; } uint64_t flags = get_module_flags(ctx); -- 2.7.4