mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-19 21:28:50 +00:00
aux/vk: Add vk_get_access_flags.
This commit is contained in:
parent
06ce79272d
commit
c09beb9efb
|
@ -1055,3 +1055,29 @@ err_memset:
|
|||
U_ZERO(vk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
VkAccessFlags
|
||||
vk_get_access_flags(VkImageLayout layout)
|
||||
{
|
||||
switch (layout) {
|
||||
case VK_IMAGE_LAYOUT_UNDEFINED: return 0;
|
||||
case VK_IMAGE_LAYOUT_GENERAL:
|
||||
return VK_ACCESS_TRANSFER_WRITE_BIT |
|
||||
VK_ACCESS_TRANSFER_READ_BIT;
|
||||
case VK_IMAGE_LAYOUT_PREINITIALIZED: return VK_ACCESS_HOST_WRITE_BIT;
|
||||
case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL:
|
||||
return VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
|
||||
case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL:
|
||||
return VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;
|
||||
case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL:
|
||||
return VK_ACCESS_TRANSFER_READ_BIT;
|
||||
case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL:
|
||||
return VK_ACCESS_TRANSFER_WRITE_BIT;
|
||||
case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL:
|
||||
return VK_ACCESS_SHADER_READ_BIT;
|
||||
default:
|
||||
fprintf(stderr, "Unhandled access mask case for layout %d.\n",
|
||||
layout);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -399,6 +399,9 @@ VkResult
|
|||
vk_submit_cmd_buffer(struct vk_bundle *vk, VkCommandBuffer cmd_buffer);
|
||||
|
||||
|
||||
VkAccessFlags
|
||||
vk_get_access_flags(VkImageLayout layout);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue