xref: /aosp_15_r20/external/mesa3d/src/nouveau/vulkan/nvk_image_view.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright © 2022 Collabora Ltd. and Red Hat Inc.
3  * SPDX-License-Identifier: MIT
4  */
5 #ifndef NVK_IMAGE_VIEW_H
6 #define NVK_IMAGE_VIEW_H 1
7 
8 #include "nvk_private.h"
9 
10 #include "vk_image.h"
11 
12 #include "nil.h"
13 
14 struct nvk_device;
15 
16 struct nvk_image_view {
17    struct vk_image_view vk;
18 
19    uint8_t plane_count;
20    struct {
21       uint8_t image_plane;
22 
23       enum nil_sample_layout sample_layout;
24 
25       /** Index in the image descriptor table for the sampled image descriptor */
26       uint32_t sampled_desc_index;
27 
28       /** Index in the image descriptor table for the storage image descriptor */
29       uint32_t storage_desc_index;
30    } planes[3];
31 };
32 
33 VK_DEFINE_NONDISP_HANDLE_CASTS(nvk_image_view, vk.base, VkImageView,
34                                VK_OBJECT_TYPE_IMAGE_VIEW)
35 
36 struct nvk_image_view_capture {
37    struct {
38       uint32_t sampled_desc_index;
39       uint32_t storage_desc_index;
40    } planes[3];
41 };
42 
43 VkResult nvk_image_view_init(struct nvk_device *dev,
44                              struct nvk_image_view *view,
45                              bool driver_internal,
46                              const VkImageViewCreateInfo *pCreateInfo);
47 
48 void nvk_image_view_finish(struct nvk_device *dev,
49                            struct nvk_image_view *view);
50 
51 #endif
52