summaryrefslogtreecommitdiffstats
path: root/src/glsl/main.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-10-14 13:28:42 -0700
committerIan Romanick <[email protected]>2010-10-14 17:16:59 -0700
commit3322fbaf3b5e305ce00c1d08c26965bb98e0cef0 (patch)
tree30aba427f916748177148fb74e495619c527e8a6 /src/glsl/main.cpp
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/glsl/main.cpp')
-rw-r--r--src/glsl/main.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index 9350592196d..08a44c96e57 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -40,8 +40,19 @@
extern "C" struct gl_shader *
_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type);
+extern "C" void
+_mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
+ struct gl_shader *sh);
+
/* Copied from shader_api.c for the stand-alone compiler.
*/
+void
+_mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
+ struct gl_shader *sh)
+{
+ *ptr = sh;
+}
+
struct gl_shader *
_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type)
{
@@ -319,7 +330,7 @@ main(int argc, char **argv)
printf("Info log for linking:\n%s\n", whole_program->InfoLog);
}
- for (unsigned i = 0; i < whole_program->_NumLinkedShaders; i++)
+ for (unsigned i = 0; i < MESA_SHADER_TYPES; i++)
talloc_free(whole_program->_LinkedShaders[i]);
talloc_free(whole_program);