1bf215546Sopenharmony_ci/*
2bf215546Sopenharmony_ci * Copyright © 2021 Raspberry Pi Ltd
3bf215546Sopenharmony_ci *
4bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
5bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
6bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation
7bf215546Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8bf215546Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
9bf215546Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
10bf215546Sopenharmony_ci *
11bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the next
12bf215546Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the
13bf215546Sopenharmony_ci * Software.
14bf215546Sopenharmony_ci *
15bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16bf215546Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18bf215546Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19bf215546Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20bf215546Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21bf215546Sopenharmony_ci * IN THE SOFTWARE.
22bf215546Sopenharmony_ci */
23bf215546Sopenharmony_ci
24bf215546Sopenharmony_ci/* This file generates the per-v3d-version function prototypes.  It must only
25bf215546Sopenharmony_ci * be included from v3dv_private.h.
26bf215546Sopenharmony_ci */
27bf215546Sopenharmony_ci
28bf215546Sopenharmony_ci#ifndef V3DV_PRIVATE_H
29bf215546Sopenharmony_ci#error This file is included by means other than v3dv_private.h
30bf215546Sopenharmony_ci#endif
31bf215546Sopenharmony_ci
32bf215546Sopenharmony_ci/* Used at v3dv_cmd_buffer */
33bf215546Sopenharmony_civoid
34bf215546Sopenharmony_civ3dX(job_emit_binning_flush)(struct v3dv_job *job);
35bf215546Sopenharmony_ci
36bf215546Sopenharmony_civoid
37bf215546Sopenharmony_civ3dX(cmd_buffer_emit_color_write_mask)(struct v3dv_cmd_buffer *cmd_buffer);
38bf215546Sopenharmony_ci
39bf215546Sopenharmony_civoid
40bf215546Sopenharmony_civ3dX(cmd_buffer_end_render_pass_secondary)(struct v3dv_cmd_buffer *cmd_buffer);
41bf215546Sopenharmony_ci
42bf215546Sopenharmony_civoid
43bf215546Sopenharmony_civ3dX(job_emit_clip_window)(struct v3dv_job *job, const VkRect2D *rect);
44bf215546Sopenharmony_ci
45bf215546Sopenharmony_civoid
46bf215546Sopenharmony_civ3dX(cmd_buffer_emit_render_pass_rcl)(struct v3dv_cmd_buffer *cmd_buffer);
47bf215546Sopenharmony_ci
48bf215546Sopenharmony_civoid
49bf215546Sopenharmony_civ3dX(cmd_buffer_emit_viewport)(struct v3dv_cmd_buffer *cmd_buffer);
50bf215546Sopenharmony_ci
51bf215546Sopenharmony_civoid
52bf215546Sopenharmony_civ3dX(cmd_buffer_emit_stencil)(struct v3dv_cmd_buffer *cmd_buffer);
53bf215546Sopenharmony_ci
54bf215546Sopenharmony_civoid
55bf215546Sopenharmony_civ3dX(cmd_buffer_emit_depth_bias)(struct v3dv_cmd_buffer *cmd_buffer);
56bf215546Sopenharmony_ci
57bf215546Sopenharmony_civoid
58bf215546Sopenharmony_civ3dX(cmd_buffer_emit_line_width)(struct v3dv_cmd_buffer *cmd_buffer);
59bf215546Sopenharmony_ci
60bf215546Sopenharmony_civoid
61bf215546Sopenharmony_civ3dX(cmd_buffer_emit_sample_state)(struct v3dv_cmd_buffer *cmd_buffer);
62bf215546Sopenharmony_ci
63bf215546Sopenharmony_civoid
64bf215546Sopenharmony_civ3dX(cmd_buffer_emit_blend)(struct v3dv_cmd_buffer *cmd_buffer);
65bf215546Sopenharmony_ci
66bf215546Sopenharmony_civoid
67bf215546Sopenharmony_civ3dX(cmd_buffer_emit_varyings_state)(struct v3dv_cmd_buffer *cmd_buffer);
68bf215546Sopenharmony_ci
69bf215546Sopenharmony_civoid
70bf215546Sopenharmony_civ3dX(cmd_buffer_emit_configuration_bits)(struct v3dv_cmd_buffer *cmd_buffer);
71bf215546Sopenharmony_ci
72bf215546Sopenharmony_civoid
73bf215546Sopenharmony_civ3dX(job_emit_binning_prolog)(struct v3dv_job *job,
74bf215546Sopenharmony_ci                              const struct v3dv_frame_tiling *tiling,
75bf215546Sopenharmony_ci                              uint32_t layers);
76bf215546Sopenharmony_ci
77bf215546Sopenharmony_civoid
78bf215546Sopenharmony_civ3dX(cmd_buffer_execute_inside_pass)(struct v3dv_cmd_buffer *primary,
79bf215546Sopenharmony_ci                                     uint32_t cmd_buffer_count,
80bf215546Sopenharmony_ci                                     const VkCommandBuffer *cmd_buffers);
81bf215546Sopenharmony_ci
82bf215546Sopenharmony_civoid
83bf215546Sopenharmony_civ3dX(cmd_buffer_emit_occlusion_query)(struct v3dv_cmd_buffer *cmd_buffer);
84bf215546Sopenharmony_ci
85bf215546Sopenharmony_civoid
86bf215546Sopenharmony_civ3dX(cmd_buffer_emit_gl_shader_state)(struct v3dv_cmd_buffer *cmd_buffer);
87bf215546Sopenharmony_ci
88bf215546Sopenharmony_ci
89bf215546Sopenharmony_civoid
90bf215546Sopenharmony_civ3dX(cmd_buffer_emit_draw)(struct v3dv_cmd_buffer *cmd_buffer,
91bf215546Sopenharmony_ci                           struct v3dv_draw_info *info);
92bf215546Sopenharmony_ci
93bf215546Sopenharmony_ci
94bf215546Sopenharmony_civoid
95bf215546Sopenharmony_civ3dX(cmd_buffer_emit_index_buffer)(struct v3dv_cmd_buffer *cmd_buffer);
96bf215546Sopenharmony_ci
97bf215546Sopenharmony_civoid
98bf215546Sopenharmony_civ3dX(cmd_buffer_emit_draw_indexed)(struct v3dv_cmd_buffer *cmd_buffer,
99bf215546Sopenharmony_ci                                   uint32_t indexCount,
100bf215546Sopenharmony_ci                                   uint32_t instanceCount,
101bf215546Sopenharmony_ci                                   uint32_t firstIndex,
102bf215546Sopenharmony_ci                                   int32_t vertexOffset,
103bf215546Sopenharmony_ci                                   uint32_t firstInstance);
104bf215546Sopenharmony_ci
105bf215546Sopenharmony_civoid
106bf215546Sopenharmony_civ3dX(cmd_buffer_emit_draw_indirect)(struct v3dv_cmd_buffer *cmd_buffer,
107bf215546Sopenharmony_ci                                    struct v3dv_buffer *buffer,
108bf215546Sopenharmony_ci                                    VkDeviceSize offset,
109bf215546Sopenharmony_ci                                    uint32_t drawCount,
110bf215546Sopenharmony_ci                                    uint32_t stride);
111bf215546Sopenharmony_ci
112bf215546Sopenharmony_civoid
113bf215546Sopenharmony_civ3dX(cmd_buffer_emit_indexed_indirect)(struct v3dv_cmd_buffer *cmd_buffer,
114bf215546Sopenharmony_ci                                       struct v3dv_buffer *buffer,
115bf215546Sopenharmony_ci                                       VkDeviceSize offset,
116bf215546Sopenharmony_ci                                       uint32_t drawCount,
117bf215546Sopenharmony_ci                                       uint32_t stride);
118bf215546Sopenharmony_ci
119bf215546Sopenharmony_civoid
120bf215546Sopenharmony_civ3dX(get_hw_clear_color)(const VkClearColorValue *color,
121bf215546Sopenharmony_ci                         uint32_t internal_type,
122bf215546Sopenharmony_ci                         uint32_t internal_size,
123bf215546Sopenharmony_ci                         uint32_t *hw_color);
124bf215546Sopenharmony_ci
125bf215546Sopenharmony_civoid
126bf215546Sopenharmony_civ3dX(cmd_buffer_render_pass_setup_render_target)(struct v3dv_cmd_buffer *cmd_buffer,
127bf215546Sopenharmony_ci                                                 int rt,
128bf215546Sopenharmony_ci                                                 uint32_t *rt_bpp,
129bf215546Sopenharmony_ci                                                 uint32_t *rt_type,
130bf215546Sopenharmony_ci                                                 uint32_t *rt_clamp);
131bf215546Sopenharmony_ci
132bf215546Sopenharmony_ci/* Used at v3dv_device */
133bf215546Sopenharmony_ci
134bf215546Sopenharmony_civoid
135bf215546Sopenharmony_civ3dX(pack_sampler_state)(struct v3dv_sampler *sampler,
136bf215546Sopenharmony_ci                         const VkSamplerCreateInfo *pCreateInfo,
137bf215546Sopenharmony_ci                         const VkSamplerCustomBorderColorCreateInfoEXT *bc_info);
138bf215546Sopenharmony_ci
139bf215546Sopenharmony_civoid
140bf215546Sopenharmony_civ3dX(framebuffer_compute_internal_bpp_msaa)(const struct v3dv_framebuffer *framebuffer,
141bf215546Sopenharmony_ci                                            const struct v3dv_cmd_buffer_attachment_state *attachments,
142bf215546Sopenharmony_ci                                            const struct v3dv_subpass *subpass,
143bf215546Sopenharmony_ci                                            uint8_t *max_bpp, bool *msaa);
144bf215546Sopenharmony_ci
145bf215546Sopenharmony_ci#ifdef DEBUG
146bf215546Sopenharmony_civoid
147bf215546Sopenharmony_civ3dX(device_check_prepacked_sizes)(void);
148bf215546Sopenharmony_ci#endif
149bf215546Sopenharmony_ci
150bf215546Sopenharmony_ci/* Used at v3dv_format */
151bf215546Sopenharmony_ciconst struct v3dv_format *
152bf215546Sopenharmony_civ3dX(get_format)(VkFormat);
153bf215546Sopenharmony_ci
154bf215546Sopenharmony_civoid
155bf215546Sopenharmony_civ3dX(get_internal_type_bpp_for_output_format)(uint32_t format,
156bf215546Sopenharmony_ci                                              uint32_t *type,
157bf215546Sopenharmony_ci                                              uint32_t *bpp);
158bf215546Sopenharmony_ci
159bf215546Sopenharmony_cibool
160bf215546Sopenharmony_civ3dX(format_supports_tlb_resolve)(const struct v3dv_format *format);
161bf215546Sopenharmony_ci
162bf215546Sopenharmony_cibool
163bf215546Sopenharmony_civ3dX(format_supports_blending)(const struct v3dv_format *format);
164bf215546Sopenharmony_ci
165bf215546Sopenharmony_cibool
166bf215546Sopenharmony_civ3dX(tfu_supports_tex_format)(uint32_t tex_format);
167bf215546Sopenharmony_ci
168bf215546Sopenharmony_ci/* Used at v3dv_image */
169bf215546Sopenharmony_ci
170bf215546Sopenharmony_civoid
171bf215546Sopenharmony_civ3dX(pack_texture_shader_state)(struct v3dv_device *device,
172bf215546Sopenharmony_ci                                struct v3dv_image_view *iview);
173bf215546Sopenharmony_ci
174bf215546Sopenharmony_civoid
175bf215546Sopenharmony_civ3dX(pack_texture_shader_state_from_buffer_view)(struct v3dv_device *device,
176bf215546Sopenharmony_ci                                                 struct v3dv_buffer_view *buffer_view);
177bf215546Sopenharmony_ci
178bf215546Sopenharmony_ci/* Used at v3dv_meta_* */
179bf215546Sopenharmony_ci
180bf215546Sopenharmony_ciuint32_t
181bf215546Sopenharmony_civ3dX(zs_buffer_from_aspect_bits)(VkImageAspectFlags aspects);
182bf215546Sopenharmony_ci
183bf215546Sopenharmony_ciuint8_t
184bf215546Sopenharmony_civ3dX(get_internal_depth_type)(VkFormat format);
185bf215546Sopenharmony_ci
186bf215546Sopenharmony_cistruct v3dv_meta_framebuffer;
187bf215546Sopenharmony_ci
188bf215546Sopenharmony_civoid
189bf215546Sopenharmony_civ3dX(meta_emit_copy_image_to_buffer_rcl)(struct v3dv_job *job,
190bf215546Sopenharmony_ci                                         struct v3dv_buffer *buffer,
191bf215546Sopenharmony_ci                                         struct v3dv_image *image,
192bf215546Sopenharmony_ci                                         struct v3dv_meta_framebuffer *framebuffer,
193bf215546Sopenharmony_ci                                         const VkBufferImageCopy2 *region);
194bf215546Sopenharmony_ci
195bf215546Sopenharmony_civoid
196bf215546Sopenharmony_civ3dX(meta_emit_resolve_image_rcl)(struct v3dv_job *job,
197bf215546Sopenharmony_ci                                  struct v3dv_image *dst,
198bf215546Sopenharmony_ci                                  struct v3dv_image *src,
199bf215546Sopenharmony_ci                                  struct v3dv_meta_framebuffer *framebuffer,
200bf215546Sopenharmony_ci                                  const VkImageResolve2 *region);
201bf215546Sopenharmony_ci
202bf215546Sopenharmony_civoid
203bf215546Sopenharmony_civ3dX(meta_emit_copy_buffer)(struct v3dv_job *job,
204bf215546Sopenharmony_ci                            struct v3dv_bo *dst,
205bf215546Sopenharmony_ci                            struct v3dv_bo *src,
206bf215546Sopenharmony_ci                            uint32_t dst_offset,
207bf215546Sopenharmony_ci                            uint32_t src_offset,
208bf215546Sopenharmony_ci                            struct v3dv_meta_framebuffer *framebuffer,
209bf215546Sopenharmony_ci                            uint32_t format,
210bf215546Sopenharmony_ci                            uint32_t item_size);
211bf215546Sopenharmony_ci
212bf215546Sopenharmony_civoid
213bf215546Sopenharmony_civ3dX(meta_emit_copy_buffer_rcl)(struct v3dv_job *job,
214bf215546Sopenharmony_ci                                struct v3dv_bo *dst,
215bf215546Sopenharmony_ci                                struct v3dv_bo *src,
216bf215546Sopenharmony_ci                                uint32_t dst_offset,
217bf215546Sopenharmony_ci                                uint32_t src_offset,
218bf215546Sopenharmony_ci                                struct v3dv_meta_framebuffer *framebuffer,
219bf215546Sopenharmony_ci                                uint32_t format,
220bf215546Sopenharmony_ci                                uint32_t item_size);
221bf215546Sopenharmony_ci
222bf215546Sopenharmony_civoid
223bf215546Sopenharmony_civ3dX(meta_emit_copy_image_rcl)(struct v3dv_job *job,
224bf215546Sopenharmony_ci                               struct v3dv_image *dst,
225bf215546Sopenharmony_ci                               struct v3dv_image *src,
226bf215546Sopenharmony_ci                               struct v3dv_meta_framebuffer *framebuffer,
227bf215546Sopenharmony_ci                               const VkImageCopy2 *region);
228bf215546Sopenharmony_ci
229bf215546Sopenharmony_civoid
230bf215546Sopenharmony_civ3dX(meta_emit_tfu_job)(struct v3dv_cmd_buffer *cmd_buffer,
231bf215546Sopenharmony_ci                        uint32_t dst_bo_handle,
232bf215546Sopenharmony_ci                        uint32_t dst_offset,
233bf215546Sopenharmony_ci                        enum v3d_tiling_mode dst_tiling,
234bf215546Sopenharmony_ci                        uint32_t dst_padded_height_or_stride,
235bf215546Sopenharmony_ci                        uint32_t dst_cpp,
236bf215546Sopenharmony_ci                        uint32_t src_bo_handle,
237bf215546Sopenharmony_ci                        uint32_t src_offset,
238bf215546Sopenharmony_ci                        enum v3d_tiling_mode src_tiling,
239bf215546Sopenharmony_ci                        uint32_t src_padded_height_or_stride,
240bf215546Sopenharmony_ci                        uint32_t src_cpp,
241bf215546Sopenharmony_ci                        uint32_t width,
242bf215546Sopenharmony_ci                        uint32_t height,
243bf215546Sopenharmony_ci                        const struct v3dv_format *format);
244bf215546Sopenharmony_ci
245bf215546Sopenharmony_civoid
246bf215546Sopenharmony_civ3dX(meta_emit_clear_image_rcl)(struct v3dv_job *job,
247bf215546Sopenharmony_ci                                struct v3dv_image *image,
248bf215546Sopenharmony_ci                                struct v3dv_meta_framebuffer *framebuffer,
249bf215546Sopenharmony_ci                                const union v3dv_clear_value *clear_value,
250bf215546Sopenharmony_ci                                VkImageAspectFlags aspects,
251bf215546Sopenharmony_ci                                uint32_t min_layer,
252bf215546Sopenharmony_ci                                uint32_t max_layer,
253bf215546Sopenharmony_ci                                uint32_t level);
254bf215546Sopenharmony_ci
255bf215546Sopenharmony_civoid
256bf215546Sopenharmony_civ3dX(meta_emit_fill_buffer_rcl)(struct v3dv_job *job,
257bf215546Sopenharmony_ci                                struct v3dv_bo *bo,
258bf215546Sopenharmony_ci                                uint32_t offset,
259bf215546Sopenharmony_ci                                struct v3dv_meta_framebuffer *framebuffer,
260bf215546Sopenharmony_ci                                uint32_t data);
261bf215546Sopenharmony_ci
262bf215546Sopenharmony_civoid
263bf215546Sopenharmony_civ3dX(meta_emit_copy_buffer_to_image_rcl)(struct v3dv_job *job,
264bf215546Sopenharmony_ci                                         struct v3dv_image *image,
265bf215546Sopenharmony_ci                                         struct v3dv_buffer *buffer,
266bf215546Sopenharmony_ci                                         struct v3dv_meta_framebuffer *framebuffer,
267bf215546Sopenharmony_ci                                         const VkBufferImageCopy2 *region);
268bf215546Sopenharmony_ci
269bf215546Sopenharmony_civoid
270bf215546Sopenharmony_civ3dX(get_internal_type_bpp_for_image_aspects)(VkFormat vk_format,
271bf215546Sopenharmony_ci                                              VkImageAspectFlags aspect_mask,
272bf215546Sopenharmony_ci                                              uint32_t *internal_type,
273bf215546Sopenharmony_ci                                              uint32_t *internal_bpp);
274bf215546Sopenharmony_ci
275bf215546Sopenharmony_cistruct v3dv_job *
276bf215546Sopenharmony_civ3dX(meta_copy_buffer)(struct v3dv_cmd_buffer *cmd_buffer,
277bf215546Sopenharmony_ci                       struct v3dv_bo *dst,
278bf215546Sopenharmony_ci                       uint32_t dst_offset,
279bf215546Sopenharmony_ci                       struct v3dv_bo *src,
280bf215546Sopenharmony_ci                       uint32_t src_offset,
281bf215546Sopenharmony_ci                       const VkBufferCopy2 *region);
282bf215546Sopenharmony_ci
283bf215546Sopenharmony_civoid
284bf215546Sopenharmony_civ3dX(meta_fill_buffer)(struct v3dv_cmd_buffer *cmd_buffer,
285bf215546Sopenharmony_ci                       struct v3dv_bo *bo,
286bf215546Sopenharmony_ci                       uint32_t offset,
287bf215546Sopenharmony_ci                       uint32_t size,
288bf215546Sopenharmony_ci                       uint32_t data);
289bf215546Sopenharmony_ci
290bf215546Sopenharmony_civoid
291bf215546Sopenharmony_civ3dX(meta_framebuffer_init)(struct v3dv_meta_framebuffer *fb,
292bf215546Sopenharmony_ci                            VkFormat vk_format,
293bf215546Sopenharmony_ci                            uint32_t internal_type,
294bf215546Sopenharmony_ci                            const struct v3dv_frame_tiling *tiling);
295bf215546Sopenharmony_ci
296bf215546Sopenharmony_ci/* Used at v3dv_pipeline */
297bf215546Sopenharmony_civoid
298bf215546Sopenharmony_civ3dX(pipeline_pack_state)(struct v3dv_pipeline *pipeline,
299bf215546Sopenharmony_ci                          const VkPipelineColorBlendStateCreateInfo *cb_info,
300bf215546Sopenharmony_ci                          const VkPipelineDepthStencilStateCreateInfo *ds_info,
301bf215546Sopenharmony_ci                          const VkPipelineRasterizationStateCreateInfo *rs_info,
302bf215546Sopenharmony_ci                          const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT *pv_info,
303bf215546Sopenharmony_ci                          const VkPipelineRasterizationLineStateCreateInfoEXT *ls_info,
304bf215546Sopenharmony_ci                          const VkPipelineMultisampleStateCreateInfo *ms_info);
305bf215546Sopenharmony_civoid
306bf215546Sopenharmony_civ3dX(pipeline_pack_compile_state)(struct v3dv_pipeline *pipeline,
307bf215546Sopenharmony_ci                                  const VkPipelineVertexInputStateCreateInfo *vi_info,
308bf215546Sopenharmony_ci                                  const VkPipelineVertexInputDivisorStateCreateInfoEXT *vd_info);
309bf215546Sopenharmony_ci/* Used at v3dv_queue */
310bf215546Sopenharmony_civoid
311bf215546Sopenharmony_civ3dX(job_emit_noop)(struct v3dv_job *job);
312bf215546Sopenharmony_ci
313bf215546Sopenharmony_ci/* Used at v3dv_descriptor_set, and other descriptor set utils */
314bf215546Sopenharmony_ciuint32_t v3dX(descriptor_bo_size)(VkDescriptorType type);
315bf215546Sopenharmony_ci
316bf215546Sopenharmony_ciuint32_t v3dX(max_descriptor_bo_size)(void);
317bf215546Sopenharmony_ci
318bf215546Sopenharmony_ciuint32_t v3dX(combined_image_sampler_texture_state_offset)(void);
319bf215546Sopenharmony_ci
320bf215546Sopenharmony_ciuint32_t v3dX(combined_image_sampler_sampler_state_offset)(void);
321