From b7db9ee320fac97cd890f1fb331e6c8059069461 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 7 Aug 2020 11:25:24 -0500 Subject: [PATCH] intel/nir: Clean up lower_alpha_to_coverage a bit Reviewed-by: Caio Marcelo de Oliveira Filho Part-of: --- .../brw_nir_lower_alpha_to_coverage.c | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/intel/compiler/brw_nir_lower_alpha_to_coverage.c b/src/intel/compiler/brw_nir_lower_alpha_to_coverage.c index d31384e5615..2f07ed451bb 100644 --- a/src/intel/compiler/brw_nir_lower_alpha_to_coverage.c +++ b/src/intel/compiler/brw_nir_lower_alpha_to_coverage.c @@ -65,21 +65,16 @@ build_dither_mask(nir_builder *b, nir_ssa_def *color) nir_f2i32(b, nir_fmul_imm(b, nir_fsat(b, alpha), 16.0)); nir_ssa_def *part_a = - nir_iand(b, - nir_imm_int(b, 0xf), - nir_ushr(b, - nir_imm_int(b, 0xfea80), - nir_iand(b, m, nir_imm_int(b, ~3)))); + nir_iand_imm(b, nir_ushr(b, nir_imm_int(b, 0xfea80), + nir_iand_imm(b, m, ~3)), + 0xf); - nir_ssa_def *part_b = nir_iand(b, m, nir_imm_int(b, 2)); + nir_ssa_def *part_b = nir_iand_imm(b, m, 2); + nir_ssa_def *part_c = nir_iand_imm(b, m, 1); - nir_ssa_def *part_c = nir_iand(b, m, nir_imm_int(b, 1)); - - return nir_ior(b, - nir_imul_imm(b, part_a, 0x1111), - nir_ior(b, - nir_imul_imm(b, part_b, 0x0808), - nir_imul_imm(b, part_c, 0x0100))); + return nir_ior(b, nir_imul_imm(b, part_a, 0x1111), + nir_ior(b, nir_imul_imm(b, part_b, 0x0808), + nir_imul_imm(b, part_c, 0x0100))); } bool -- 2.30.2