summaryrefslogtreecommitdiffstats
path: root/src/glsl/main.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-07-09 14:09:34 -0700
committerIan Romanick <[email protected]>2010-07-12 15:19:30 -0700
commit3fb878722ed53d79eedb9fe68972ef32b79575d4 (patch)
treed4bc461a90811cc3f40b1559f3e1226c20260147 /src/glsl/main.cpp
parentffd7bb031e67f0d4e1eb36aa27261e8744e7b133 (diff)
linker: Stub-out intrastage linker
Diffstat (limited to 'src/glsl/main.cpp')
-rw-r--r--src/glsl/main.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index dd43d12474b..8b0bccdcb71 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -36,6 +36,25 @@
#include "ir_print_visitor.h"
#include "program.h"
+extern "C" struct gl_shader *
+_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type);
+
+/* Copied from shader_api.c for the stand-alone compiler.
+ */
+struct gl_shader *
+_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type)
+{
+ struct gl_shader *shader;
+ assert(type == GL_FRAGMENT_SHADER || type == GL_VERTEX_SHADER);
+ shader = talloc_zero(NULL, struct gl_shader);
+ if (shader) {
+ shader->Type = type;
+ shader->Name = name;
+ shader->RefCount = 1;
+ }
+ return shader;
+}
+
/* Returned string will have 'ctx' as its talloc owner. */
static char *
load_text_file(void *ctx, const char *file_name)
@@ -271,6 +290,9 @@ 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++)
+ talloc_free(whole_program->_LinkedShaders[i]);
+
talloc_free(whole_program);
_mesa_glsl_release_types();