summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2015-03-23 09:12:35 +0200
committerTapani Pälli <tapani.palli@intel.com>2015-03-23 11:18:39 +0200
commit3cf99701ba6c9e56c9126fdbb74107a31ffcbcfb (patch)
tree3c35d11919a63bde80a63ad7870ab99f470efc67
parenta6d4a108d27f2b635748c583fe0507f04b3b493e (diff)
downloadexternal_mesa3d-3cf99701ba6c9e56c9126fdbb74107a31ffcbcfb.zip
external_mesa3d-3cf99701ba6c9e56c9126fdbb74107a31ffcbcfb.tar.gz
external_mesa3d-3cf99701ba6c9e56c9126fdbb74107a31ffcbcfb.tar.bz2
glsl: fix names in lower_constant_arrays_to_uniforms
Patch changes lowering pass to use unique name for each uniform so that arrays from different stages cannot end up having same name. v2: instead of global counter, use pointer to achieve unique name (Kenneth Graunke) Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89590 Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org>
-rw-r--r--src/glsl/lower_const_arrays_to_uniforms.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/glsl/lower_const_arrays_to_uniforms.cpp b/src/glsl/lower_const_arrays_to_uniforms.cpp
index 2243f47..44967dc 100644
--- a/src/glsl/lower_const_arrays_to_uniforms.cpp
+++ b/src/glsl/lower_const_arrays_to_uniforms.cpp
@@ -49,7 +49,6 @@ public:
{
instructions = insts;
progress = false;
- index = 0;
}
bool run()
@@ -63,7 +62,6 @@ public:
private:
exec_list *instructions;
bool progress;
- unsigned index;
};
void
@@ -82,7 +80,7 @@ lower_const_array_visitor::handle_rvalue(ir_rvalue **rvalue)
void *mem_ctx = ralloc_parent(con);
- char *uniform_name = ralloc_asprintf(mem_ctx, "constarray__%d", index++);
+ char *uniform_name = ralloc_asprintf(mem_ctx, "constarray__%p", dra);
ir_variable *uni =
new(mem_ctx) ir_variable(con->type, uniform_name, ir_var_uniform);