Module: vkd3d Branch: master Commit: 76a689d43f8ea94d6aa79ccb0970e96389f38a92 URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/76a689d43f8ea94d6aa79ccb0970e9...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Tue Nov 14 01:56:23 2023 +0100
vkd3d-shader/hlsl: Allow annotations on passes.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
---
libs/vkd3d-shader/hlsl.y | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index a132b154..12c81d2d 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -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; }