Debian Codegraph @

src/kosmickrisp/vulkan/kk_image_view.h

raw symbols SCIP
1 /*
2 * Copyright © 2022 Collabora Ltd. and Red Hat Inc.
3 * Copyright 2025 LunarG, Inc.
4 * Copyright 2025 Google LLC
5 * SPDX-License-Identifier: MIT
6 */
7
8 #ifndef KK_IMAGE_VIEW_H
9 #define KK_IMAGE_VIEW_H 1
10
11 #include "kk_private.h"
12
13 #include "kosmickrisp/bridge/mtl_types.h"
14
15 #include "util/format/u_formats.h"
16
17 #include "vk_image.h"
18
19 struct kk_device;
20
21 struct kk_image_view {
22 struct vk_image_view vk;
23
24 uint8_t plane_count;
25 struct {
26 uint8_t image_plane;
27
28 enum pipe_format format;
29
30 mtl_texture *mtl_handle_sampled;
31 mtl_texture
32 *mtl_handle_storage; // TODO_KOSMICKRISP We can probably get rid of
33 // this once we lower 2D cubes and 3D to 2D array?
34
35 /* Cached handle so we don't have to retrieve it from the image when we
36 * render */
37 mtl_texture *mtl_handle_render;
38
39 /* Input attachment handle. Required since input attachments needs to be
40 * arrays, and sampled may not be */
41 mtl_texture *mtl_handle_input;
42
43 uint64_t sampled_gpu_resource_id;
44 uint64_t storage_gpu_resource_id;
45 uint64_t input_gpu_resource_id;
46 } planes[3];
47 };
48
49 VK_DEFINE_NONDISP_HANDLE_CASTS(kk_image_view, vk.base, VkImageView,
50 VK_OBJECT_TYPE_IMAGE_VIEW)
51
52 VkResult kk_image_view_init(struct kk_device *dev, struct kk_image_view *view,
53 const VkImageViewCreateInfo *pCreateInfo);
54
55 void kk_image_view_finish(struct kk_device *dev, struct kk_image_view *view);
56
57 #endif /* KK_IMAGE_VIEW_H */