aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2020-04-24 11:23:19 +1000
committerDave Airlie <[email protected]>2020-04-27 12:35:24 +1000
commit8faa0e2c1b295d271a5ca98ac9c46462a1522524 (patch)
tree5f94fc4908250dc67c88a34aaf9ba6983dfa382f /src
parent565df656513acec8c2d5fe915c51b4b901265fa7 (diff)
gallivm: fix stencil border
Fixes: dEQP-GLES31.functional.texture.border_clamp.unused_channels.depth32f_stencil8_sample_stencil dEQP-GLES31.functional.texture.border_clamp.sampler.uint_stencil Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4574>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
index a86ece1b0d0..7cc60f25856 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
@@ -195,9 +195,17 @@ lp_build_sample_texel_soa(struct lp_build_sample_context *bld,
for (chan = 0; chan < 4; chan++) {
unsigned chan_s;
/* reverse-map channel... */
- for (chan_s = 0; chan_s < 4; chan_s++) {
- if (chan_s == format_desc->swizzle[chan]) {
+ if (util_format_has_stencil(format_desc)) {
+ if (chan == 0)
+ chan_s = 0;
+ else
break;
+ }
+ else {
+ for (chan_s = 0; chan_s < 4; chan_s++) {
+ if (chan_s == format_desc->swizzle[chan]) {
+ break;
+ }
}
}
if (chan_s <= 3) {