summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-11-15 07:30:09 +0000
committerEmil Velikov <emil.l.velikov@gmail.com>2016-11-24 16:34:40 +0000
commit145ecf60dd303d4c55949d5c437d1b307e9ba254 (patch)
treeb46ae6001161c0784ee21b019d795b27ebd16988
parent7bbe351e49618c35abb34a6b2512f248cd5fb80f (diff)
downloadexternal_mesa3d-145ecf60dd303d4c55949d5c437d1b307e9ba254.zip
external_mesa3d-145ecf60dd303d4c55949d5c437d1b307e9ba254.tar.gz
external_mesa3d-145ecf60dd303d4c55949d5c437d1b307e9ba254.tar.bz2
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@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 713522fb8d4366d29be18edc3d5f33faba1cb7c4)
-rw-r--r--src/amd/common/ac_nir_to_llvm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index d76f3fc..0b73e06 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -1683,7 +1683,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],