diff --git a/src/gallium/drivers/d3d12/d3d12_compiler.cpp b/src/gallium/drivers/d3d12/d3d12_compiler.cpp index 64dbfd94d38..a9abadda9a3 100644 --- a/src/gallium/drivers/d3d12/d3d12_compiler.cpp +++ b/src/gallium/drivers/d3d12/d3d12_compiler.cpp @@ -141,6 +141,7 @@ compile_nir(struct d3d12_context *ctx, struct d3d12_shader_selector *sel, opts.input_clip_size = key->input_clip_size; opts.environment = DXIL_ENVIRONMENT_GL; opts.shader_model_max = screen->max_shader_model; + opts.advanced_texture_ops = screen->opts14.AdvancedTextureOpsSupported; #ifdef _WIN32 opts.validator_version_max = dxil_get_validator_version(ctx->dxil_validator); #endif diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c index 8f38818dafa..e1e8c93d05a 100644 --- a/src/microsoft/compiler/nir_to_dxil.c +++ b/src/microsoft/compiler/nir_to_dxil.c @@ -5638,7 +5638,7 @@ emit_tex(struct ntd_context *ctx, nir_tex_instr *instr) lod_is_zero = true; FALLTHROUGH; case nir_texop_txl: - if (lod_is_zero && params.cmp != NULL && ctx->mod.minor_version < 7) { + if ((lod_is_zero || !ctx->opts->advanced_texture_ops) && params.cmp != NULL) { /* Prior to SM 6.7, if the level is constant 0.0, ignore the LOD argument, * so level-less DXIL instructions are used. This is needed to avoid emitting * dx.op.sampleCmpLevel, which would not be available. diff --git a/src/microsoft/compiler/nir_to_dxil.h b/src/microsoft/compiler/nir_to_dxil.h index 7cdd7fc9468..98901150b64 100644 --- a/src/microsoft/compiler/nir_to_dxil.h +++ b/src/microsoft/compiler/nir_to_dxil.h @@ -80,6 +80,7 @@ struct nir_to_dxil_options { bool lower_int16; bool disable_math_refactoring; bool last_ubo_is_not_arrayed; + bool advanced_texture_ops; unsigned provoking_vertex; unsigned num_kernel_globals; unsigned input_clip_size; diff --git a/src/microsoft/vulkan/dzn_pipeline.c b/src/microsoft/vulkan/dzn_pipeline.c index b38b3c55cd3..cf2b1ee5f5e 100644 --- a/src/microsoft/vulkan/dzn_pipeline.c +++ b/src/microsoft/vulkan/dzn_pipeline.c @@ -427,6 +427,7 @@ dzn_pipeline_compile_shader(struct dzn_device *device, device->vk.enabled_features.shaderInt16), .shader_model_max = dzn_get_shader_model(pdev), .input_clip_size = input_clip_size, + .advanced_texture_ops = pdev->options14.AdvancedTextureOpsSupported, #ifdef _WIN32 .validator_version_max = dxil_get_validator_version(instance->dxil_validator), #endif