Mesa (master): nir/lower_io: Separate driver_location and base offset for uniforms
Jason Ekstrand
jekstrand at kemper.freedesktop.org
Tue Aug 25 18:04:26 UTC 2015
Module: Mesa
Branch: master
Commit: ce5e9139aa1eee78e9154ded84b724b0cecbece7
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ce5e9139aa1eee78e9154ded84b724b0cecbece7
Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date: Tue Aug 18 11:20:40 2015 -0700
nir/lower_io: Separate driver_location and base offset for uniforms
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
---
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 15a4edc..70645b6 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;
More information about the mesa-commit
mailing list