vulkan: Add vk_index_type_to_bytes helper
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24017>
This commit is contained in:
@@ -366,6 +366,18 @@ vk_spec_info_to_nir_spirv(const VkSpecializationInfo *spec_info,
|
||||
#define STACK_ARRAY_FINISH(name) \
|
||||
if (name != _stack_##name) free(name)
|
||||
|
||||
static inline uint8_t
|
||||
vk_index_type_to_bytes(enum VkIndexType type)
|
||||
{
|
||||
switch (type) {
|
||||
case VK_INDEX_TYPE_NONE_KHR: return 0;
|
||||
case VK_INDEX_TYPE_UINT8_EXT: return 1;
|
||||
case VK_INDEX_TYPE_UINT16: return 2;
|
||||
case VK_INDEX_TYPE_UINT32: return 4;
|
||||
default: unreachable("Invalid index type");
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user