vulkan: Add a vk_image_view_subresource_range helper

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15535>
This commit is contained in:
Jason Ekstrand 2022-03-23 17:52:55 -05:00 committed by Marge Bot
parent 5b12a498f5
commit e500faebc2
1 changed files with 12 additions and 0 deletions

View File

@ -224,6 +224,18 @@ void vk_image_view_destroy(struct vk_device *device,
const VkAllocationCallbacks *alloc,
struct vk_image_view *image_view);
static inline VkImageSubresourceRange
vk_image_view_subresource_range(const struct vk_image_view *view)
{
return (VkImageSubresourceRange) {
.aspectMask = view->aspects,
.baseMipLevel = view->base_mip_level,
.levelCount = view->level_count,
.baseArrayLayer = view->base_array_layer,
.layerCount = view->layer_count,
};
}
bool vk_image_layout_is_read_only(VkImageLayout layout,
VkImageAspectFlagBits aspect);
bool vk_image_layout_is_depth_only(VkImageLayout layout);