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.
This commit is contained in:
Ian Romanick
2010-09-08 11:33:12 -07:00
parent 16887d042a
commit 961f42c9bd
2 changed files with 4 additions and 2 deletions
+2 -1
View 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;
+2 -1
View File
@@ -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;