diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index f3fdf6ed3c5..04d2ae850cf 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -148,25 +148,3 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) return; #endif } - -void -resource_name_updated(struct gl_resource_name *name) -{ - if (name->string) { - name->length = strlen(name->string); - - const char *last_square_bracket = strrchr(name->string, '['); - if (last_square_bracket) { - name->last_square_bracket = last_square_bracket - name->string; - name->suffix_is_zero_square_bracketed = - strcmp(last_square_bracket, "[0]") == 0; - } else { - name->last_square_bracket = -1; - name->suffix_is_zero_square_bracketed = false; - } - } else { - name->length = 0; - name->last_square_bracket = -1; - name->suffix_is_zero_square_bracketed = false; - } -} diff --git a/src/compiler/glsl/linker_util.cpp b/src/compiler/glsl/linker_util.cpp index 75b549cf394..416d5bc2f1d 100644 --- a/src/compiler/glsl/linker_util.cpp +++ b/src/compiler/glsl/linker_util.cpp @@ -507,3 +507,25 @@ _mesa_glsl_can_implicitly_convert(const glsl_type *from, const glsl_type *desire return false; } + +void +resource_name_updated(struct gl_resource_name *name) +{ + if (name->string) { + name->length = strlen(name->string); + + const char *last_square_bracket = strrchr(name->string, '['); + if (last_square_bracket) { + name->last_square_bracket = last_square_bracket - name->string; + name->suffix_is_zero_square_bracketed = + strcmp(last_square_bracket, "[0]") == 0; + } else { + name->last_square_bracket = -1; + name->suffix_is_zero_square_bracketed = false; + } + } else { + name->length = 0; + name->last_square_bracket = -1; + name->suffix_is_zero_square_bracketed = false; + } +} diff --git a/src/compiler/glsl/linker_util.h b/src/compiler/glsl/linker_util.h index 1f1ec43c1d2..f7965126700 100644 --- a/src/compiler/glsl/linker_util.h +++ b/src/compiler/glsl/linker_util.h @@ -129,6 +129,9 @@ link_util_mark_array_elements_referenced(const struct array_deref_range *dr, unsigned count, unsigned array_depth, BITSET_WORD *bits); +void +resource_name_updated(struct gl_resource_name *name); + /** * Get the string value for an interpolation qualifier * diff --git a/src/compiler/glsl/serialize.cpp b/src/compiler/glsl/serialize.cpp index 6d2a487c458..a929d6d0a49 100644 --- a/src/compiler/glsl/serialize.cpp +++ b/src/compiler/glsl/serialize.cpp @@ -29,9 +29,9 @@ * Supports serializing and deserializing glsl programs using a blob. */ +#include "compiler/glsl/linker_util.h" #include "compiler/glsl_types.h" #include "compiler/shader_info.h" -#include "ir_uniform.h" #include "main/mtypes.h" #include "main/shaderobj.h" #include "program/program.h"