diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index a862429b..f4186967 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -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); } diff --git a/tests/hlsl/state-block-syntax.shader_test b/tests/hlsl/state-block-syntax.shader_test index 5764bedd..1fb0277c 100644 --- a/tests/hlsl/state-block-syntax.shader_test +++ b/tests/hlsl/state-block-syntax.shader_test @@ -653,7 +653,7 @@ DepthStencilState dss1 RandomField = vec.w; }; -[pixel shader todo] +[pixel shader] sampler sams { Filter = ;