gallivm: switch the mask6/mask7 cases for signed rgtc formats

This fixes some regressions where -1.0/1.0 results got flipped, but it's still
broken in some cases.

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:
Roland Scheidegger
2020-04-02 04:19:51 +02:00
committed by Marge Bot
parent ebb5b88a02
commit 0a3a880670
@@ -1017,8 +1017,8 @@ s3tc_dxt5_alpha_channel(struct gallivm_state *gallivm,
mask7 = lp_build_compare(gallivm, type, PIPE_FUNC_EQUAL,
code_s, lp_build_const_int_vec(gallivm, type, 7));
if (is_signed) {
alpha = lp_build_select(&bld32, mask6, lp_build_const_int_vec(gallivm, type, 127), alpha);
alpha = lp_build_select(&bld32, mask7, lp_build_const_int_vec(gallivm, type, -127), alpha);
alpha = lp_build_select(&bld32, mask6, lp_build_const_int_vec(gallivm, type, -127), alpha);
alpha = lp_build_select(&bld32, mask7, lp_build_const_int_vec(gallivm, type, 127), alpha);
} else {
alpha = LLVMBuildAnd(builder, alpha, LLVMBuildNot(builder, mask6, ""), "");
alpha = LLVMBuildOr(builder, alpha, mask7, "");