From: Jesse Natalie Date: Thu, 11 Aug 2022 20:40:49 +0000 (-0700) Subject: microsoft/compiler: Support SM6.7 X-Git-Tag: upstream/22.3.5~4245 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb21534a7c1270adace37a0d9703f72cd0c14c4a;p=platform%2Fupstream%2Fmesa.git microsoft/compiler: Support SM6.7 Reviewed-by: Giancarlo Devich Reviewed-by: Boris Brezillon Part-of: --- diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c index 611b602..53e9178 100644 --- a/src/microsoft/compiler/nir_to_dxil.c +++ b/src/microsoft/compiler/nir_to_dxil.c @@ -1633,6 +1633,14 @@ get_module_flags(struct ntd_context *ctx) if (ctx->opts->disable_math_refactoring) flags |= (1 << 1); + /* Work around https://github.com/microsoft/DirectXShaderCompiler/issues/4616 + * When targeting SM6.7 and with at least one UAV, if no other flags are present, + * set the resources-may-not-alias flag, or else the DXIL validator may end up + * with uninitialized memory which will fail validation, due to missing that flag. + */ + if (flags == 0 && ctx->mod.minor_version >= 7 && ctx->num_uavs > 0) + flags |= (1ull << 33); + return flags; } @@ -5928,7 +5936,7 @@ type_size_vec4(const struct glsl_type *type, bool bindless) static const unsigned dxil_validator_min_capable_version = DXIL_VALIDATOR_1_4; static const unsigned dxil_validator_max_capable_version = DXIL_VALIDATOR_1_7; static const unsigned dxil_min_shader_model = SHADER_MODEL_6_1; -static const unsigned dxil_max_shader_model = SHADER_MODEL_6_6; +static const unsigned dxil_max_shader_model = SHADER_MODEL_6_7; bool nir_to_dxil(struct nir_shader *s, const struct nir_to_dxil_options *opts, diff --git a/src/microsoft/compiler/nir_to_dxil.h b/src/microsoft/compiler/nir_to_dxil.h index 74842ab..c431906 100644 --- a/src/microsoft/compiler/nir_to_dxil.h +++ b/src/microsoft/compiler/nir_to_dxil.h @@ -89,6 +89,7 @@ enum dxil_shader_model { SHADER_MODEL_6_4, SHADER_MODEL_6_5, SHADER_MODEL_6_6, + SHADER_MODEL_6_7, }; struct nir_to_dxil_options {