xref: /aosp_15_r20/external/mesa3d/src/gallium/drivers/svga/svga_streamout.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright (c) 2014-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_STREAMOUT_H
9 #define SVGA_STREAMOUT_H
10 
11 struct svga_shader;
12 
13 struct svga_stream_output {
14    struct pipe_stream_output_info info;
15    unsigned pos_out_index;                  // position output index
16    unsigned id;
17    unsigned streammask;                     // bitmask to specify which streams are enabled
18    unsigned buffer_stream;
19    struct svga_winsys_buffer *declBuf;
20 };
21 
22 struct svga_stream_output *
23 svga_create_stream_output(struct svga_context *svga,
24                           struct svga_shader *shader,
25                           const struct pipe_stream_output_info *info);
26 
27 enum pipe_error
28 svga_set_stream_output(struct svga_context *svga,
29                        struct svga_stream_output *streamout);
30 
31 void
32 svga_delete_stream_output(struct svga_context *svga,
33                           struct svga_stream_output *streamout);
34 
35 enum pipe_error
36 svga_rebind_stream_output_targets(struct svga_context *svga);
37 
38 void
39 svga_create_stream_output_queries(struct svga_context *svga);
40 
41 void
42 svga_destroy_stream_output_queries(struct svga_context *svga);
43 
44 void
45 svga_begin_stream_output_queries(struct svga_context *svga, unsigned mask);
46 
47 void
48 svga_end_stream_output_queries(struct svga_context *svga, unsigned mask);
49 
50 unsigned
51 svga_get_primcount_from_stream_output(struct svga_context *svga,
52                                       unsigned stream);
53 
54 #endif /* SVGA_STREAMOUT_H */
55