vkd3d-shader/hlsl: Parse function call syntax on state blocks.

This commit is contained in:
Francisco Casas
2024-03-19 16:06:12 -03:00
committed by Henri Verbeet
parent f15d8dc9e9
commit b5f2e7daeb
Notes: Henri Verbeet 2024-07-09 21:10:32 +02:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/915
4 changed files with 47 additions and 9 deletions

View File

@@ -507,22 +507,31 @@ struct hlsl_ir_var
* name[lhs_index] = args[0]
* - or -
* name[lhs_index] = {args[0], args[1], ...};
*
* This struct also represents function call syntax:
* name(args[0], args[1], ...)
*/
struct hlsl_state_block_entry
{
/* For assignments, the name in the lhs. */
/* Whether this entry is a function call. */
bool is_function_call;
/* For assignments, the name in the lhs.
* For functions, the name of the function. */
char *name;
/* Resolved format-specific property identifier. */
unsigned int name_id;
/* Whether the lhs in the assignment is indexed and, in that case, its index. */
/* For assignments, whether the lhs of an assignment is indexed and, in
* that case, its index. */
bool lhs_has_index;
unsigned int lhs_index;
/* Instructions present in the rhs. */
/* Instructions present in the rhs or the function arguments. */
struct hlsl_block *instrs;
/* For assignments, arguments of the rhs initializer. */
/* For assignments, arguments of the rhs initializer.
* For function calls, the arguments themselves. */
struct hlsl_src *args;
unsigned int args_count;
};