vkd3d-shader/hlsl: Use hlsl_type_is_resource() for unbounded array checks.

Not all objects can be unbounded descriptors.
This commit is contained in:
Zebediah Figura 2024-01-26 16:36:41 -06:00 committed by Alexandre Julliard
parent 083a58767a
commit ce50c3a186
Notes: Alexandre Julliard 2024-04-09 15:45:34 -05:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/757
2 changed files with 3 additions and 3 deletions

View File

@ -956,7 +956,7 @@ static bool gen_struct_fields(struct hlsl_ctx *ctx, struct parse_fields *fields,
field->type = type;
if (hlsl_version_ge(ctx, 5, 1) && type->class == HLSL_CLASS_OBJECT)
if (hlsl_version_ge(ctx, 5, 1) && hlsl_type_is_resource(type))
{
for (k = 0; k < v->arrays.count; ++k)
unbounded_res_array |= (v->arrays.sizes[k] == HLSL_ARRAY_ELEMENTS_COUNT_IMPLICIT);
@ -2162,7 +2162,7 @@ static void declare_var(struct hlsl_ctx *ctx, struct parse_variable_def *v)
type = basic_type;
if (hlsl_version_ge(ctx, 5, 1) && type->class == HLSL_CLASS_OBJECT)
if (hlsl_version_ge(ctx, 5, 1) && hlsl_type_is_resource(type))
{
for (i = 0; i < v->arrays.count; ++i)
unbounded_res_array |= (v->arrays.sizes[i] == HLSL_ARRAY_ELEMENTS_COUNT_IMPLICIT);

View File

@ -18,6 +18,6 @@ float4 main() : sv_target {return 0;}
float f[];
float4 main() : sv_target {return 0;}
[pixel shader fail todo]
[pixel shader fail]
STRING s[];
float4 main() : sv_target {return 0;}