From: Brian Paul Date: Thu, 8 May 2008 02:18:49 +0000 (-0600) Subject: mesa: minor fixes in _mesa_free_shader_program_data() and _mesa_link_program() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a266af9200444a4f651e0ff0cf54e533be38d44d;p=mesa.git mesa: minor fixes in _mesa_free_shader_program_data() and _mesa_link_program() From master: Set shProg->NumShaders = 0 after freeing program's list of shaders. Set _NEW_PROGRAM in _mesa_link_program() to fix a state validation bug. --- diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index f12fa28d97b..5ec03563ba2 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -126,6 +126,8 @@ _mesa_free_shader_program_data(GLcontext *ctx, for (i = 0; i < shProg->NumShaders; i++) { _mesa_reference_shader(ctx, &shProg->Shaders[i], NULL); } + shProg->NumShaders = 0; + if (shProg->Shaders) { _mesa_free(shProg->Shaders); shProg->Shaders = NULL; @@ -1008,6 +1010,8 @@ _mesa_link_program(GLcontext *ctx, GLuint program) return; } + FLUSH_VERTICES(ctx, _NEW_PROGRAM); + _slang_link(ctx, program, shProg); }