glsl: pass gl_context to glcpp_parser_create()
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 15 Aug 2019 02:48:25 +0000 (12:48 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Wed, 20 Nov 2019 05:05:55 +0000 (05:05 +0000)
This is a small tidy up and will be useful in the following commit.

Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
src/compiler/glsl/glcpp/glcpp-parse.y
src/compiler/glsl/glcpp/glcpp.h
src/compiler/glsl/glcpp/pp.c

index b975e8b3f40d1f77fef4ee8b6e144d0aa3ed1482..4ae78fbf8f27bd248632c0fb629034cba1329ec9 100644 (file)
@@ -1368,8 +1368,8 @@ add_builtin_define(glcpp_parser_t *parser, const char *name, int value)
 #define INITIAL_PP_OUTPUT_BUF_SIZE 4048
 
 glcpp_parser_t *
-glcpp_parser_create(const struct gl_extensions *extension_list,
-                    glcpp_extension_iterator extensions, void *state, gl_api api)
+glcpp_parser_create(struct gl_context *gl_ctx,
+                    glcpp_extension_iterator extensions, void *state)
 {
    glcpp_parser_t *parser;
 
@@ -1404,9 +1404,9 @@ glcpp_parser_create(const struct gl_extensions *extension_list,
    parser->error = 0;
 
    parser->extensions = extensions;
-   parser->extension_list = extension_list;
+   parser->extension_list = &gl_ctx->Extensions;
    parser->state = state;
-   parser->api = api;
+   parser->api = gl_ctx->API;
    parser->version = 0;
    parser->version_set = false;
 
index e786b24b132a333db8ba6ecf9e66233fa845ff2c..1b9293452087a6249d30bca31ee1dc377ea96760 100644 (file)
@@ -229,8 +229,8 @@ struct glcpp_parser {
 };
 
 glcpp_parser_t *
-glcpp_parser_create(const struct gl_extensions *extension_list,
-                    glcpp_extension_iterator extensions, void *state, gl_api api);
+glcpp_parser_create(struct gl_context *gl_ctx,
+                    glcpp_extension_iterator extensions, void *state);
 
 int
 glcpp_parser_parse (glcpp_parser_t *parser);
index 32dee11ee34b91af886f90bb29f3e701de914ff4..aadf899a7d0cdcafc5c5b285bfffb339cfb24939 100644 (file)
@@ -228,7 +228,7 @@ glcpp_preprocess(void *ralloc_ctx, const char **shader, char **info_log,
 {
        int errors;
        glcpp_parser_t *parser =
-               glcpp_parser_create(&gl_ctx->Extensions, extensions, state, gl_ctx->API);
+               glcpp_parser_create(gl_ctx, extensions, state);
 
        if (! gl_ctx->Const.DisableGLSLLineContinuations)
                *shader = remove_line_continuations(parser, *shader);