From 0a3a8806707b7ba4fc2e79896b63c35b1d9f80f6 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Thu, 2 Apr 2020 04:19:51 +0200 Subject: [PATCH] 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: --- src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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, ""); -- 2.30.2