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.
enum hlsl_type_class type; enum hlsl_base_type base_type;* base_type is not used when type is HLSL_CLASS_STRUCT or HLSL_CLASS_ARRAY. */
- /* Sampling dimension of the hlsl_type, in case it is a resource type, e.g. a texture or
enum hlsl_sampler_dim sampler_dim;* sampler. */
- /* 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.
unsigned int dimx; unsigned int dimy;* See type initialization functions. */
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.