summaryrefslogtreecommitdiff
path: root/src/mesa/main/shaderobj.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-10-14 13:28:42 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-10-14 17:16:59 -0700
commit3322fbaf3b5e305ce00c1d08c26965bb98e0cef0 (patch)
tree30aba427f916748177148fb74e495619c527e8a6 /src/mesa/main/shaderobj.c
parent4b4284c9c9b472f750663352485290c22f8c3921 (diff)
glsl: Slightly change the semantic of _LinkedShaders
Previously _LinkedShaders was a compact array of the linked shaders for each shader stage. Now it is arranged such that each slot, indexed by the MESA_SHADER_* defines, refers to a specific shader stage. As a result, some slots will be NULL. This makes things a little more complex in the linker, but it simplifies things in other places. As a side effect _NumLinkedShaders is removed. NOTE: This may be a candidate for the 7.9 branch. If there are other patches that get backported to 7.9 that use _LinkedShader, this patch should be cherry picked also.
Diffstat (limited to 'src/mesa/main/shaderobj.c')
-rw-r--r--src/mesa/main/shaderobj.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index e0ffa2f289..b6594cbe6f 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -326,10 +326,12 @@ _mesa_free_shader_program_data(struct gl_context *ctx,
shProg->TransformFeedback.NumVarying = 0;
- for (i = 0; i < shProg->_NumLinkedShaders; i++) {
- ctx->Driver.DeleteShader(ctx, shProg->_LinkedShaders[i]);
+ for (i = 0; i < MESA_SHADER_TYPES; i++) {
+ if (shProg->_LinkedShaders[i] != NULL) {
+ ctx->Driver.DeleteShader(ctx, shProg->_LinkedShaders[i]);
+ shProg->_LinkedShaders[i] = NULL;
+ }
}
- shProg->_NumLinkedShaders = 0;
}