summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-09-08 16:03:33 -0700
committerKenneth Graunke <kenneth@whitecape.org>2010-09-08 17:38:42 -0700
commit7fc882643ce1c57fb8f60d8c5edd761eff404749 (patch)
treeffbdf3ee78380fd31eadb4daed256d90e06375c9 /src
parentf69a6647fbd5e7cf4406fcc877ff78b507344073 (diff)
glsl/builtins: Set the API in the fake context.
Otherwise it gets used uninitialized.
Diffstat (limited to 'src')
-rw-r--r--src/glsl/builtin_function.cpp1
-rwxr-xr-xsrc/glsl/builtins/tools/generate_builtins.py1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp
index 944265ca94..d897fa65ec 100644
--- a/src/glsl/builtin_function.cpp
+++ b/src/glsl/builtin_function.cpp
@@ -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);
diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py
index f96a5f7b8b..691a318c1c 100755
--- a/src/glsl/builtins/tools/generate_builtins.py
+++ b/src/glsl/builtins/tools/generate_builtins.py
@@ -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);