From 77fcb01f7f0e9301c994fbae71f8019b32e012db Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Thu, 22 Apr 2021 11:58:35 +0200 Subject: [PATCH] nir/lower_clip_disable: Fix store writemask We're storing into the array element, not the whole variable. Fixes: fb2fe80 ("nir: add lowering pass for clip plane enabling") Part-of: --- src/compiler/nir/nir_lower_clip_disable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_lower_clip_disable.c b/src/compiler/nir/nir_lower_clip_disable.c index 6c5958e51de..19f818eff7c 100644 --- a/src/compiler/nir/nir_lower_clip_disable.c +++ b/src/compiler/nir/nir_lower_clip_disable.c @@ -101,7 +101,8 @@ lower_clip_plane_store(nir_intrinsic_instr *instr, unsigned clip_plane_enable, n if (clip_plane_enable & (1 << plane)) return false; - nir_store_deref(b, deref, nir_imm_int(b, 0), 1 << plane); + assert(nir_intrinsic_write_mask(instr) == 1); + nir_store_deref(b, deref, nir_imm_int(b, 0), 1); } else { /* storing using a variable index */ nir_ssa_def *index = nir_ssa_for_src(b, deref->arr.index, 1);