diff options
-rw-r--r-- | src/glsl/nir/nir_lower_io.c | 9 |
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; |