nir: Allow var_mem_global in nir_lower_vars_to_explicit_types
[mesa.git] / src / compiler / glsl / linker_util.h
index 7d355d10659a46932bb414eb714acd5b58cb2b35..16f5ca9e4018c67e868dacb8d96827d854dad0d6 100644 (file)
@@ -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