Mesa (master): ac/nir/llvm: fix channel in texture gather lowering code.

Dave Airlie airlied at kemper.freedesktop.org
Tue Nov 15 23:23:23 UTC 2016


Module: Mesa
Branch: master
Commit: 713522fb8d4366d29be18edc3d5f33faba1cb7c4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=713522fb8d4366d29be18edc3d5f33faba1cb7c4

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Nov 15 07:30:09 2016 +0000

ac/nir/llvm: fix channel in texture gather lowering code.

This fixes a number of CTS tests like:
dEQP-VK.glsl.texture_gather.basic.2d.rgba8ui.size_npot.clamp_to_edge_repeat

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index aa2d488..5de1491 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -1759,7 +1759,7 @@ static LLVMValueRef radv_lower_gather4_integer(struct nir_to_llvm_context *ctx,
 
 		for (c = 0; c < 2; c++) {
 			half_texel[c] = LLVMBuildExtractElement(ctx->builder, size,
-								ctx->i32zero, "");
+								LLVMConstInt(ctx->i32, c, false), "");
 			half_texel[c] = LLVMBuildUIToFP(ctx->builder, half_texel[c], ctx->f32, "");
 			half_texel[c] = emit_fdiv(ctx, ctx->f32one, half_texel[c]);
 			half_texel[c] = LLVMBuildFMul(ctx->builder, half_texel[c],




More information about the mesa-commit mailing list