nir/lower_io: Separate driver_location and base offset for uniforms

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Jason Ekstrand 2015-08-18 11:20:40 -07:00
parent 0db8e87b4a
commit ce5e9139aa

View file

@ -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;