From: Francisco Casas fcasas@codeweavers.com
--- libs/vkd3d-shader/hlsl.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 0d1cdd93..d1c91167 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -300,13 +300,36 @@ struct hlsl_ir_var struct vkd3d_shader_location loc; const char *name; struct hlsl_semantic semantic; + /* Buffer where the variable's value is stored, in case it is uniform. */ struct hlsl_buffer *buffer; + /* Bitfield for storage, matrix majority, and type modifiers. */ unsigned int modifiers; + /* Optional register to be used as a starting point for the variable allocation. */ struct hlsl_reg_reservation reg_reservation; - struct list scope_entry, param_entry, extern_entry;
+ /* Item entry in hlsl_scope.vars. Specifically hlsl_ctx.globals.vars if the variable is global. */ + struct list scope_entry; + /* Item entry in hlsl_ir_function_decl.parameters, if the variable is a function parameter. */ + struct list param_entry; + /* Item entry in hlsl_ctx.extern_vars, if the variable is extern. */ + struct list 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. + * This in case the variable is uniform. */ unsigned int buffer_offset; + /* Register to which the variable is allocated during its lifetime. + * In case that the variable uses more than one register, this refers to the starting one. + * The register type is inferred from the data type and the storage of the variable. + * Uniforms and builtin semantics don't use the field. + * If the variable is an input semantic copy, the register is 'v'. + * If the variable is an output semantic copy, the register is 'o'. + * Textures are stored on 's' registers in SM1, and 't' registers in SM4. + * Samplers are stored on 's' registers. + * UAVs are stored on 'u' registers. */ struct hlsl_reg reg;
uint32_t is_input_semantic : 1;