+struct vtn_pointer {
+ /** The variable mode for the referenced data */
+ enum vtn_variable_mode mode;
+
+ /** The dereferenced type of this pointer */
+ struct vtn_type *type;
+
+ /** The pointer type of this pointer
+ *
+ * This may be NULL for some temporary pointers constructed as part of a
+ * large load, store, or copy. It MUST be valid for all pointers which are
+ * stored as SPIR-V SSA values.
+ */
+ struct vtn_type *ptr_type;
+
+ /** The referenced variable, if known
+ *
+ * This field may be NULL if the pointer uses a (block_index, offset) pair
+ * instead of an access chain.
+ */
+ struct vtn_variable *var;
+
+ /** An access chain describing how to get from var to the referenced data
+ *
+ * This field may be NULL if the pointer references the entire variable or
+ * if a (block_index, offset) pair is used instead of an access chain.
+ */
+ struct vtn_access_chain *chain;
+
+ /** A (block_index, offset) pair representing a UBO or SSBO position. */
+ struct nir_ssa_def *block_index;
+ struct nir_ssa_def *offset;
+};
+
+static inline bool
+vtn_pointer_uses_ssa_offset(struct vtn_pointer *ptr)
+{
+ return ptr->mode == vtn_variable_mode_ubo ||
+ ptr->mode == vtn_variable_mode_ssbo;
+}
+