X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fcompiler%2Fglsl%2Flinker_util.h;h=16f5ca9e4018c67e868dacb8d96827d854dad0d6;hb=HEAD;hp=7d355d10659a46932bb414eb714acd5b58cb2b35;hpb=05c1f7a15447a9cc0f0bdd2d2f109092cb7c9f9e;p=mesa.git diff --git a/src/compiler/glsl/linker_util.h b/src/compiler/glsl/linker_util.h index 7d355d10659..16f5ca9e401 100644 --- a/src/compiler/glsl/linker_util.h +++ b/src/compiler/glsl/linker_util.h @@ -24,6 +24,8 @@ #ifndef GLSL_LINKER_UTIL_H #define GLSL_LINKER_UTIL_H +#include "util/bitset.h" + struct gl_context; struct gl_shader_program; struct gl_uniform_storage; @@ -45,6 +47,23 @@ struct empty_uniform_block { unsigned slots; }; +/** + * Describes an access of an array element or an access of the whole array + */ +struct array_deref_range { + /** + * Index that was accessed. + * + * All valid array indices are less than the size of the array. If index + * is equal to the size of the array, this means the entire array has been + * accessed (e.g., due to use of a non-constant index). + */ + unsigned index; + + /** Size of the array. Used for offset calculations. */ + unsigned size; +}; + void linker_error(struct gl_shader_program *prog, const char *fmt, ...); @@ -78,6 +97,14 @@ void link_util_check_uniform_resources(struct gl_context *ctx, struct gl_shader_program *prog); +void +link_util_calculate_subroutine_compat(struct gl_shader_program *prog); + +void +link_util_mark_array_elements_referenced(const struct array_deref_range *dr, + unsigned count, unsigned array_depth, + BITSET_WORD *bits); + #ifdef __cplusplus } #endif