glcpp: Check version_resolved in the proper place.

The check was in the wrong place, such that if a shader incorrectly put
a preprocessor token before the #version declaration, the version would
be resolved twice, leading to a segmentation fault when attempting to
redefine the __VERSION__ macro.

 #extension GL_ARB_sample_shading: require
 #version 130
 void main() {}

Also, rename glcpp_parser_resolve_version to
             glcpp_parser_resolve_implicit_version to avoid confusion.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Matt Turner
2014-01-25 11:57:02 -08:00
parent a818bf481a
commit 3e0e9e3bf9
3 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -203,7 +203,7 @@ void
glcpp_parser_destroy (glcpp_parser_t *parser);
void
glcpp_parser_resolve_version(glcpp_parser_t *parser);
glcpp_parser_resolve_implicit_version(glcpp_parser_t *parser);
int
glcpp_preprocess(void *ralloc_ctx, const char **shader, char **info_log,