mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
vulkan: add vk_index_type_to_restart helper
from nvk Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27764>
This commit is contained in:
parent
4d00edda00
commit
a97966b840
2 changed files with 11 additions and 15 deletions
|
|
@ -2076,21 +2076,6 @@ vk_to_nv_index_format(VkIndexType type)
|
|||
}
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
vk_index_to_restart(VkIndexType index_type)
|
||||
{
|
||||
switch (index_type) {
|
||||
case VK_INDEX_TYPE_UINT16:
|
||||
return 0xffff;
|
||||
case VK_INDEX_TYPE_UINT32:
|
||||
return 0xffffffff;
|
||||
case VK_INDEX_TYPE_UINT8_KHR:
|
||||
return 0xff;
|
||||
default:
|
||||
unreachable("unexpected index type");
|
||||
}
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL
|
||||
nvk_CmdBindIndexBuffer2KHR(VkCommandBuffer commandBuffer,
|
||||
VkBuffer _buffer,
|
||||
|
|
|
|||
|
|
@ -384,6 +384,17 @@ vk_index_type_to_bytes(enum VkIndexType type)
|
|||
}
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
vk_index_to_restart(enum VkIndexType type)
|
||||
{
|
||||
switch (type) {
|
||||
case VK_INDEX_TYPE_UINT8_KHR: return 0xff;
|
||||
case VK_INDEX_TYPE_UINT16: return 0xffff;
|
||||
case VK_INDEX_TYPE_UINT32: return 0xffffffff;
|
||||
default: unreachable("unexpected index type");
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue