vkd3d-shader/hlsl: Allow annotations on passes.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2023-11-14 01:56:23 +01:00 committed by Alexandre Julliard
parent e72f8f9a30
commit 76a689d43f
Notes: Alexandre Julliard 2024-01-23 23:03:22 +01:00
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/565

View File

@ -1096,7 +1096,8 @@ static bool add_func_parameter(struct hlsl_ctx *ctx, struct hlsl_func_parameters
return true;
}
static bool add_pass(struct hlsl_ctx *ctx, const char *name, const struct vkd3d_shader_location *loc)
static bool add_pass(struct hlsl_ctx *ctx, const char *name, struct hlsl_scope *annotations,
const struct vkd3d_shader_location *loc)
{
struct hlsl_ir_var *var;
struct hlsl_type *type;
@ -1104,6 +1105,7 @@ static bool add_pass(struct hlsl_ctx *ctx, const char *name, const struct vkd3d_
type = hlsl_get_type(ctx->globals, "pass", false, false);
if (!(var = hlsl_new_var(ctx, name, type, loc, NULL, 0, NULL)))
return false;
var->annotations = annotations;
if (!hlsl_add_var(ctx, var, false))
{
@ -5267,9 +5269,9 @@ name_opt:
| any_identifier
pass:
KW_PASS name_opt '{' '}'
KW_PASS name_opt annotations_opt '{' '}'
{
if (!add_pass(ctx, $2, &@1))
if (!add_pass(ctx, $2, $3, &@1))
YYABORT;
}