From: Francisco Casas fcasas@codeweavers.com
--- libs/vkd3d-shader/hlsl.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index d17163e0..54a7c7d5 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -275,19 +275,40 @@ struct hlsl_reg_reservation unsigned int index; };
+/* Variable declared within the HLSL shader. */ struct hlsl_ir_var { + /* Data type of the variable. */ struct hlsl_type *data_type; + /* Location of the variable declaration in the HLSL shader. */ struct vkd3d_shader_location loc; + /* Name of the variable. */ const char *name; + /* Semantic linked to the variable, if any. */ struct hlsl_semantic semantic; + /* Reference to the buffer where the variable's value is stored, in case it is uniform. */ struct hlsl_buffer *buffer; + /* Bitfield for storing variable modifiers */ unsigned int modifiers; + /* Optional register assignment where the variable has to be allocated. */ struct hlsl_reg_reservation reg_reservation; + /* Nodes for storing this variable in: + * - The scope's variable list (may be hlsl_ctx's global scope). + * - An hlsl_ir_function_decl's parameters list. + * - The hlsl_ctx's externs list. + * respectively, when it applies. */ struct list scope_entry, param_entry, extern_entry;
+ /* Indexes of the IR instructions where the variable is first written and last read (liveness + * range). The IR instructions are numerated starting from 2, because 0 means unused, and 1 + * means function entry. */ unsigned int first_write, last_read; + /* Offset where the variable's value is stored within its buffer, in numeric register + * components. */ unsigned int buffer_offset; + /* Register to which variable is allocated during its lifetime. + * In case that the variable uses more than one (continuous) register, this refers to the first + * one. */ struct hlsl_reg reg;
uint32_t is_input_semantic : 1;