From: Jason Ekstrand Date: Tue, 18 Aug 2015 18:20:40 +0000 (-0700) Subject: nir/lower_io: Separate driver_location and base offset for uniforms X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ce5e9139aa1eee78e9154ded84b724b0cecbece7;p=mesa.git nir/lower_io: Separate driver_location and base offset for uniforms Reviewed-by: Kenneth Graunke --- diff --git a/src/glsl/nir/nir_lower_io.c b/src/glsl/nir/nir_lower_io.c index 15a4edc90a9..70645b65246 100644 --- a/src/glsl/nir/nir_lower_io.c +++ b/src/glsl/nir/nir_lower_io.c @@ -244,9 +244,14 @@ nir_lower_io_block(nir_block *block, void *void_state) nir_src indirect; unsigned offset = get_io_offset(intrin->variables[0], &intrin->instr, &indirect, state); - offset += intrin->variables[0]->var->data.driver_location; - load->const_index[0] = offset; + unsigned location = intrin->variables[0]->var->data.driver_location; + if (mode == nir_var_uniform) { + load->const_index[0] = location; + load->const_index[1] = offset; + } else { + load->const_index[0] = location + offset; + } if (has_indirect) load->src[0] = indirect;