diff --git a/src/microsoft/compiler/dxil_enums.h b/src/microsoft/compiler/dxil_enums.h index d8181dea56a..f82e381c32b 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 96ad74aed42..3c4c9ae38df 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);