aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/glcpp/glcpp-parse.y
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-11-19 11:21:45 +0100
committermarha <marha@users.sourceforge.net>2012-11-19 11:21:45 +0100
commit57b3e446b9b4017ccfdd3227be481df590740426 (patch)
tree0e4899f530f75d343c090202fc7123c78f9b4866 /mesalib/src/glsl/glcpp/glcpp-parse.y
parent24635abae6008bef13e30d798b3f33abab412770 (diff)
parentb3e1e62c45f525cdd332073aaa34d8452cb23374 (diff)
downloadvcxsrv-57b3e446b9b4017ccfdd3227be481df590740426.tar.gz
vcxsrv-57b3e446b9b4017ccfdd3227be481df590740426.tar.bz2
vcxsrv-57b3e446b9b4017ccfdd3227be481df590740426.zip
Merge remote-tracking branch 'origin/released'
* origin/released: git update 19 nov 2012 Added bash script to update released branch Conflicts: mesalib/src/mapi/glapi/gen/gl_API.xml mesalib/src/mesa/program/.gitignore pixman/pixman/pixman-mmx.c xorg-server/Xi/xiquerypointer.c xorg-server/xkb/xkb.c
Diffstat (limited to 'mesalib/src/glsl/glcpp/glcpp-parse.y')
-rw-r--r--mesalib/src/glsl/glcpp/glcpp-parse.y83
1 files changed, 43 insertions, 40 deletions
diff --git a/mesalib/src/glsl/glcpp/glcpp-parse.y b/mesalib/src/glsl/glcpp/glcpp-parse.y
index 40c43c63e..b0537c3b0 100644
--- a/mesalib/src/glsl/glcpp/glcpp-parse.y
+++ b/mesalib/src/glsl/glcpp/glcpp-parse.y
@@ -190,6 +190,14 @@ line:
control_line {
ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n");
}
+| HASH_LINE pp_tokens NEWLINE {
+ if (parser->skip_stack == NULL ||
+ parser->skip_stack->type == SKIP_NO_SKIP)
+ {
+ _glcpp_parser_expand_and_lex_from (parser,
+ LINE_EXPANDED, $2);
+ }
+ }
| text_line {
_glcpp_parser_print_expanded_token_list (parser, $1);
ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n");
@@ -244,14 +252,6 @@ control_line:
}
ralloc_free ($2);
}
-| HASH_LINE pp_tokens NEWLINE {
- if (parser->skip_stack == NULL ||
- parser->skip_stack->type == SKIP_NO_SKIP)
- {
- _glcpp_parser_expand_and_lex_from (parser,
- LINE_EXPANDED, $2);
- }
- }
| HASH_IF conditional_tokens NEWLINE {
/* Be careful to only evaluate the 'if' expression if
* we are not skipping. When we are skipping, we
@@ -327,12 +327,12 @@ control_line:
glcpp_warning(& @1, parser, "ignoring illegal #elif without expression");
}
}
-| HASH_ELSE NEWLINE {
+| HASH_ELSE {
_glcpp_parser_skip_stack_change_if (parser, & @1, "else", 1);
- }
-| HASH_ENDIF NEWLINE {
+ } NEWLINE
+| HASH_ENDIF {
_glcpp_parser_skip_stack_pop (parser, & @1);
- }
+ } NEWLINE
| HASH_VERSION integer_constant NEWLINE {
macro_t *macro = hash_table_find (parser->defines, "__VERSION__");
if (macro) {
@@ -1150,46 +1150,49 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api)
parser->new_source_number = 0;
/* Add pre-defined macros. */
- add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
- add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
+ if (extensions != NULL) {
+ if (extensions->OES_EGL_image_external)
+ add_builtin_define(parser, "GL_OES_EGL_image_external", 1);
+ }
if (api == API_OPENGLES2)
add_builtin_define(parser, "GL_ES", 1);
+ else {
+ add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
+ add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
- if (extensions != NULL) {
- if (extensions->EXT_texture_array) {
- add_builtin_define(parser, "GL_EXT_texture_array", 1);
- }
+ if (extensions != NULL) {
+ if (extensions->EXT_texture_array) {
+ add_builtin_define(parser, "GL_EXT_texture_array", 1);
+ }
- if (extensions->ARB_fragment_coord_conventions)
- add_builtin_define(parser, "GL_ARB_fragment_coord_conventions",
- 1);
+ if (extensions->ARB_fragment_coord_conventions)
+ add_builtin_define(parser, "GL_ARB_fragment_coord_conventions",
+ 1);
- if (extensions->ARB_explicit_attrib_location)
- add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 1);
+ if (extensions->ARB_explicit_attrib_location)
+ add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 1);
- if (extensions->ARB_shader_texture_lod)
- add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1);
+ if (extensions->ARB_shader_texture_lod)
+ add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1);
- if (extensions->ARB_draw_instanced)
- add_builtin_define(parser, "GL_ARB_draw_instanced", 1);
+ if (extensions->ARB_draw_instanced)
+ add_builtin_define(parser, "GL_ARB_draw_instanced", 1);
- if (extensions->ARB_conservative_depth) {
- add_builtin_define(parser, "GL_AMD_conservative_depth", 1);
- add_builtin_define(parser, "GL_ARB_conservative_depth", 1);
- }
+ if (extensions->ARB_conservative_depth) {
+ add_builtin_define(parser, "GL_AMD_conservative_depth", 1);
+ add_builtin_define(parser, "GL_ARB_conservative_depth", 1);
+ }
- if (extensions->OES_EGL_image_external)
- add_builtin_define(parser, "GL_OES_EGL_image_external", 1);
-
- if (extensions->ARB_shader_bit_encoding)
- add_builtin_define(parser, "GL_ARB_shader_bit_encoding", 1);
+ if (extensions->ARB_shader_bit_encoding)
+ add_builtin_define(parser, "GL_ARB_shader_bit_encoding", 1);
- if (extensions->ARB_uniform_buffer_object)
- add_builtin_define(parser, "GL_ARB_uniform_buffer_object", 1);
+ if (extensions->ARB_uniform_buffer_object)
+ add_builtin_define(parser, "GL_ARB_uniform_buffer_object", 1);
- if (extensions->ARB_texture_cube_map_array)
- add_builtin_define(parser, "GL_ARB_texture_cube_map_array", 1);
+ if (extensions->ARB_texture_cube_map_array)
+ add_builtin_define(parser, "GL_ARB_texture_cube_map_array", 1);
+ }
}
language_version = 110;