Debian Codegraph @

src/imagination/vulkan/pvr_pass.h

raw
1 /*
2 * Copyright © 2022 Imagination Technologies Ltd.
3 *
4 * based in part on anv driver which is:
5 * Copyright © 2015 Intel Corporation
6 *
7 * based in part on radv driver which is:
8 * Copyright © 2016 Red Hat.
9 * Copyright © 2016 Bas Nieuwenhuizen
10 *
11 * SPDX-License-Identifier: MIT
12 */
13
14 #ifndef PVR_PASS_H
15 #define PVR_PASS_H
16
17 #include "vk_object.h"
18
19 #include "pvr_common.h"
20
21 struct pvr_device;
22
23 struct pvr_render_pass_attachment {
24 /* Saved information from pCreateInfo. */
25 VkAttachmentLoadOp load_op;
26
27 VkAttachmentStoreOp store_op;
28
29 VkResolveModeFlagBits resolve_mode;
30
31 VkAttachmentLoadOp stencil_load_op;
32
33 VkAttachmentStoreOp stencil_store_op;
34
35 VkResolveModeFlagBits stencil_resolve_mode;
36
37 VkFormat vk_format;
38 uint32_t sample_count;
39 VkImageLayout initial_layout;
40
41 /* Derived and other state. */
42 VkImageAspectFlags aspects;
43
44 /* Can this surface be resolved by the PBE. */
45 bool is_pbe_downscalable;
46 bool is_depth;
47 bool is_stencil;
48 bool need_eot;
49
50 uint32_t resolve_target;
51 uint32_t index;
52 };
53
54 struct pvr_render_attachment {
55 uint32_t attachment_idx;
56 VkImageAspectFlags aspect_mask;
57 };
58
59 struct pvr_render_subpass {
60 /* Saved information from pCreateInfo. */
61 /* The number of samples per color attachment (or depth attachment if
62 * z-only).
63 */
64 /* FIXME: rename to 'samples' to match struct pvr_image */
65 uint32_t sample_count;
66
67 uint32_t color_count;
68 uint32_t *color_attachments;
69 uint32_t *resolve_attachments;
70
71 uint32_t input_count;
72 struct pvr_render_attachment *input_attachments;
73
74 uint32_t preserve_count;
75 struct pvr_render_attachment *preserve_attachments;
76
77 uint32_t depth_stencil_attachment;
78
79 uint32_t depth_stencil_resolve_attachment;
80 VkResolveModeFlagBits depth_resolve_mode;
81 VkResolveModeFlagBits stencil_resolve_mode;
82
83 /* Derived and other state. */
84 uint32_t dep_count;
85 uint32_t *dep_list;
86
87 /* Array with dep_count elements. flush_on_dep[x] is true if this subpass
88 * and the subpass dep_list[x] can't be in the same hardware render.
89 */
90 bool *flush_on_dep;
91
92 uint32_t index;
93
94 uint32_t isp_userpass;
95
96 VkPipelineBindPoint pipeline_bind_point;
97
98 /* View mask for multiview. */
99 uint32_t view_mask;
100 };
101
102 struct pvr_render_pass {
103 struct vk_object_base base;
104
105 /* Saved information from pCreateInfo. */
106 uint32_t attachment_count;
107
108 struct pvr_render_pass_attachment *attachments;
109
110 uint32_t subpass_count;
111
112 struct pvr_render_subpass *subpasses;
113
114 struct pvr_renderpass_hwsetup *hw_setup;
115
116 /* Derived and other state. */
117 /* FIXME: rename to 'max_samples' as we use 'samples' elsewhere */
118 uint32_t max_sample_count;
119
120 /* The maximum number of tile buffers to use in any subpass. */
121 uint32_t max_tilebuffer_count;
122
123 /* VkSubpassDescription2::viewMask or 1 when non-multiview
124 *
125 * To determine whether multiview is enabled, check
126 * pvr_render_pass::multiview_enabled.
127 */
128 bool multiview_enabled;
129 };
130
131 VK_DEFINE_NONDISP_HANDLE_CASTS(pvr_render_pass,
132 base,
133 VkRenderPass,
134 VK_OBJECT_TYPE_RENDER_PASS)
135
136 #endif /* PVR_PASS */