Zebediah Figura (@zfigura) commented about libs/vkd3d-shader/hlsl.h:
HLSL_IR_SWIZZLE,
};
+/* Common data for every type of IR instruction node. */ struct hlsl_ir_node {
- /* Item entry for storing the instruction in a list of instructions. Usually hlsl_block.instrs,
struct list entry;* but also hlsl_ctx.static_initializers. */
- /* Type of node, which means that a pointer to this struct hlsl_ir_node can be casted to a
enum hlsl_ir_node_type type;* pointer to the struct with the same name. */
- /* HLSL data type of the node, when used as an expression. */ struct hlsl_type *data_type;
"When used as an expression" is a bit odd wording given that what actually matters is the node type. I.e. CONSTANT, EXPR, LOAD, RESOURCE_LOAD, SWIZZLE have a data type and can be used in hlsl_src; everything else doesn't.
[This seems salient to me because this wasn't always true. Once upon a time HLSL_IR_STORE was called HLSL_IR_ASSIGNMENT and it could return a value, basically representing statements like "a = (b = c);". Now we just copy the rhs.]