Skip to content

Commit cb21534

Browse files
jenataliMarge Bot
authored and
Marge Bot
committedAug 25, 2022
microsoft/compiler: Support SM6.7
Reviewed-by: Giancarlo Devich <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18022>
1 parent 01b6676 commit cb21534

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
 

‎src/microsoft/compiler/nir_to_dxil.c

+9-1
Original file line numberDiff line numberDiff line change
@@ -1633,6 +1633,14 @@ get_module_flags(struct ntd_context *ctx)
16331633
if (ctx->opts->disable_math_refactoring)
16341634
flags |= (1 << 1);
16351635

1636+
/* Work around https://github.com/microsoft/DirectXShaderCompiler/issues/4616
1637+
* When targeting SM6.7 and with at least one UAV, if no other flags are present,
1638+
* set the resources-may-not-alias flag, or else the DXIL validator may end up
1639+
* with uninitialized memory which will fail validation, due to missing that flag.
1640+
*/
1641+
if (flags == 0 && ctx->mod.minor_version >= 7 && ctx->num_uavs > 0)
1642+
flags |= (1ull << 33);
1643+
16361644
return flags;
16371645
}
16381646

@@ -5928,7 +5936,7 @@ type_size_vec4(const struct glsl_type *type, bool bindless)
59285936
static const unsigned dxil_validator_min_capable_version = DXIL_VALIDATOR_1_4;
59295937
static const unsigned dxil_validator_max_capable_version = DXIL_VALIDATOR_1_7;
59305938
static const unsigned dxil_min_shader_model = SHADER_MODEL_6_1;
5931-
static const unsigned dxil_max_shader_model = SHADER_MODEL_6_6;
5939+
static const unsigned dxil_max_shader_model = SHADER_MODEL_6_7;
59325940

59335941
bool
59345942
nir_to_dxil(struct nir_shader *s, const struct nir_to_dxil_options *opts,

‎src/microsoft/compiler/nir_to_dxil.h

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ enum dxil_shader_model {
8989
SHADER_MODEL_6_4,
9090
SHADER_MODEL_6_5,
9191
SHADER_MODEL_6_6,
92+
SHADER_MODEL_6_7,
9293
};
9394

9495
struct nir_to_dxil_options {

0 commit comments

Comments
 (0)
Please sign in to comment.