From: Francisco Casas fcasas@codeweavers.com
--- libs/vkd3d-shader/hlsl.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 95ed5a79..a0d5ebe1 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -205,6 +205,8 @@ struct hlsl_reg bool allocated; };
+/* Type of IR instruction node. All instruction node types are associated to a struct with the same + * name (in lower case). */ enum hlsl_ir_node_type { HLSL_IR_CONSTANT, @@ -218,14 +220,24 @@ enum hlsl_ir_node_type HLSL_IR_SWIZZLE, };
+/* Contains the data common to all instruction node types. All of the structs associated to each + * instruction node type contain a struct hlsl_ir_node as its first member, so pointers to these + * structs can be casted seamlessly to (struct hlsl_ir_node *) and vice-versa. */ struct hlsl_ir_node { + /* Linked list entry, used for inserting this instruction node on any linked list of instruction + * nodes as required. */ struct list entry; + /* Type of node, which means that a pointer to this struct hlsl_ir_node can be casted to a + * pointer to the struct with the same name. */ enum hlsl_ir_node_type type; + /* HLSL data type of the node, when used as an expression. */ struct hlsl_type *data_type;
+ /* Linked list of all the struct hlsl_src-s that point to this node. */ struct list uses;
+ /* Location associated to this instruction within the HLSL shader. */ struct vkd3d_shader_location loc;
/* Liveness ranges. "index" is the index of this instruction. Since this is @@ -233,6 +245,7 @@ struct hlsl_ir_node * true even for loops, since currently we can't have a reference to a * value generated in an earlier iteration of the loop. */ unsigned int index, last_read; + /* Temp. register allocated to store the result of this instruction (if any). */ struct hlsl_reg reg; };