vkd3d-shader/hlsl: Fix an incorrect error message for referring to non-struct types with "struct".

We cannot be redefining struct types in this rule, only referring to already
defined types. Struct type definition is handled by named_struct_spec, which
complains if the type was defined at all, regardless of class.
This commit is contained in:
Elizabeth Figura
2025-04-14 15:55:14 -05:00
committed by Henri Verbeet
parent bfa655a01f
commit 5ad2e7ee6d
Notes: Henri Verbeet 2025-05-14 15:29:22 +02:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1500

View File

@@ -8220,7 +8220,7 @@ type_no_void:
{ {
$$ = hlsl_get_type(ctx->cur_scope, $2, true, true); $$ = hlsl_get_type(ctx->cur_scope, $2, true, true);
if ($$->class != HLSL_CLASS_STRUCT) if ($$->class != HLSL_CLASS_STRUCT)
hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_REDEFINED, "\"%s\" redefined as a structure.", $2); hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_REDEFINED, "\"%s\" is not a structure.", $2);
vkd3d_free($2); vkd3d_free($2);
} }
| KW_RENDERTARGETVIEW | KW_RENDERTARGETVIEW