We have a requirement to store the index into the mesa parameterlist
for uniforms. Up until now we've overwritten var->data.location with
this info. However this then stops us accessing UniformStorage,
which is needed to do proper dereferencing.
Add a new variable to ir_variable to store this value in, and change
the two uses to use it correctly.
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
*/
int location;
+ /**
+ * for glsl->tgsi/mesa IR we need to store the index into the
+ * parameters for uniforms, initially the code overloaded location
+ * but this causes problems with indirect samplers and AoA.
+ * This is assigned in _mesa_generate_parameters_list_for_uniforms.
+ */
+ int param_index;
+
/**
* Vertex stream output identifier.
*/
switch (var->data.mode) {
case ir_var_uniform:
entry = new(mem_ctx) variable_storage(var, PROGRAM_UNIFORM,
- var->data.location);
+ var->data.param_index);
this->variables.push_tail(entry);
break;
case ir_var_shader_in:
{
this->idx = -1;
this->program_resource_visitor::process(var);
-
- var->data.location = this->idx;
+ var->data.param_index = this->idx;
}
private:
switch (var->data.mode) {
case ir_var_uniform:
entry = new(mem_ctx) variable_storage(var, PROGRAM_UNIFORM,
- var->data.location);
+ var->data.param_index);
this->variables.push_tail(entry);
break;
case ir_var_shader_in: