vkd3d-shader: Parse angle bracket initializer in state blocks.

While fxc allows full expressions inside the angle brackets, we don't parse that
yet as it'd be quite a mess to properly do so with yacc, and I'm not aware of any
game doing so in their shaders.
This commit is contained in:
Anna (navi) Figueiredo Gomes
2025-02-27 16:04:30 +01:00
committed by Henri Verbeet
parent 9809bda0e5
commit 50254c284b
Notes: Henri Verbeet 2025-03-03 18:05:50 +01:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1398
2 changed files with 21 additions and 1 deletions

View File

@@ -8639,6 +8639,26 @@ state_block:
hlsl_src_from_node(&entry->args[i], $5.args[i]);
vkd3d_free($5.args);
$$ = $1;
hlsl_state_block_add_entry($$, entry);
}
| state_block stateblock_lhs_identifier state_block_index_opt '=' '<' primary_expr '>' ';'
{
struct hlsl_state_block_entry *entry;
if (!(entry = hlsl_alloc(ctx, sizeof(*entry))))
YYABORT;
entry->name = $2;
entry->lhs_has_index = $3.has_index;
entry->lhs_index = $3.index;
entry->instrs = $6;
entry->args_count = 1;
if (!(entry->args = hlsl_alloc(ctx, sizeof(*entry->args) * entry->args_count)))
YYABORT;
hlsl_src_from_node(&entry->args[0], node_from_block($6));
$$ = $1;
hlsl_state_block_add_entry($$, entry);
}

View File

@@ -653,7 +653,7 @@ DepthStencilState dss1
RandomField = vec.w;
};
[pixel shader todo]
[pixel shader]
sampler sams
{
Filter = <ANISOTROPIC>;