aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2020-05-20 15:50:50 +0200
committerSamuel Pitoiset <[email protected]>2020-05-25 08:51:10 +0200
commite99c818cf0666132f0cb76dc2d78e795d0168868 (patch)
tree1c357254d0429757b6418b4cd34fcf4319bad096
parent41dc3ce449ff6fc47691202ef7c5ee8fa37668c6 (diff)
ac/nir: add support for bias/lod with texture gather
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5147>
-rw-r--r--src/amd/llvm/ac_nir_to_llvm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c
index e6f4e79aa58..959998c0c5d 100644
--- a/src/amd/llvm/ac_nir_to_llvm.c
+++ b/src/amd/llvm/ac_nir_to_llvm.c
@@ -1470,7 +1470,8 @@ static LLVMValueRef build_tex_intrinsic(struct ac_nir_context *ctx,
break;
case nir_texop_tg4:
args->opcode = ac_image_gather4;
- args->level_zero = true;
+ if (!args->lod && !args->bias)
+ args->level_zero = true;
break;
case nir_texop_lod:
args->opcode = ac_image_get_lod;
@@ -4448,8 +4449,7 @@ static void visit_tex(struct ac_nir_context *ctx, nir_tex_instr *instr)
offset_src = i;
break;
case nir_tex_src_bias:
- if (instr->op == nir_texop_txb)
- args.bias = get_src(ctx, instr->src[i].src);
+ args.bias = get_src(ctx, instr->src[i].src);
break;
case nir_tex_src_lod: {
if (nir_src_is_const(instr->src[i].src) && nir_src_as_uint(instr->src[i].src) == 0)