diff options
author | Roland Scheidegger <[email protected]> | 2020-04-02 02:51:03 +0200 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-02 15:53:23 +0000 |
commit | ebb5b88a02637908b9f4bfd0644964d6347b23af (patch) | |
tree | ca3b012f7aa12119a7132c65636d643822d81068 /src/gallium/auxiliary/gallivm | |
parent | 5cc27d59a11ed11081b3f5c9acc3280ec412ebed (diff) |
gallivm: fix rgtc2 format
In some cases, there can be garbage in the upper bits after the channel
decode - for dxt5 this didn't matter (as the upper bits are shifted out
anyway) but for rgtc2 formats it does.
Reviewed-by: Dave Airlie <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4416>
Diffstat (limited to 'src/gallium/auxiliary/gallivm')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c b/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c index c5ecaf6ff9a..50addad486a 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c @@ -1023,6 +1023,8 @@ s3tc_dxt5_alpha_channel(struct gallivm_state *gallivm, alpha = LLVMBuildAnd(builder, alpha, LLVMBuildNot(builder, mask6, ""), ""); alpha = LLVMBuildOr(builder, alpha, mask7, ""); } + /* There can be garbage in upper bits, mask them off for rgtc formats */ + alpha = LLVMBuildAnd(builder, alpha, lp_build_const_int_vec(gallivm, type, 0xff), ""); return alpha; } |