Mesa (master): glsl/builtins: Set the API in the fake context.
Kenneth Graunke
kwg at kemper.freedesktop.org
Thu Sep 9 00:38:56 UTC 2010
Module: Mesa
Branch: master
Commit: 7fc882643ce1c57fb8f60d8c5edd761eff404749
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7fc882643ce1c57fb8f60d8c5edd761eff404749
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Wed Sep 8 16:03:33 2010 -0700
glsl/builtins: Set the API in the fake context.
Otherwise it gets used uninitialized.
---
src/glsl/builtin_function.cpp | 1 +
src/glsl/builtins/tools/generate_builtins.py | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp
index 944265c..d897fa6 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 f96a5f7..691a318 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);
More information about the mesa-commit
mailing list