From: Francisco Casas fcasas@codeweavers.com
--- libs/vkd3d-shader/hlsl.h | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 54a7c7d5..95ed5a79 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -532,49 +532,74 @@ struct hlsl_buffer
struct hlsl_ctx { + /* Information about the compilation's target profile. */ const struct hlsl_profile_info *profile;
+ /* Array of pointers to the names of the source files. */ const char **source_files; unsigned int source_files_count; + /* Current location being read, updated while parsing. */ struct vkd3d_shader_location location; + /* Stores the logging messages and logging configuration. */ struct vkd3d_shader_message_context *message_context; + /* Stores string buffers currently in use. */ struct vkd3d_string_buffer_cache string_buffers; + /* The result of the compilation (a value from vkd3d_result). 0 means success. */ int result;
+ /* Pointer to an opaque data structure managed by FLEX (during lexing), that encapsulates the + * current state of the scanner. This pointer is required by all FLEX API functions when the + * scanner is declared as reentrant, which is the case. */ void *scanner;
+ /* Pointer to the current scope; changes as the parser reads the code. */ struct hlsl_scope *cur_scope; + /* Scope of global variables. */ struct hlsl_scope *globals; + /* List that contains all the scopes in the program. */ struct list scopes; + /* List that contains the extern variables of the program. */ struct list extern_vars;
+ /* List that includes the built-in HLSL buffers (globals and parameters), as well as the ones + * declared in the shader. */ struct list buffers; + /* Current buffer (changes as the parser reads the code), $Globals buffer and $Params buffer. */ struct hlsl_buffer *cur_buffer, *globals_buffer, *params_buffer; + /* List containing all created hlsl_types, excluding builtin_types. */ struct list types; + /* Search tree of declared functions. The function's name is used as key. */ struct rb_tree functions; + /* Pointer to the current function; changes as the parser reads the code. */ const struct hlsl_ir_function_decl *cur_function;
+ /* Default matrix majority for matrix types. Can be set by a pragma within the HLSL code. */ enum hlsl_matrix_majority matrix_majority;
+ /* Basic data types stored for convenience. */ struct { struct hlsl_type *scalar[HLSL_TYPE_LAST_SCALAR + 1]; struct hlsl_type *vector[HLSL_TYPE_LAST_SCALAR + 1][4]; - /* matrix[float][2][4] is a float4x2, i.e. dimx = 2, dimy = 4 */ + /* matrix[float][1][3] is a float4x2, i.e. dimx = 2, dimy = 4 */ struct hlsl_type *matrix[HLSL_TYPE_LAST_SCALAR + 1][4][4]; struct hlsl_type *sampler[HLSL_SAMPLER_DIM_LAST_SAMPLER + 1]; struct hlsl_type *Void; } builtin_types;
+ /* List of instructions that initialize static variables. */ struct list static_initializers;
+ /* Dynamic array of constant values that appear in the shader. Only used for SM1 profiles. */ struct hlsl_constant_defs { struct hlsl_vec4 *values; size_t count, size; } constant_defs; + /* Number of temporary registers required by the shader. */ uint32_t temp_count;
+ /* Whether the parser is inside an state block (effects' metadata) inside a variable declarition. */ uint32_t in_state_block : 1; };