glsl2: Make sure _mesa_glsl_parse_state constructor gets a context
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 8 Sep 2010 18:33:12 +0000 (11:33 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 8 Sep 2010 18:34:22 +0000 (11:34 -0700)
Fix an major regression in dc754586.  Too bad that change was
obviously never tested.

src/glsl/builtin_function.cpp
src/glsl/builtins/tools/generate_builtins.py

index 4a319ef..d96c15c 100644 (file)
@@ -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;
index bc64b4b..2431096 100755 (executable)
@@ -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;