diff options
Diffstat (limited to 'src/compiler/spirv/vtn_private.h')
-rw-r--r-- | src/compiler/spirv/vtn_private.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h index b43b013d523..7cb503568fe 100644 --- a/src/compiler/spirv/vtn_private.h +++ b/src/compiler/spirv/vtn_private.h @@ -203,6 +203,7 @@ enum vtn_base_type { vtn_base_type_matrix, vtn_base_type_array, vtn_base_type_struct, + vtn_base_type_pointer, vtn_base_type_image, vtn_base_type_sampler, vtn_base_type_function, @@ -260,6 +261,15 @@ struct vtn_type { bool builtin_block:1; }; + /* Members for pointer types */ + struct { + /* For pointers, the vtn_type for dereferenced type */ + struct vtn_type *deref; + + /* Storage class for pointers */ + SpvStorageClass storage_class; + }; + /* Members for image types */ struct { /* For images, indicates whether it's sampled or storage */ @@ -327,6 +337,14 @@ struct vtn_pointer { /** 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 @@ -529,7 +547,8 @@ nir_ssa_def *vtn_vector_insert_dynamic(struct vtn_builder *b, nir_ssa_def *src, nir_deref_var *vtn_nir_deref(struct vtn_builder *b, uint32_t id); struct vtn_pointer *vtn_pointer_for_variable(struct vtn_builder *b, - struct vtn_variable *var); + struct vtn_variable *var, + struct vtn_type *ptr_type); nir_deref_var *vtn_pointer_to_deref(struct vtn_builder *b, struct vtn_pointer *ptr); |