On 1 November 2016 at 23:47, Timothy Arceri <timothy.arc...@collabora.com> wrote: > This move the delete linked shaders call to > _mesa_clear_shader_program_data() which makes sure we delete them > before returning due to any validation problems. > > It also reduces some code duplication. > > Cc: Tapani Pälli <tapani.pa...@intel.com> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97715 > Cc: "12.0 13.0" <mesa-sta...@lists.freedesktop.org> gl_linked_shader was introduced with commit 1fb8c6df884 ("glsl/mesa: split gl_shader in two") which happened after 12.0. I'm not familiar with all the subtleties which that work requires, so I'm inclined that we want to keep this 13.0 only ?
> --- a/src/mesa/main/shaderobj.c > +++ b/src/mesa/main/shaderobj.c > @@ -291,12 +291,18 @@ _mesa_new_shader_program(GLuint name) > * Clear (free) the shader program state that gets produced by linking. > */ > void > -_mesa_clear_shader_program_data(struct gl_shader_program *shProg) > +_mesa_clear_shader_program_data(struct gl_context *ctx, > + struct gl_shader_program *shProg) > { > - unsigned i; > + for (gl_shader_stage sh = 0; sh < MESA_SHADER_STAGES; sh++) { > + if (shProg->_LinkedShaders[sh] != NULL) { > + _mesa_delete_linked_shader(ctx, shProg->_LinkedShaders[sh]); > + shProg->_LinkedShaders[sh] = NULL; > + } > + } > I think you want a similar hunk in standalone_scaffolding.{cpp,h} _mesa_clear_shader_program_data(). Thanks Emil _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev