[Mesa-dev] [PATCH 5/6] mesa: Free uniforms correclty.
Ian Romanick
idr at freedesktop.org
Fri May 25 15:19:45 PDT 2012
On 05/24/2012 06:29 PM, Stéphane Marchesin wrote:
> From: Antoine Labour<piman at chromium.org>
>
> This is an array of uniforms, not a single one.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
This should also be tagged with:
NOTE: This is a candidate for the 8.0 branch.
> ---
> src/mesa/main/shaderobj.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
> index 7eb6f0b..d5ebf54 100644
> --- a/src/mesa/main/shaderobj.c
> +++ b/src/mesa/main/shaderobj.c
> @@ -278,7 +278,8 @@ _mesa_clear_shader_program_data(struct gl_context *ctx,
> struct gl_shader_program *shProg)
> {
> if (shProg->UniformStorage) {
> - _mesa_uniform_detach_all_driver_storage(shProg->UniformStorage);
> + for (unsigned i = 0; i< shProg->NumUserUniformStorage; ++i)
> + _mesa_uniform_detach_all_driver_storage(&shProg->UniformStorage[i]);
> ralloc_free(shProg->UniformStorage);
> shProg->NumUserUniformStorage = 0;
> shProg->UniformStorage = NULL;
More information about the mesa-dev
mailing list