Zebediah Figura : vkd3d-shader: Forbid declaring variables as both "uniform" and "static".
Alexandre Julliard
julliard at winehq.org
Fri May 14 15:34:16 CDT 2021
Module: vkd3d
Branch: master
Commit: 07fb4ea1aee6a57941a901f80fd2722427297f11
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=07fb4ea1aee6a57941a901f80fd2722427297f11
Author: Zebediah Figura <zfigura at codeweavers.com>
Date: Mon May 10 23:36:05 2021 -0500
vkd3d-shader: Forbid declaring variables as both "uniform" and "static".
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
libs/vkd3d-shader/hlsl.y | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y
index 9eef5e2..2c9fe55 100644
--- a/libs/vkd3d-shader/hlsl.y
+++ b/libs/vkd3d-shader/hlsl.y
@@ -1423,6 +1423,10 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t
{
local = false;
+ if ((modifiers & HLSL_STORAGE_UNIFORM) && (modifiers & HLSL_STORAGE_STATIC))
+ hlsl_error(ctx, var->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_MODIFIER,
+ "Variable '%s' is declared as both \"uniform\" and \"static\".", var->name);
+
if ((func = hlsl_get_func_decl(ctx, var->name)))
{
hlsl_error(ctx, var->loc, VKD3D_SHADER_ERROR_HLSL_REDEFINED,
More information about the wine-cvs
mailing list