xref: /aosp_15_r20/external/mesa3d/src/freedreno/vulkan/tu_clear_blit.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright © 2016 Red Hat.
3  * Copyright © 2016 Bas Nieuwenhuizen
4  * SPDX-License-Identifier: MIT
5  *
6  * based in part on anv driver which is:
7  * Copyright © 2015 Intel Corporation
8  */
9 
10 #ifndef TU_CLEAR_BLIT_H
11 #define TU_CLEAR_BLIT_H
12 
13 #include "tu_common.h"
14 
15 void tu_init_clear_blit_shaders(struct tu_device *dev);
16 
17 void tu_destroy_clear_blit_shaders(struct tu_device *dev);
18 
19 template <chip CHIP>
20 void
21 tu6_clear_lrz(struct tu_cmd_buffer *cmd, struct tu_cs *cs, struct tu_image* image, const VkClearValue *value);
22 
23 template <chip CHIP>
24 void
25 tu6_dirty_lrz_fc(struct tu_cmd_buffer *cmd, struct tu_cs *cs, struct tu_image* image);
26 
27 template <chip CHIP>
28 void
29 tu_resolve_sysmem(struct tu_cmd_buffer *cmd,
30                   struct tu_cs *cs,
31                   const struct tu_image_view *src,
32                   const struct tu_image_view *dst,
33                   uint32_t layer_mask,
34                   uint32_t layers,
35                   const VkRect2D *rect);
36 
37 template <chip CHIP>
38 void
39 tu_clear_sysmem_attachment(struct tu_cmd_buffer *cmd,
40                            struct tu_cs *cs,
41                            uint32_t a);
42 
43 template <chip CHIP>
44 void
45 tu_clear_gmem_attachment(struct tu_cmd_buffer *cmd,
46                          struct tu_cs *cs,
47                          uint32_t a);
48 
49 void
50 tu7_generic_clear_attachment(struct tu_cmd_buffer *cmd,
51                              struct tu_cs *cs,
52                              uint32_t a);
53 
54 template <chip CHIP>
55 void
56 tu_load_gmem_attachment(struct tu_cmd_buffer *cmd,
57                         struct tu_cs *cs,
58                         uint32_t a,
59                         bool cond_exec_allowed,
60                         bool force_load);
61 
62 /* note: gmem store can also resolve */
63 template <chip CHIP>
64 void
65 tu_store_gmem_attachment(struct tu_cmd_buffer *cmd,
66                          struct tu_cs *cs,
67                          uint32_t a,
68                          uint32_t gmem_a,
69                          uint32_t layers,
70                          uint32_t layer_mask,
71                          bool cond_exec_allowed);
72 
73 void
74 tu_choose_gmem_layout(struct tu_cmd_buffer *cmd);
75 
76 #endif /* TU_CLEAR_BLIT_H */
77