linker: Stub-out intrastage linker

This commit is contained in:
Ian Romanick
2010-07-09 14:09:34 -07:00
parent ffd7bb031e
commit 3fb878722e
3 changed files with 93 additions and 21 deletions
+22
View File
@@ -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();