From d5d15c301e11d623f81a2d9181dadedb03e07c1f Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 20 Jul 2020 17:31:04 -0500 Subject: [PATCH 1/1] nir/lower_amul: Add a variable mode check This loop should only apply to UBOs and SSBOs because max_slot is never used for normal uniforms. Reviewed-by: Gert Wollny Part-of: --- src/compiler/nir/nir_lower_amul.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/nir/nir_lower_amul.c b/src/compiler/nir/nir_lower_amul.c index 191f204aea0..561cf77af33 100644 --- a/src/compiler/nir/nir_lower_amul.c +++ b/src/compiler/nir/nir_lower_amul.c @@ -236,6 +236,9 @@ nir_lower_amul(nir_shader *shader, int max_slot = 0; nir_foreach_variable (var, &shader->uniforms) { + if (!(var->data.mode & (nir_var_mem_ubo | nir_var_mem_ssbo))) + continue; + int base = var->data.binding; int size = MAX2(1, glsl_array_size(var->type)); -- 2.30.2