mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 06:30:10 +01:00
glsl: avoid leaking hiddenUniforms map when there are no uniforms
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
This commit is contained in:
parent
da2fdf950f
commit
19598aaa5d
1 changed files with 4 additions and 4 deletions
|
|
@ -1131,15 +1131,15 @@ link_assign_uniform_locations(struct gl_shader_program *prog,
|
|||
const unsigned num_data_slots = uniform_size.num_values;
|
||||
const unsigned hidden_uniforms = uniform_size.num_hidden_uniforms;
|
||||
|
||||
/* assign hidden uniforms a slot id */
|
||||
hiddenUniforms->iterate(assign_hidden_uniform_slot_id, &uniform_size);
|
||||
delete hiddenUniforms;
|
||||
|
||||
/* On the outside chance that there were no uniforms, bail out.
|
||||
*/
|
||||
if (num_uniforms == 0)
|
||||
return;
|
||||
|
||||
/* assign hidden uniforms a slot id */
|
||||
hiddenUniforms->iterate(assign_hidden_uniform_slot_id, &uniform_size);
|
||||
delete hiddenUniforms;
|
||||
|
||||
struct gl_uniform_storage *uniforms =
|
||||
rzalloc_array(prog, struct gl_uniform_storage, num_uniforms);
|
||||
union gl_constant_value *data =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue