Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.h:
- /* Single instruction node of data type uint used to represent the register offset (in register - * components, within the pertaining regset), from the start of the variable, of the part - * referenced. - * The path is lowered to this single offset -- whose value may vary between SM1 and SM4 -- - * before writing the bytecode. + /* Before writing the bytecode, deref paths are lowered into an offset (within the pertaining + * regset) from the start of the variable, to the part of the variable that is referenced. + * This offset is stored using two fields, one for a variable part and other for a constant + * part, which are added together: + * - offset: An offset given by an instruction node, in number of register components. + * - offset_const: A constant number of register components. * Since the type information cannot longer be retrieved from the offset alone, the type is * stored in the data_type field. */ struct hlsl_src offset; + unsigned int offset_const;
Some bike shedding: `const_offset` sounds better to me, since I perceive `const` as an adjective. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/396#note_48330