vkd3d-shader/hlsl: Add a hlsl_fixme() for 5.1 resource arrays.

These are a bit trickier to handle, and need more tests.
This commit is contained in:
Elizabeth Figura 2024-05-13 23:55:38 -05:00 committed by Henri Verbeet
parent 9b070edf01
commit 558320b52f
Notes: Henri Verbeet 2024-06-11 17:09:29 +02:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/865

View File

@ -1013,6 +1013,10 @@ static bool gen_struct_fields(struct hlsl_ctx *ctx, struct parse_fields *fields,
field->type = hlsl_new_array_type(ctx, field->type, v->arrays.sizes[k]);
}
}
if (hlsl_version_ge(ctx, 5, 1) && field->type->class == HLSL_CLASS_ARRAY && hlsl_type_is_resource(field->type))
hlsl_fixme(ctx, &v->loc, "Shader model 5.1+ resource array.");
vkd3d_free(v->arrays.sizes);
field->loc = v->loc;
field->name = v->name;
@ -2319,6 +2323,15 @@ static void declare_var(struct hlsl_ctx *ctx, struct parse_variable_def *v)
}
}
if (hlsl_version_ge(ctx, 5, 1) && type->class == HLSL_CLASS_ARRAY && hlsl_type_is_resource(type))
{
/* SM 5.1/6.x descriptor arrays act differently from previous versions.
* Not only are they treated as a single object in reflection, but they
* act as a single component for the purposes of assignment and
* initialization. */
hlsl_fixme(ctx, &v->loc, "Shader model 5.1+ resource array.");
}
if (!(var_name = vkd3d_strdup(v->name)))
return;
@ -6545,6 +6558,9 @@ parameter:
}
$$.type = type;
if (hlsl_version_ge(ctx, 5, 1) && type->class == HLSL_CLASS_ARRAY && hlsl_type_is_resource(type))
hlsl_fixme(ctx, &@2, "Shader model 5.1+ resource array.");
$$.name = $3;
$$.semantic = $5.semantic;
$$.reg_reservation = $5.reg_reservation;