summaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp/glcpp-parse.y
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-06-30 16:27:22 -0700
committerIan Romanick <[email protected]>2010-07-01 20:40:08 -0700
commit06143ea09411aa283ac3633bfbfa4326584cd952 (patch)
tree9823df6abda22c93745029eecd930e85fd9241f7 /src/glsl/glcpp/glcpp-parse.y
parent2d1223611700b33aab084f1927bfc1ff1b284115 (diff)
glsl2: Conditionally define preprocessor tokens for optional extensions
The only optional extension currently supported by the compiler is GL_EXT_texture_array.
Diffstat (limited to 'src/glsl/glcpp/glcpp-parse.y')
-rw-r--r--src/glsl/glcpp/glcpp-parse.y10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index d4cb006bbcd..e5544fe29b8 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -28,6 +28,7 @@
#include <inttypes.h>
#include "glcpp.h"
+#include "main/mtypes.h"
#define glcpp_print(stream, str) stream = talloc_strdup_append(stream, str)
#define glcpp_printf(stream, fmt, args...) \
@@ -894,7 +895,7 @@ yyerror (YYLTYPE *locp, glcpp_parser_t *parser, const char *error)
}
glcpp_parser_t *
-glcpp_parser_create (void)
+glcpp_parser_create (const struct gl_extensions *extensions)
{
glcpp_parser_t *parser;
token_t *tok;
@@ -932,6 +933,13 @@ glcpp_parser_create (void)
_token_list_append(list, tok);
_define_object_macro(parser, NULL, "GL_ARB_texture_rectangle", list);
+ if ((extensions != NULL) && extensions->EXT_texture_array) {
+ list = _token_list_create(parser);
+ _token_list_append(list, tok);
+ _define_object_macro(parser, NULL,
+ "GL_EXT_texture_array", list);
+ }
+
talloc_unlink(parser, tok);
return parser;