From 41dc3ce449ff6fc47691202ef7c5ee8fa37668c6 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 20 May 2020 16:24:18 +0200 Subject: [PATCH] spirv: add support for bias/lod with OpImageGather Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/compiler/spirv/spirv_to_nir.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index 590f325a4b9..aef1ecdbd00 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -2445,8 +2445,10 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode, uint32_t operands = w[idx]; if (operands & SpvImageOperandsBiasMask) { - vtn_assert(texop == nir_texop_tex); - texop = nir_texop_txb; + vtn_assert(texop == nir_texop_tex || + texop == nir_texop_tg4); + if (texop == nir_texop_tex) + texop = nir_texop_txb; uint32_t arg = image_operand_arg(b, w, count, idx, SpvImageOperandsBiasMask); (*p++) = vtn_tex_src(b, w[arg], nir_tex_src_bias); @@ -2454,7 +2456,7 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode, if (operands & SpvImageOperandsLodMask) { vtn_assert(texop == nir_texop_txl || texop == nir_texop_txf || - texop == nir_texop_txs); + texop == nir_texop_txs || texop == nir_texop_tg4); uint32_t arg = image_operand_arg(b, w, count, idx, SpvImageOperandsLodMask); (*p++) = vtn_tex_src(b, w[arg], nir_tex_src_lod); -- 2.30.2