summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-08-18 11:42:02 -0700
committerJason Ekstrand <[email protected]>2015-08-25 10:18:27 -0700
commitcfa056c6a5eadf87f92a71346c0dddd2a080e302 (patch)
tree8e5a088c6b71ac3e427d55f4e36ae81cbf68748a /src
parentce5e9139aa1eee78e9154ded84b724b0cecbece7 (diff)
i965/vec4_nir: Get rid of the uniform_driver_location tracking
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_nir.cpp22
2 files changed, 3 insertions, 20 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h
index 59a83977360..673a29e4b7f 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.h
+++ b/src/mesa/drivers/dri/i965/brw_vec4.h
@@ -447,7 +447,6 @@ public:
dst_reg *nir_locals;
dst_reg *nir_ssa_values;
src_reg *nir_inputs;
- unsigned *nir_uniform_driver_location;
dst_reg *nir_system_values;
protected:
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
index 9e52229190e..59e440a899d 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
@@ -132,9 +132,6 @@ vec4_visitor::nir_setup_uniforms(nir_shader *shader)
{
uniforms = 0;
- nir_uniform_driver_location =
- rzalloc_array(mem_ctx, unsigned, this->uniform_array_size);
-
if (shader_prog) {
foreach_list_typed(nir_variable, var, node, &shader->uniforms) {
/* UBO's, atomics and samplers don't take up space in the
@@ -182,7 +179,6 @@ vec4_visitor::nir_setup_uniforms(nir_shader *shader)
stage_prog_data->param[uniforms * 4 + i] = &zero;
}
- nir_uniform_driver_location[uniforms] = var->data.driver_location;
uniforms++;
}
}
@@ -230,7 +226,6 @@ vec4_visitor::nir_setup_uniform(nir_variable *var)
stage_prog_data->param[uniforms * 4 + i] = &zero;
}
- nir_uniform_driver_location[uniforms] = var->data.driver_location;
uniforms++;
}
}
@@ -263,7 +258,6 @@ vec4_visitor::nir_setup_builtin_uniform(nir_variable *var)
(var->type->is_scalar() || var->type->is_vector() ||
var->type->is_matrix() ? var->type->vector_elements : 4);
- nir_uniform_driver_location[uniforms] = var->data.driver_location;
uniforms++;
}
}
@@ -570,24 +564,14 @@ vec4_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr)
has_indirect = true;
/* fallthrough */
case nir_intrinsic_load_uniform: {
- int uniform = instr->const_index[0] + instr->const_index[1];
-
dest = get_nir_dest(instr->dest);
- if (has_indirect) {
- /* Split addressing into uniform and offset */
- int offset = uniform - nir_uniform_driver_location[uniform];
- assert(offset >= 0);
-
- uniform -= offset;
- assert(uniform >= 0);
+ src = src_reg(dst_reg(UNIFORM, instr->const_index[0]));
+ src.reg_offset = instr->const_index[1];
- src = src_reg(dst_reg(UNIFORM, uniform));
- src.reg_offset = offset;
+ if (has_indirect) {
src_reg tmp = get_nir_src(instr->src[0], BRW_REGISTER_TYPE_D, 1);
src.reladdr = new(mem_ctx) src_reg(tmp);
- } else {
- src = src_reg(dst_reg(UNIFORM, uniform));
}
emit(MOV(dest, src));