From 961f42c9bd795204e031ea6a31a2ae04ba2e4067 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 8 Sep 2010 11:33:12 -0700 Subject: glsl2: Make sure _mesa_glsl_parse_state constructor gets a context Fix an major regression in dc754586. Too bad that change was obviously never tested. --- src/glsl/builtin_function.cpp | 3 ++- src/glsl/builtins/tools/generate_builtins.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/glsl') diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index 4a319ef999..d96c15cb30 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -35,9 +35,10 @@ _mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type); gl_shader * read_builtins(GLenum target, const char *protos, const char **functions, unsigned count) { + GLcontext fakeCtx; gl_shader *sh = _mesa_new_shader(NULL, 0, target); struct _mesa_glsl_parse_state *st = - new(sh) _mesa_glsl_parse_state(NULL, target, sh); + new(sh) _mesa_glsl_parse_state(&fakeCtx, target, sh); st->language_version = 130; st->symbols->language_version = 130; diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py index bc64b4b3b5..2431096a2b 100755 --- a/src/glsl/builtins/tools/generate_builtins.py +++ b/src/glsl/builtins/tools/generate_builtins.py @@ -128,9 +128,10 @@ _mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type); gl_shader * read_builtins(GLenum target, const char *protos, const char **functions, unsigned count) { + GLcontext fakeCtx; gl_shader *sh = _mesa_new_shader(NULL, 0, target); struct _mesa_glsl_parse_state *st = - new(sh) _mesa_glsl_parse_state(NULL, target, sh); + new(sh) _mesa_glsl_parse_state(&fakeCtx, target, sh); st->language_version = 130; st->symbols->language_version = 130; -- cgit v1.2.3