~mmach/netext73/mesa-haswell

« back to all changes in this revision

Viewing changes to src/gallium/auxiliary/util/u_split_draw.h

  • Committer: mmach
  • Date: 2022-09-22 19:56:13 UTC
  • Revision ID: netbit73@gmail.com-20220922195613-wtik9mmy20tmor0i
2022-09-22 21:17:09

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Permission is hereby granted, free of charge, to any person obtaining a
3
 
 * copy of this software and associated documentation files (the "Software"),
4
 
 * to deal in the Software without restriction, including without limitation
5
 
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
6
 
 * and/or sell copies of the Software, and to permit persons to whom the
7
 
 * Software is furnished to do so, subject to the following conditions:
8
 
 *
9
 
 * The above copyright notice and this permission notice (including the next
10
 
 * paragraph) shall be included in all copies or substantial portions of the
11
 
 * Software.
12
 
 *
13
 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
 
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
 
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
16
 
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
 
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
 
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19
 
 * IN THE SOFTWARE.
20
 
 */
21
 
 
22
 
#ifndef U_SPLIT_DRAW_H
23
 
#define U_SPLIT_DRAW_H
24
 
 
25
 
#include "pipe/p_state.h"
26
 
 
27
 
/**
28
 
 * For non-indexed drawing, this function helps work around hardware
29
 
 * limits on the number of verts in a single draw.
30
 
 *
31
 
 * For the given mode of primitive from info, calculate the count and
32
 
 * step in the buffer so the draw can be split into multiple draws.
33
 
 *
34
 
 * \param info      pointer to the original pipe_draw_info from draw_vbo
35
 
 * \param max_verts max number of vertices that can be handled by the hardware
36
 
 * \param count     number of vertices remaining in the draw call. It is also
37
 
 *                  used as a return parameter, containing how many vertices
38
 
 *                  should be sent in the next job to the hardware.
39
 
 * \param step      return parameter, will contain how many vertices should be
40
 
 *                  skipped from the original count on the next call to this
41
 
 *                  function (may differ from count if the primitive mode
42
 
 *                  requires the last vertices to be reused in the next draw)
43
 
 */
44
 
bool
45
 
u_split_draw(const struct pipe_draw_info *info, uint32_t max_verts,
46
 
             uint32_t *count, uint32_t *step);
47
 
 
48
 
#endif