Module: Mesa
Branch: main
Commit: e500faebc259a4db8ae689a09c0396cd1a9eeaa3
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e500faebc259a4db8ae689a09c0396cd1a9eeaa3

Author: Jason Ekstrand <[email protected]>
Date:   Wed Mar 23 17:52:55 2022 -0500

vulkan: Add a vk_image_view_subresource_range helper

Reviewed-By: Mike Blumenkrantz <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15535>

---

 src/vulkan/runtime/vk_image.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/vulkan/runtime/vk_image.h b/src/vulkan/runtime/vk_image.h
index fb58cbf1783..af141fc4eea 100644
--- a/src/vulkan/runtime/vk_image.h
+++ b/src/vulkan/runtime/vk_image.h
@@ -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);

Reply via email to