From d291f368a0051a706df9ce985445d46030bd391c Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 31 Mar 2023 19:44:34 +0100 Subject: [PATCH] ac/llvm: support implicit LOD for nir_texop_tg4 Signed-off-by: Rhys Perry Reviewed-by: Georg Lehmann Part-of: --- src/amd/llvm/ac_nir_to_llvm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c index 66999356a09..9739e3a0c2d 100644 --- a/src/amd/llvm/ac_nir_to_llvm.c +++ b/src/amd/llvm/ac_nir_to_llvm.c @@ -1601,8 +1601,10 @@ static LLVMValueRef build_tex_intrinsic(struct ac_nir_context *ctx, const nir_te break; case nir_texop_tg4: args->opcode = ac_image_gather4; - if (!args->lod && !args->bias) + if (!args->lod && !instr->is_gather_implicit_lod) args->level_zero = true; + /* GFX11 supports implicit LOD, but the extension is unsupported. */ + assert(args->level_zero || ctx->ac.gfx_level < GFX11); break; case nir_texop_lod: args->opcode = ac_image_get_lod;