From: Timothy Arceri Date: Thu, 15 Aug 2019 02:48:25 +0000 (+1000) Subject: glsl: pass gl_context to glcpp_parser_create() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e0fd2fa6894d875854990a33e41d538f0cdea24c;p=mesa.git glsl: pass gl_context to glcpp_parser_create() This is a small tidy up and will be useful in the following commit. Reviewed-by: Witold Baryluk --- diff --git a/src/compiler/glsl/glcpp/glcpp-parse.y b/src/compiler/glsl/glcpp/glcpp-parse.y index b975e8b3f40..4ae78fbf8f2 100644 --- a/src/compiler/glsl/glcpp/glcpp-parse.y +++ b/src/compiler/glsl/glcpp/glcpp-parse.y @@ -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; diff --git a/src/compiler/glsl/glcpp/glcpp.h b/src/compiler/glsl/glcpp/glcpp.h index e786b24b132..1b929345208 100644 --- a/src/compiler/glsl/glcpp/glcpp.h +++ b/src/compiler/glsl/glcpp/glcpp.h @@ -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); diff --git a/src/compiler/glsl/glcpp/pp.c b/src/compiler/glsl/glcpp/pp.c index 32dee11ee34..aadf899a7d0 100644 --- a/src/compiler/glsl/glcpp/pp.c +++ b/src/compiler/glsl/glcpp/pp.c @@ -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);