From: Francisco Casas fcasas@codeweavers.com
--- libs/vkd3d-shader/hlsl.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index f237d6c4..58ad01a5 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -114,33 +114,60 @@ enum hlsl_matrix_majority HLSL_ROW_MAJOR };
+/* An HLSL data type. */ struct hlsl_type { + /* Linked list entry to store this hlsl_type in the context's linked list of hlsl_types. */ struct list entry; + /* Search tree entry to store this hlsl_type in the context's search tree of types. The type's + * name is used as key. */ struct rb_entry scope_entry; + /* These fields indicate to which category of hlsl_types this hlsl_type belongs. + * If type is HLSL_CLASS_OBJECT, base_type is used to indicate a subcategory of the type. + * If type is numeric, base_type is used to indicate the type of its components. + * base_type is not used when type is HLSL_CLASS_STRUCT or HLSL_CLASS_ARRAY. */ enum hlsl_type_class type; enum hlsl_base_type base_type; + /* Sampling dimension of the hlsl_type, in case it is a resource type, e.g. a texture or + * sampler. */ enum hlsl_sampler_dim sampler_dim; + /* String buffer with the name of the hlsl_type. */ const char *name; + /* Bitfield for storing type modifiers, subset of HLSL_TYPE_MODIFIERS_MASK */ unsigned int modifiers; + /* Size of the type values on each dimension; primarily intended for numeric types: scalars, + * vectors, and matrices.Other types may assign values to them for convenience. + * See type initialization functions. */ unsigned int dimx; unsigned int dimy; + union { + /* Additional information if the type is HLSL_CLASS_STRUCT. */ struct { + /* Fields contained within the struct. */ struct hlsl_struct_field *fields; + /* Number of fields contained in the struct. */ size_t field_count; } record; + /* Additional information if the type is HLSL_CLASS_ARRAY. */ struct { + /* Type of the array elements. */ struct hlsl_type *type; + /* Number of elements contained within the array or HLSL_ARRAY_ELEMENTS_COUNT_IMPLICIT + * if it is unknown yet. */ unsigned int elements_count; } array; + /* Format of the data contained within the type if it is a resource type, e.g. a texture. */ struct hlsl_type *resource_format; } e;
+ /* Number of numeric register components used by one value of this type (4 components make 1 + * register). */ unsigned int reg_size; + /* Offset where the type's description starts in the output bytecode. */ size_t bytecode_offset; };