From ce5e9139aa1eee78e9154ded84b724b0cecbece7 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 18 Aug 2015 11:20:40 -0700 Subject: [PATCH] nir/lower_io: Separate driver_location and base offset for uniforms Reviewed-by: Kenneth Graunke --- src/glsl/nir/nir_lower_io.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; -- 2.30.2