Uniform names (even for hidden uniforms) are required to be unique; some
parts of the compiler assume they can be looked up by name.
Fixes the piglit test: tests/spec/glsl-1.20/linker/array-initializers-1
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
{
instructions = insts;
progress = false;
+ index = 0;
}
bool run()
private:
exec_list *instructions;
bool progress;
+ unsigned index;
};
void
void *mem_ctx = ralloc_parent(con);
+ char *uniform_name = ralloc_asprintf(mem_ctx, "constarray__%d", index++);
+
ir_variable *uni =
- new(mem_ctx) ir_variable(con->type, "constarray", ir_var_uniform);
+ new(mem_ctx) ir_variable(con->type, uniform_name, ir_var_uniform);
uni->constant_initializer = con;
uni->constant_value = con;
uni->data.has_initializer = true;