summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-08-18 11:20:40 -0700
committerJason Ekstrand <[email protected]>2015-08-25 10:18:27 -0700
commitce5e9139aa1eee78e9154ded84b724b0cecbece7 (patch)
treeeeecb57cb8e68c907ef63f3c6c10f365a5375b02 /src/glsl
parent0db8e87b4a16b123f7c0b44d54f23b535a136ee6 (diff)
nir/lower_io: Separate driver_location and base offset for uniforms
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/nir/nir_lower_io.c9
1 files 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;