From: Francisco Casas fcasas@codeweavers.com
--- libs/vkd3d-shader/hlsl.h | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 1ab6ae4c..56274742 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -266,9 +266,16 @@ struct hlsl_block struct list instrs; };
+/* A reference to an instruction node (struct hlsl_ir_node), usable as a field in other structs. + * struct hlsl_src is more powerful than a mere pointer to an hlsl_ir_node because it also contains + * a linked list item entry, which is used by the referenced instruction node to keep track of all + * the hlsl_srcĀ·s that reference it. + * This allows replacing any hlsl_ir_node with any other in all the places it is used, or checking + * that a node has no uses before it is removed. */ struct hlsl_src { struct hlsl_ir_node *node; + /* Item entry for node->uses. */ struct list entry; };