From 69c8cec54b01ed522bf10baf20da70304bac701a Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 28 Jan 2013 07:55:57 +0100 Subject: mesa mkfontscale pixman git update 28 jan 2013 mesa: 87592cff57feef29565150b9203e220b50623f30 mkfontscale: b3af8de8d25128f565c2ed2f7c63b6e4099eb84e pixman: 65fc1adb6545737058e938105ae948a3607c277c --- mesalib/src/glsl/glsl_types.h | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'mesalib/src/glsl/glsl_types.h') diff --git a/mesalib/src/glsl/glsl_types.h b/mesalib/src/glsl/glsl_types.h index d6f5c105e..b0db2bf11 100644 --- a/mesalib/src/glsl/glsl_types.h +++ b/mesalib/src/glsl/glsl_types.h @@ -54,6 +54,7 @@ enum glsl_base_type { GLSL_TYPE_BOOL, GLSL_TYPE_SAMPLER, GLSL_TYPE_STRUCT, + GLSL_TYPE_INTERFACE, GLSL_TYPE_ARRAY, GLSL_TYPE_VOID, GLSL_TYPE_ERROR @@ -69,6 +70,12 @@ enum glsl_sampler_dim { GLSL_SAMPLER_DIM_EXTERNAL }; +enum glsl_interface_packing { + GLSL_INTERFACE_PACKING_STD140, + GLSL_INTERFACE_PACKING_SHARED, + GLSL_INTERFACE_PACKING_PACKED +}; + #ifdef __cplusplus #include "GL/gl.h" #include "ralloc.h" @@ -84,6 +91,7 @@ struct glsl_type { * only \c GLSL_TYPE_FLOAT, \c GLSL_TYPE_INT, * and \c GLSL_TYPE_UINT are valid. */ + unsigned interface_packing:2; /* Callers of this ralloc-based new need not call delete. It's * easier to just ralloc_free 'mem_ctx' (or any of its ancestors). */ @@ -130,8 +138,9 @@ struct glsl_type { /** * For \c GLSL_TYPE_ARRAY, this is the length of the array. For - * \c GLSL_TYPE_STRUCT, it is the number of elements in the structure and - * the number of values pointed to by \c fields.structure (below). + * \c GLSL_TYPE_STRUCT or \c GLSL_TYPE_INTERFACE, it is the number of + * elements in the structure and the number of values pointed to by + * \c fields.structure (below). */ unsigned length; @@ -231,6 +240,14 @@ struct glsl_type { unsigned num_fields, const char *name); + /** + * Get the instance of an interface block type + */ + static const glsl_type *get_interface_instance(const glsl_struct_field *fields, + unsigned num_fields, + enum glsl_interface_packing packing, + const char *name); + /** * Query the total number of scalars that make up a scalar, vector or matrix */ @@ -393,6 +410,14 @@ struct glsl_type { return base_type == GLSL_TYPE_STRUCT; } + /** + * Query whether or not a type is an interface + */ + bool is_interface() const + { + return base_type == GLSL_TYPE_INTERFACE; + } + /** * Query whether or not a type is the void type singleton. */ @@ -491,6 +516,10 @@ private: glsl_type(const glsl_struct_field *fields, unsigned num_fields, const char *name); + /** Constructor for interface types */ + glsl_type(const glsl_struct_field *fields, unsigned num_fields, + enum glsl_interface_packing packing, const char *name); + /** Constructor for array types */ glsl_type(const glsl_type *array, unsigned length); @@ -500,6 +529,9 @@ private: /** Hash table containing the known record types. */ static struct hash_table *record_types; + /** Hash table containing the known interface types. */ + static struct hash_table *interface_types; + static int record_key_compare(const void *a, const void *b); static unsigned record_key_hash(const void *key); @@ -566,8 +598,15 @@ private: struct glsl_struct_field { const struct glsl_type *type; const char *name; + bool row_major; }; +static inline unsigned int +glsl_align(unsigned int a, unsigned int align) +{ + return (a + align - 1) / align * align; +} + #endif /* __cplusplus */ #endif /* GLSL_TYPES_H */ -- cgit v1.2.3