From 22b8e0c74c5ebe8153477d14176beaa7b54c2987 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Tue, 20 Dec 2022 13:08:20 -0800 Subject: [PATCH] microsoft/compiler: Set the advanced texture ops flag correctly Part-of: --- src/microsoft/compiler/nir_to_dxil.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c index 8ad7812e25f..96a4af7e24e 100644 --- a/src/microsoft/compiler/nir_to_dxil.c +++ b/src/microsoft/compiler/nir_to_dxil.c @@ -4930,6 +4930,7 @@ emit_sample_cmp_level_zero(struct ntd_context *ctx, struct texop_parameters *par static const struct dxil_value * emit_sample_cmp_level(struct ntd_context *ctx, struct texop_parameters *params) { + ctx->mod.feats.advanced_texture_ops = true; const struct dxil_func *func = dxil_get_function(&ctx->mod, "dx.op.sampleCmpLevel", params->overload); if (!func) return NULL; @@ -5068,6 +5069,10 @@ emit_tex(struct ntd_context *ctx, nir_tex_instr *instr) &instr->src[i], nir_type_int); if (!offset_components) return false; + + /* Dynamic offsets were only allowed with gather, until "advanced texture ops" in SM7 */ + if (!nir_src_is_const(instr->src[i].src) && instr->op != nir_texop_tg4) + ctx->mod.feats.advanced_texture_ops = true; break; case nir_tex_src_bias: