From: Kenneth Graunke Date: Fri, 9 Nov 2018 10:40:29 +0000 (-0800) Subject: iris: fix more uniform setup X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7eeb124c025fc0ef7e750603f8c1c6471ba746c1;p=mesa.git iris: fix more uniform setup --- diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index 1095896f36c..348ff05b44b 100644 --- a/src/gallium/drivers/iris/iris_program.c +++ b/src/gallium/drivers/iris/iris_program.c @@ -483,6 +483,8 @@ iris_setup_uniforms(const struct brw_compiler *compiler, /* Place the new params at the front of constant buffer 0. */ if (num_system_values > 0) { + nir->num_uniforms += num_system_values * sizeof(uint32_t); + system_values = reralloc(mem_ctx, system_values, enum brw_param_builtin, num_system_values); @@ -506,12 +508,15 @@ iris_setup_uniforms(const struct brw_compiler *compiler, } else if (nir_src_as_uint(load->src[0]) == 0) { nir_ssa_def *offset = nir_iadd(&b, load->src[1].ssa, - nir_imm_int(&b, num_system_values)); + nir_imm_int(&b, 4 * num_system_values)); nir_instr_rewrite_src(instr, &load->src[1], nir_src_for_ssa(offset)); } } } + + /* We need to fold the new iadds for brw_nir_analyze_ubo_ranges */ + nir_opt_constant_folding(nir); } else { ralloc_free(system_values); system_values = NULL;