diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 95be7e08..a0269239 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -2518,8 +2518,11 @@ static void declare_var(struct hlsl_ctx *ctx, struct parse_variable_def *v) if (!(modifiers & HLSL_STORAGE_STATIC)) var->storage_modifiers |= HLSL_STORAGE_UNIFORM; - if (ctx->profile->major_version < 5 && (var->storage_modifiers & HLSL_STORAGE_UNIFORM)) + if ((ctx->profile->major_version < 5 || ctx->profile->type == VKD3D_SHADER_TYPE_EFFECT) + && (var->storage_modifiers & HLSL_STORAGE_UNIFORM)) + { check_invalid_object_fields(ctx, var); + } if ((func = hlsl_get_first_func_decl(ctx, var->name))) { diff --git a/tests/hlsl/effect-variables-fx_5.shader_test b/tests/hlsl/effect-variables-fx_5.shader_test index 13773b06..0860638e 100644 --- a/tests/hlsl/effect-variables-fx_5.shader_test +++ b/tests/hlsl/effect-variables-fx_5.shader_test @@ -9,7 +9,7 @@ struct s float4 f; }; -[effect fail todo] +[effect fail] struct s { Texture t;