• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 struct tu_resolve_group {
38    uint32_t color_buffer_id;
39    bool pending_resolves;
40 };
41 
42 template <chip CHIP>
43 void
44 tu_emit_resolve_group(struct tu_cmd_buffer *cmd,
45                            struct tu_cs *cs,
46                            struct tu_resolve_group *resolve_group);
47 
48 template <chip CHIP>
49 void
50 tu_clear_sysmem_attachment(struct tu_cmd_buffer *cmd,
51                            struct tu_cs *cs,
52                            uint32_t a);
53 
54 template <chip CHIP>
55 void
56 tu_clear_gmem_attachment(struct tu_cmd_buffer *cmd,
57                          struct tu_cs *cs,
58                          struct tu_resolve_group *resolve_group,
59                          uint32_t a);
60 
61 void
62 tu7_generic_clear_attachment(struct tu_cmd_buffer *cmd,
63                              struct tu_cs *cs,
64                              struct tu_resolve_group *resolve_group,
65                              uint32_t a);
66 
67 template <chip CHIP>
68 void
69 tu_load_gmem_attachment(struct tu_cmd_buffer *cmd,
70                         struct tu_cs *cs,
71                         struct tu_resolve_group *resolve_group,
72                         uint32_t a,
73                         bool cond_exec_allowed,
74                         bool force_load);
75 
76 /* note: gmem store can also resolve */
77 template <chip CHIP>
78 void
79 tu_store_gmem_attachment(struct tu_cmd_buffer *cmd,
80                          struct tu_cs *cs,
81                          struct tu_resolve_group *resolve_group,
82                          uint32_t a,
83                          uint32_t gmem_a,
84                          uint32_t layers,
85                          uint32_t layer_mask,
86                          bool cond_exec_allowed);
87 
88 void
89 tu_choose_gmem_layout(struct tu_cmd_buffer *cmd);
90 
91 #endif /* TU_CLEAR_BLIT_H */
92