glsl/builtins: Set the API in the fake context.

Otherwise it gets used uninitialized.
This commit is contained in:
Kenneth Graunke
2010-09-08 16:03:33 -07:00
parent f69a6647fb
commit 7fc882643c
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -36,6 +36,7 @@ gl_shader *
read_builtins(GLenum target, const char *protos, const char **functions, unsigned count)
{
GLcontext fakeCtx;
fakeCtx.API = API_OPENGL;
gl_shader *sh = _mesa_new_shader(NULL, 0, target);
struct _mesa_glsl_parse_state *st =
new(sh) _mesa_glsl_parse_state(&fakeCtx, target, sh);
@@ -129,6 +129,7 @@ gl_shader *
read_builtins(GLenum target, const char *protos, const char **functions, unsigned count)
{
GLcontext fakeCtx;
fakeCtx.API = API_OPENGL;
gl_shader *sh = _mesa_new_shader(NULL, 0, target);
struct _mesa_glsl_parse_state *st =
new(sh) _mesa_glsl_parse_state(&fakeCtx, target, sh);