[Mesa-dev] [PATCH 1/2] nir/lower-atomics-to-ssbo: fix num_components

Rob Clark robdclark at gmail.com
Mon May 15 20:06:37 UTC 2017


Fixes some piglits like arb_shader_atomic_counters-active-counters

Signed-off-by: Rob Clark <robdclark at gmail.com>
---
 src/compiler/nir/nir_lower_atomics_to_ssbo.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/compiler/nir/nir_lower_atomics_to_ssbo.c b/src/compiler/nir/nir_lower_atomics_to_ssbo.c
index 27fe50b..cd69de2 100644
--- a/src/compiler/nir/nir_lower_atomics_to_ssbo.c
+++ b/src/compiler/nir/nir_lower_atomics_to_ssbo.c
@@ -155,6 +155,11 @@ lower_instr(nir_intrinsic_instr *instr, unsigned ssbo_offset, nir_builder *b)
       nir_ssa_def_rewrite_uses(&instr->dest.ssa, nir_src_for_ssa(&new_instr->dest.ssa));
    }
 
+   /* we could be replacing an intrinsic with fixed # of dest num_components
+	* with one that has variable number.  So best to take this from the dest:
+	*/
+   new_instr->num_components = instr->dest.ssa.num_components;
+
    return true;
 }
 
-- 
2.9.3



More information about the mesa-dev mailing list