Skip to content
Snippets Groups Projects
Commit d38425ce authored by Samuel Pitoiset's avatar Samuel Pitoiset
Browse files

ac: fix texture query LOD for 1D textures on GFX9


1D textures are allocated as 2D which means we only need
one coordinate for texture query LOD.

Fixes: 625dcbbc ("amd/common: pass address components individually to
ac_build_image_intrinsic")
Cc: 18.1 <mesa-stable@lists.freedesktop.org>
Signed-off-by: default avatarSamuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: default avatarNicolai Hähnle <nicolai.haehnle@amd.com>
parent 3e691279
No related merge requests found
......@@ -1309,6 +1309,14 @@ static LLVMValueRef build_tex_intrinsic(struct ac_nir_context *ctx,
}
}
/* Fixup for GFX9 which allocates 1D textures as 2D. */
if (instr->op == nir_texop_lod && ctx->ac.chip_class >= GFX9) {
if ((args->dim == ac_image_2darray ||
args->dim == ac_image_2d) && !args->coords[1]) {
args->coords[1] = ctx->ac.i32_0;
}
}
args->attributes = AC_FUNC_ATTR_READNONE;
return ac_build_image_opcode(&ctx->ac, args);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment