From: Timothy Arceri Date: Tue, 27 Aug 2019 04:22:30 +0000 (+1000) Subject: mesa: split _mesa_lookup_shader_include() in two X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f2d01cac7ea3e696c6e61952443920aa14637e7d;p=mesa.git mesa: split _mesa_lookup_shader_include() in two The new local function lookup_shader_include() will be used by glDeleteNamedStringARB() in the following patch. Reviewed-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Witold Baryluk --- diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 77513c5c529..162015c5b39 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -3280,9 +3280,9 @@ validate_and_tokenise_sh_incl(struct gl_context *ctx, return true; } -const char * -_mesa_lookup_shader_include(struct gl_context *ctx, char *path, - bool error_check) +static struct sh_incl_path_ht_entry * +lookup_shader_include(struct gl_context *ctx, char *path, + bool error_check) { void *mem_ctx = ralloc_context(NULL); struct sh_incl_path_entry *path_list; @@ -3313,7 +3313,17 @@ _mesa_lookup_shader_include(struct gl_context *ctx, char *path, ralloc_free(mem_ctx); - return sh_incl_ht_entry ? sh_incl_ht_entry->shader_source : NULL; + return sh_incl_ht_entry; +} + +const char * +_mesa_lookup_shader_include(struct gl_context *ctx, char *path, + bool error_check) +{ + struct sh_incl_path_ht_entry *shader_include = + lookup_shader_include(ctx, path, error_check); + + return shader_include ? shader_include->shader_source : NULL; } static char *