mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 17:20:10 +01:00
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 <airlied@redhat.com> Reviewed-by: Brian Paul <brianp@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4416>
This commit is contained in:
parent
5cc27d59a1
commit
ebb5b88a02
1 changed files with 2 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue