mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Allow annotations on passes.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
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
@@ -1096,7 +1096,8 @@ static bool add_func_parameter(struct hlsl_ctx *ctx, struct hlsl_func_parameters
|
|||||||
return true;
|
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_ir_var *var;
|
||||||
struct hlsl_type *type;
|
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);
|
type = hlsl_get_type(ctx->globals, "pass", false, false);
|
||||||
if (!(var = hlsl_new_var(ctx, name, type, loc, NULL, 0, NULL)))
|
if (!(var = hlsl_new_var(ctx, name, type, loc, NULL, 0, NULL)))
|
||||||
return false;
|
return false;
|
||||||
|
var->annotations = annotations;
|
||||||
|
|
||||||
if (!hlsl_add_var(ctx, var, false))
|
if (!hlsl_add_var(ctx, var, false))
|
||||||
{
|
{
|
||||||
@@ -5267,9 +5269,9 @@ name_opt:
|
|||||||
| any_identifier
|
| any_identifier
|
||||||
|
|
||||||
pass:
|
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;
|
YYABORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user