xref: /aosp_15_r20/external/mesa3d/src/imagination/vulkan/pvr_blit.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1*61046927SAndroid Build Coastguard Worker /*
2*61046927SAndroid Build Coastguard Worker  * Copyright © 2023 Imagination Technologies Ltd.
3*61046927SAndroid Build Coastguard Worker  *
4*61046927SAndroid Build Coastguard Worker  * Permission is hereby granted, free of charge, to any person obtaining a copy
5*61046927SAndroid Build Coastguard Worker  * of this software and associated documentation files (the "Software"), to deal
6*61046927SAndroid Build Coastguard Worker  * in the Software without restriction, including without limitation the rights
7*61046927SAndroid Build Coastguard Worker  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8*61046927SAndroid Build Coastguard Worker  * copies of the Software, and to permit persons to whom the Software is
9*61046927SAndroid Build Coastguard Worker  * furnished to do so, subject to the following conditions:
10*61046927SAndroid Build Coastguard Worker  *
11*61046927SAndroid Build Coastguard Worker  * The above copyright notice and this permission notice (including the next
12*61046927SAndroid Build Coastguard Worker  * paragraph) shall be included in all copies or substantial portions of the
13*61046927SAndroid Build Coastguard Worker  * Software.
14*61046927SAndroid Build Coastguard Worker  *
15*61046927SAndroid Build Coastguard Worker  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16*61046927SAndroid Build Coastguard Worker  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17*61046927SAndroid Build Coastguard Worker  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18*61046927SAndroid Build Coastguard Worker  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19*61046927SAndroid Build Coastguard Worker  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20*61046927SAndroid Build Coastguard Worker  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21*61046927SAndroid Build Coastguard Worker  * SOFTWARE.
22*61046927SAndroid Build Coastguard Worker  */
23*61046927SAndroid Build Coastguard Worker 
24*61046927SAndroid Build Coastguard Worker #ifndef PVR_BLIT_H
25*61046927SAndroid Build Coastguard Worker #define PVR_BLIT_H
26*61046927SAndroid Build Coastguard Worker 
27*61046927SAndroid Build Coastguard Worker #include <stdint.h>
28*61046927SAndroid Build Coastguard Worker #include <vulkan/vulkan_core.h>
29*61046927SAndroid Build Coastguard Worker 
30*61046927SAndroid Build Coastguard Worker #include "pvr_types.h"
31*61046927SAndroid Build Coastguard Worker 
32*61046927SAndroid Build Coastguard Worker struct pvr_cmd_buffer;
33*61046927SAndroid Build Coastguard Worker struct pvr_device;
34*61046927SAndroid Build Coastguard Worker struct pvr_image;
35*61046927SAndroid Build Coastguard Worker struct pvr_transfer_cmd;
36*61046927SAndroid Build Coastguard Worker struct pvr_transfer_cmd_surface;
37*61046927SAndroid Build Coastguard Worker 
38*61046927SAndroid Build Coastguard Worker VkFormat pvr_get_raw_copy_format(VkFormat format);
39*61046927SAndroid Build Coastguard Worker 
40*61046927SAndroid Build Coastguard Worker VkResult
41*61046927SAndroid Build Coastguard Worker pvr_copy_or_resolve_color_image_region(struct pvr_cmd_buffer *cmd_buffer,
42*61046927SAndroid Build Coastguard Worker                                        const struct pvr_image *src,
43*61046927SAndroid Build Coastguard Worker                                        const struct pvr_image *dst,
44*61046927SAndroid Build Coastguard Worker                                        const VkImageCopy2 *region);
45*61046927SAndroid Build Coastguard Worker 
46*61046927SAndroid Build Coastguard Worker VkResult pvr_copy_buffer_to_image_region(struct pvr_cmd_buffer *cmd_buffer,
47*61046927SAndroid Build Coastguard Worker                                          pvr_dev_addr_t buffer_dev_addr,
48*61046927SAndroid Build Coastguard Worker                                          const struct pvr_image *image,
49*61046927SAndroid Build Coastguard Worker                                          const VkBufferImageCopy2 *region);
50*61046927SAndroid Build Coastguard Worker 
51*61046927SAndroid Build Coastguard Worker VkResult
52*61046927SAndroid Build Coastguard Worker pvr_copy_buffer_to_image_region_format(struct pvr_cmd_buffer *cmd_buffer,
53*61046927SAndroid Build Coastguard Worker                                        pvr_dev_addr_t buffer_dev_addr,
54*61046927SAndroid Build Coastguard Worker                                        const struct pvr_image *image,
55*61046927SAndroid Build Coastguard Worker                                        const VkBufferImageCopy2 *region,
56*61046927SAndroid Build Coastguard Worker                                        VkFormat src_format,
57*61046927SAndroid Build Coastguard Worker                                        VkFormat dst_format,
58*61046927SAndroid Build Coastguard Worker                                        uint32_t flags);
59*61046927SAndroid Build Coastguard Worker 
60*61046927SAndroid Build Coastguard Worker VkResult pvr_copy_image_to_buffer_region(struct pvr_cmd_buffer *cmd_buffer,
61*61046927SAndroid Build Coastguard Worker                                          const struct pvr_image *image,
62*61046927SAndroid Build Coastguard Worker                                          pvr_dev_addr_t buffer_dev_addr,
63*61046927SAndroid Build Coastguard Worker                                          const VkBufferImageCopy2 *region);
64*61046927SAndroid Build Coastguard Worker 
65*61046927SAndroid Build Coastguard Worker VkResult
66*61046927SAndroid Build Coastguard Worker pvr_copy_image_to_buffer_region_format(struct pvr_cmd_buffer *cmd_buffer,
67*61046927SAndroid Build Coastguard Worker                                        const struct pvr_image *image,
68*61046927SAndroid Build Coastguard Worker                                        pvr_dev_addr_t buffer_dev_addr,
69*61046927SAndroid Build Coastguard Worker                                        const VkBufferImageCopy2 *region,
70*61046927SAndroid Build Coastguard Worker                                        VkFormat src_format,
71*61046927SAndroid Build Coastguard Worker                                        VkFormat dst_format);
72*61046927SAndroid Build Coastguard Worker 
73*61046927SAndroid Build Coastguard Worker /* TODO: Rename this? */
74*61046927SAndroid Build Coastguard Worker void pvr_clear_attachments_render_init(struct pvr_cmd_buffer *cmd_buffer,
75*61046927SAndroid Build Coastguard Worker                                        const VkClearAttachment *attachment,
76*61046927SAndroid Build Coastguard Worker                                        const VkClearRect *rect);
77*61046927SAndroid Build Coastguard Worker 
78*61046927SAndroid Build Coastguard Worker #endif /* PVR_BLIT_H */
79