From: Roland Scheidegger Date: Thu, 2 Apr 2020 02:19:51 +0000 (+0200) Subject: gallivm: switch the mask6/mask7 cases for signed rgtc formats X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0a3a8806707b7ba4fc2e79896b63c35b1d9f80f6;p=mesa.git 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 Reviewed-by: Brian Paul Part-of: --- diff --git a/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c b/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c index 50addad486a..d799a5d45a9 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c @@ -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, "");