[Mesa-dev] [PATCH 1/5] mesa: Prevent repeated glDeleteProgram() from blowing away our refcounts.

Chad Versace chad at chad-versace.us
Thu Oct 6 10:26:44 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/06/2011 09:36 AM, Eric Anholt wrote:
> glDeleteProgram should only be able to remove the one refcount for the
> user's reference to the program from the hash table (even though that
> ref does live on in the hash table until the last other ref is
> removed).
> 
> Fixes piglit ARB_shader_objects/delete-repeat.
> ---
>  src/mesa/main/shaderapi.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
> index 9e0ed9c..bc62c4b 100644
> --- a/src/mesa/main/shaderapi.c
> +++ b/src/mesa/main/shaderapi.c
> @@ -390,10 +390,12 @@ delete_shader_program(struct gl_context *ctx, GLuint name)
>     if (!shProg)
>        return;
>  
> -   shProg->DeletePending = GL_TRUE;
> +   if (!shProg->DeletePending) {
> +      shProg->DeletePending = GL_TRUE;
>  
> -   /* effectively, decr shProg's refcount */
> -   _mesa_reference_shader_program(ctx, &shProg, NULL);
> +      /* effectively, decr shProg's refcount */
> +      _mesa_reference_shader_program(ctx, &shProg, NULL);
> +   }
>  }
>  
>  

Just for patch 1,
Reviewed-by: Chad Versace <chad at chad-versace.us>

I can't vouch for 2-5.

- -- 
Chad Versace
chad at chad-versace.us
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOjeTUAAoJEAIvNt057x8i5JsP+gPZce2PF4Y9yjY/p3EMf09W
a9qLddLKcxYtFl7hfH2zw0rICvkBl2AyYcc7+FfIn6PALZxPEyfQVCHWPLOGFH02
+SPuCmLSdb+traaEK0uqfhelIdR4k+5QF5x4L77DP24VeHImtrK7ygprrylsjh2L
LOecZHhtxRzRjcleIUkLI4fR6t5pbuREi8zSrCZEciC/KcVp+96HkwE9m2HMt28D
M6FLsRmglVYkU1AjFp0dj71VSicNRqlmX2bS+Gom5oHXBGXeQgIyjiiZSGf0LrAE
ejbzLozYu4o418889VBqT0uB42UW5arQ4dyytbBfAY/+jJnDkQdbBgMmytfmHzxj
IJCKiw/xbYKH0IqI4U6x9W9ZzeoFAojCHVKVWyVbyww3iMs0WGgEUmbP0ZniWEkT
yVMCjSkrOTxa5iZ2RYlmwEpYRbngUAw8nTH7Z+6q/rSk3hSjwe4iGp04AXup+qJs
rK/i3FcssmmnoD0ccpxFv9FbgOVohH0Gm5Wm/+CHQv5drY53WcY0oItT674yOMys
wEwae0Su0ihWet4K4A/ZWssDNNs9JDuFfs6OvGTZ1Puw2tSsR9kppuzQLiig+aEr
reAD5wsuhCO1c5zE6QKzfHUIprEx6r/GTCVLlywcQTEFwrZ4yRhFXYPFdI3kxF83
O1zafNpfZ/WCAI7XxG7u
=jvlJ
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list