1/*
2 * Copyright (C) 2021 Collabora Ltd.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 */
23
24#ifndef PANVK_PRIVATE_H
25#error "Must be included from panvk_private.h"
26#endif
27
28#ifndef PAN_ARCH
29#error "no arch"
30#endif
31
32#include <vulkan/vulkan.h>
33#include "compiler/shader_enums.h"
34
35void
36panvk_per_arch(emit_varying)(const struct panvk_device *dev,
37                             const struct panvk_varyings_info *varyings,
38                             gl_shader_stage stage, unsigned idx,
39                             void *attrib);
40
41void
42panvk_per_arch(emit_varyings)(const struct panvk_device *dev,
43                              const struct panvk_varyings_info *varyings,
44                              gl_shader_stage stage,
45                              void *descs);
46
47void
48panvk_per_arch(emit_varying_bufs)(const struct panvk_varyings_info *varyings,
49                                  void *descs);
50
51void
52panvk_per_arch(emit_attrib_bufs)(const struct panvk_attribs_info *info,
53                                 const struct panvk_attrib_buf *bufs,
54                                 unsigned buf_count,
55                                 const struct panvk_draw_info *draw,
56                                 void *descs);
57
58void
59panvk_per_arch(emit_attribs)(const struct panvk_device *dev,
60                             const struct panvk_attribs_info *attribs,
61                             const struct panvk_attrib_buf *bufs,
62                             unsigned buf_count,
63                             void *descs);
64
65void
66panvk_per_arch(emit_ubo)(mali_ptr address, size_t size,  void *desc);
67
68void
69panvk_per_arch(emit_ubos)(const struct panvk_pipeline *pipeline,
70                          const struct panvk_descriptor_state *state,
71                          void *descs);
72
73void
74panvk_per_arch(emit_sampler)(const VkSamplerCreateInfo *pCreateInfo,
75                             void *desc);
76
77void
78panvk_per_arch(emit_vertex_job)(const struct panvk_pipeline *pipeline,
79                                const struct panvk_draw_info *draw,
80                                void *job);
81
82void
83panvk_per_arch(emit_tiler_job)(const struct panvk_pipeline *pipeline,
84                               const struct panvk_draw_info *draw,
85                               void *job);
86
87void
88panvk_per_arch(emit_viewport)(const VkViewport *viewport,
89                              const VkRect2D *scissor,
90                              void *vpd);
91
92void
93panvk_per_arch(emit_blend)(const struct panvk_device *dev,
94                           const struct panvk_pipeline *pipeline,
95                           unsigned rt, void *bd);
96
97void
98panvk_per_arch(emit_blend_constant)(const struct panvk_device *dev,
99                                    const struct panvk_pipeline *pipeline,
100                                    unsigned rt, const float *constants,
101                                    void *bd);
102
103void
104panvk_per_arch(emit_dyn_fs_rsd)(const struct panvk_pipeline *pipeline,
105                                const struct panvk_cmd_state *state,
106                                void *rsd);
107
108void
109panvk_per_arch(emit_base_fs_rsd)(const struct panvk_device *dev,
110                                 const struct panvk_pipeline *pipeline,
111                                 void *rsd);
112
113void
114panvk_per_arch(emit_non_fs_rsd)(const struct panvk_device *dev,
115                                const struct pan_shader_info *shader_info,
116                                mali_ptr shader_ptr,
117                                void *rsd);
118
119void
120panvk_per_arch(emit_tiler_context)(const struct panvk_device *dev,
121                                   unsigned width, unsigned height,
122                                   const struct panfrost_ptr *descs);
123