Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.h:
+ * 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; Here too it is useful to know the precise rules for what `dimx` and `dimy` are set to depending on the `base_type`. Saying "See type initialization functions" kind of contradicts your intention of documenting data structures rather than code.
-- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/38#note_12048