diff options
author | Dave Airlie <[email protected]> | 2020-04-24 11:23:19 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2020-04-27 12:35:24 +1000 |
commit | 8faa0e2c1b295d271a5ca98ac9c46462a1522524 (patch) | |
tree | 5f94fc4908250dc67c88a34aaf9ba6983dfa382f /src/gallium/auxiliary | |
parent | 565df656513acec8c2d5fe915c51b4b901265fa7 (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/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 12 |
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) { |