[Mesa-dev] [PATCH] radv/ac/llvm: shadow samplers only return one value.

Dave Airlie airlied at gmail.com
Mon Oct 24 21:47:13 UTC 2016


From: Dave Airlie <airlied at redhat.com>

The intrinsic engine asserts in llvm due to this.

Reported-by: Christoph Haag <haagch+mesadev at frickel.club>
Cc: "13.0" <mesa-stable at lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/amd/common/ac_nir_to_llvm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index c3f3fe8..9edeec9 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -3515,7 +3515,9 @@ static void visit_tex(struct nir_to_llvm_context *ctx, nir_tex_instr *instr)
 
 	result = build_tex_intrinsic(ctx, instr, &tinfo);
 
-	if (instr->op == nir_texop_query_levels)
+	if (instr->is_shadow)
+		result = LLVMBuildExtractElement(ctx->builder, result, ctx->i32zero, "");
+	else if (instr->op == nir_texop_query_levels)
 		result = LLVMBuildExtractElement(ctx->builder, result, LLVMConstInt(ctx->i32, 3, false), "");
 	else if (instr->op == nir_texop_txs &&
 		 instr->sampler_dim == GLSL_SAMPLER_DIM_CUBE &&
-- 
2.5.5



More information about the mesa-dev mailing list