vkd3d-shader/dxil: Move the resource kind helper functions up.

This commit is contained in:
Conor McCarthy 2024-02-12 16:17:08 +10:00 committed by Alexandre Julliard
parent d65f331efc
commit 292bbdefbf
Notes: Alexandre Julliard 2024-02-26 23:10:23 +01: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/629

View File

@ -1937,6 +1937,16 @@ static const struct sm6_type *sm6_parser_get_type(struct sm6_parser *sm6, uint64
return &sm6->types[type_id]; return &sm6->types[type_id];
} }
static bool resource_kind_is_texture(enum dxil_resource_kind kind)
{
return kind >= RESOURCE_KIND_TEXTURE1D && kind <= RESOURCE_KIND_TEXTURECUBEARRAY;
}
static bool resource_kind_is_multisampled(enum dxil_resource_kind kind)
{
return kind == RESOURCE_KIND_TEXTURE2DMS || kind == RESOURCE_KIND_TEXTURE2DMSARRAY;
}
static int global_symbol_compare(const void *a, const void *b) static int global_symbol_compare(const void *a, const void *b)
{ {
return vkd3d_u32_compare(((const struct sm6_symbol *)a)->id, ((const struct sm6_symbol *)b)->id); return vkd3d_u32_compare(((const struct sm6_symbol *)a)->id, ((const struct sm6_symbol *)b)->id);
@ -6778,16 +6788,6 @@ static bool sm6_parser_resources_load_register_range(struct sm6_parser *sm6,
return true; return true;
} }
static bool resource_kind_is_texture(enum dxil_resource_kind kind)
{
return kind >= RESOURCE_KIND_TEXTURE1D && kind <= RESOURCE_KIND_TEXTURECUBEARRAY;
}
static bool resource_kind_is_multisampled(enum dxil_resource_kind kind)
{
return kind == RESOURCE_KIND_TEXTURE2DMS || kind == RESOURCE_KIND_TEXTURE2DMSARRAY;
}
static enum vkd3d_shader_resource_type shader_resource_type_from_dxil_resource_kind(enum dxil_resource_kind kind) static enum vkd3d_shader_resource_type shader_resource_type_from_dxil_resource_kind(enum dxil_resource_kind kind)
{ {
if (resource_kind_is_texture(kind)) if (resource_kind_is_texture(kind))