summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-05-07 20:18:49 -0600
committerBrian Paul <[email protected]>2008-05-07 20:18:49 -0600
commita266af9200444a4f651e0ff0cf54e533be38d44d (patch)
treec2041831b6d93f816ecd5f202d53f25c70712df7
parent1a82d9648b3db780e58e4966924157542d148c58 (diff)
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.
-rw-r--r--src/mesa/shader/shader_api.c4
1 files changed, 4 insertions, 0 deletions
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);
}