aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2020-01-20 13:21:28 +1000
committerDave Airlie <[email protected]>2020-01-23 13:48:16 +1000
commit1e433c398ebeacd28cd565569eae0caba2638d18 (patch)
tree2eb6fcd734e60297861f607a78989c7f005a4f52 /src/gallium/auxiliary/gallivm
parentfc9d67394d6d6a83f592f5b40fdf28bfb6e980b0 (diff)
galllivm: fix gather offset casting
cast texture offsets to 32-bit integers Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3528>
Diffstat (limited to 'src/gallium/auxiliary/gallivm')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_nir.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
index a8a2f845e29..7a0e4175b43 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
@@ -1551,11 +1551,13 @@ static void visit_tex(struct lp_build_nir_context *bld_base, nir_tex_instr *inst
LLVMValueRef offset_val = get_src(bld_base, instr->src[i].src);
sample_key |= LP_SAMPLER_OFFSETS;
if (offset_cnt == 1)
- offsets[0] = offset_val;
+ offsets[0] = cast_type(bld_base, offset_val, nir_type_int, 32);
else {
- for (unsigned chan = 0; chan < offset_cnt; ++chan)
+ for (unsigned chan = 0; chan < offset_cnt; ++chan) {
offsets[chan] = LLVMBuildExtractValue(builder, offset_val,
chan, "");
+ offsets[chan] = cast_type(bld_base, offsets[chan], nir_type_int, 32);
+ }
}
break;
}