Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
_mesa_associate_uniform_storage(ctx, p.shader_program, fp->Parameters);
for (unsigned int i = 0; i < MAX_TEXTURE_UNITS; i++) {
- char *name = ralloc_asprintf(p.mem_ctx, "sampler_%d", i);
+ /* Enough space for 'sampler_999\0'.
+ */
+ char name[12];
+
+ snprintf(name, sizeof(name), "sampler_%d", i);
+
int loc = _mesa_get_uniform_location(ctx, p.shader_program, name);
if (loc != -1) {
unsigned base;