diff options
author | Jason Ekstrand <[email protected]> | 2017-06-29 10:33:37 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-07-05 15:26:55 -0700 |
commit | 96f243985802281b3c6f1ca91e996d41ffef49f6 (patch) | |
tree | 45a467b857408a520d8776965eebe2c2d85a363a /src/compiler/spirv/vtn_private.h | |
parent | ad4519696d07953c16fcc023220a913cf25d3645 (diff) |
nir/spirv: Beef up the type system a bit
This adds a vtn concept of base_type as well as a couple of other
fields. This lets us be a tiny bit more efficient in some cases but,
more importantly, it will eventually let us express things the GLSL type
system can't.
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/compiler/spirv/vtn_private.h')
-rw-r--r-- | src/compiler/spirv/vtn_private.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h index 3c048fa327d..48156fac4bd 100644 --- a/src/compiler/spirv/vtn_private.h +++ b/src/compiler/spirv/vtn_private.h @@ -196,12 +196,29 @@ struct vtn_ssa_value { const struct glsl_type *type; }; +enum vtn_base_type { + vtn_base_type_void, + vtn_base_type_scalar, + vtn_base_type_vector, + vtn_base_type_matrix, + vtn_base_type_array, + vtn_base_type_struct, + vtn_base_type_image, + vtn_base_type_sampler, + vtn_base_type_function, +}; + struct vtn_type { + enum vtn_base_type base_type; + const struct glsl_type *type; /* The value that declares this type. Used for finding decorations */ struct vtn_value *val; + /* Specifies the length of complex types. */ + unsigned length; + union { /* Members for scalar, vector, and array-like types */ struct { @@ -245,6 +262,9 @@ struct vtn_type { /* Members for image types */ struct { + /* For images, indicates whether it's sampled or storage */ + bool sampled; + /* Image format for image_load_store type images */ unsigned image_format; |