summaryrefslogtreecommitdiffstats
path: root/src/glsl/main.cpp
diff options
context:
space:
mode:
authorChristian König <[email protected]>2010-10-28 20:24:56 +0200
committerChristian König <[email protected]>2010-10-28 20:24:56 +0200
commit41ed47d6b8fb6c032e2907ef2e49e414c26f35c1 (patch)
tree8cf267ee3ac5d8b530dd70a28a0d568344aa8304 /src/glsl/main.cpp
parent97a7cf230a70c64fff300931ae7c00aa00449c97 (diff)
parent5479fa34d9acebd55f68c23a278cf382d0e84248 (diff)
Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa into pipe-video
Conflicts: src/gallium/include/pipe/p_format.h
Diffstat (limited to 'src/glsl/main.cpp')
-rw-r--r--src/glsl/main.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index 94c14a58a7b..08a44c96e57 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -38,12 +38,23 @@
#include "loop_analysis.h"
extern "C" struct gl_shader *
-_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type);
+_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(GLcontext *ctx, GLuint name, GLenum type)
+_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type)
{
struct gl_shader *shader;
@@ -60,7 +71,7 @@ _mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type)
}
static void
-initialize_context(GLcontext *ctx, gl_api api)
+initialize_context(struct gl_context *ctx, gl_api api)
{
memset(ctx, 0, sizeof(*ctx));
@@ -160,7 +171,7 @@ const struct option compiler_opts[] = {
};
void
-compile_shader(GLcontext *ctx, struct gl_shader *shader)
+compile_shader(struct gl_context *ctx, struct gl_shader *shader)
{
struct _mesa_glsl_parse_state *state =
new(shader) _mesa_glsl_parse_state(ctx, shader->Type, shader);
@@ -252,8 +263,8 @@ int
main(int argc, char **argv)
{
int status = EXIT_SUCCESS;
- GLcontext local_ctx;
- GLcontext *ctx = &local_ctx;
+ struct gl_context local_ctx;
+ struct gl_context *ctx = &local_ctx;
int c;
int idx = 0;
@@ -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);