xref: /aosp_15_r20/external/mesa3d/src/gallium/drivers/svga/svga_draw.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright (c) 2008-2024 Broadcom. All Rights Reserved.
3  * The term “Broadcom” refers to Broadcom Inc.
4  * and/or its subsidiaries.
5  * SPDX-License-Identifier: MIT
6  */
7 
8 #ifndef SVGA_DRAW_H
9 #define SVGA_DRAW_H
10 
11 #include "util/compiler.h"
12 
13 #include "svga_hw_reg.h"
14 
15 struct svga_hwtnl;
16 struct svga_winsys_context;
17 struct svga_screen;
18 struct svga_context;
19 struct pipe_resource;
20 struct u_upload_mgr;
21 
22 struct svga_hwtnl *svga_hwtnl_create(struct svga_context *svga);
23 
24 void svga_hwtnl_destroy(struct svga_hwtnl *hwtnl);
25 
26 void svga_hwtnl_set_flatshade(struct svga_hwtnl *hwtnl,
27                               bool flatshade, bool flatshade_first);
28 
29 void svga_hwtnl_set_fillmode(struct svga_hwtnl *hwtnl, unsigned mode);
30 
31 void
32 svga_hwtnl_vertex_decls(struct svga_hwtnl *hwtnl,
33                         unsigned count,
34                         const SVGA3dVertexDecl * decls,
35                         const unsigned *buffer_indexes,
36                         SVGA3dElementLayoutId layoutId);
37 
38 void
39 svga_hwtnl_vertex_buffers(struct svga_hwtnl *hwtnl,
40                           unsigned count, struct pipe_vertex_buffer *buffers);
41 
42 enum pipe_error
43 svga_hwtnl_draw_arrays(struct svga_hwtnl *hwtnl,
44                        enum mesa_prim prim, unsigned start, unsigned count,
45                        unsigned start_instance, unsigned instance_count,
46                        uint8_t vertices_per_patch);
47 
48 enum pipe_error
49 svga_hwtnl_draw_range_elements(struct svga_hwtnl *hwtnl,
50                                const struct pipe_draw_info *info,
51                                const struct pipe_draw_start_count_bias *draw,
52                                unsigned count);
53 
54 bool
55 svga_hwtnl_is_buffer_referred(struct svga_hwtnl *hwtnl,
56                               struct pipe_resource *buffer);
57 
58 enum pipe_error svga_hwtnl_flush(struct svga_hwtnl *hwtnl);
59 
60 void svga_hwtnl_set_index_bias(struct svga_hwtnl *hwtnl, int index_bias);
61 
62 #endif /* SVGA_DRAW_H_ */
63