mesa: remove unused _mesa_prim::is_indirect
[mesa.git] / src / mesa / main / draw.h
1 /*
2 * mesa 3-D graphics library
3 *
4 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25 /**
26 * \brief Array type draw functions, the main workhorse of any OpenGL API
27 * \author Keith Whitwell
28 */
29
30
31 #ifndef DRAW_H
32 #define DRAW_H
33
34 #include <stdbool.h>
35 #include "main/glheader.h"
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 struct gl_context;
42
43 struct _mesa_prim
44 {
45 GLuint mode:8; /**< GL_POINTS, GL_LINES, GL_QUAD_STRIP, etc */
46 GLuint indexed:1;
47 GLuint begin:1;
48 GLuint end:1;
49 GLuint pad:21;
50
51 GLuint start;
52 GLuint count;
53 GLint basevertex;
54 GLuint num_instances;
55 GLuint base_instance;
56 GLuint draw_id;
57
58 GLsizeiptr indirect_offset;
59 };
60
61 /* Would like to call this a "vbo_index_buffer", but this would be
62 * confusing as the indices are not neccessarily yet in a non-null
63 * buffer object.
64 */
65 struct _mesa_index_buffer
66 {
67 GLuint count;
68 unsigned index_size;
69 struct gl_buffer_object *obj;
70 const void *ptr;
71 };
72
73
74 void
75 _mesa_initialize_exec_dispatch(const struct gl_context *ctx,
76 struct _glapi_table *exec);
77
78
79 void
80 _mesa_draw_indirect(struct gl_context *ctx, GLuint mode,
81 struct gl_buffer_object *indirect_data,
82 GLsizeiptr indirect_offset, unsigned draw_count,
83 unsigned stride,
84 struct gl_buffer_object *indirect_draw_count_buffer,
85 GLsizeiptr indirect_draw_count_offset,
86 const struct _mesa_index_buffer *ib);
87
88
89 void GLAPIENTRY
90 _mesa_DrawArrays(GLenum mode, GLint first, GLsizei count);
91
92
93 void GLAPIENTRY
94 _mesa_DrawArraysInstanced(GLenum mode, GLint first, GLsizei count,
95 GLsizei primcount);
96
97
98 void GLAPIENTRY
99 _mesa_DrawElements(GLenum mode, GLsizei count, GLenum type,
100 const GLvoid *indices);
101
102
103 void GLAPIENTRY
104 _mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
105 GLenum type, const GLvoid *indices);
106
107
108 void GLAPIENTRY
109 _mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
110 const GLvoid *indices, GLint basevertex);
111
112
113 void GLAPIENTRY
114 _mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
115 GLsizei count, GLenum type,
116 const GLvoid *indices,
117 GLint basevertex);
118
119
120 void GLAPIENTRY
121 _mesa_DrawTransformFeedback(GLenum mode, GLuint name);
122
123
124
125 void GLAPIENTRY
126 _mesa_MultiDrawArrays(GLenum mode, const GLint *first,
127 const GLsizei *count, GLsizei primcount);
128
129
130 void GLAPIENTRY
131 _mesa_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type,
132 const GLvoid *const *indices, GLsizei primcount);
133
134
135 void GLAPIENTRY
136 _mesa_MultiDrawElementsBaseVertex(GLenum mode,
137 const GLsizei *count, GLenum type,
138 const GLvoid * const * indices, GLsizei primcount,
139 const GLint *basevertex);
140
141
142 void GLAPIENTRY
143 _mesa_MultiModeDrawArraysIBM(const GLenum * mode, const GLint * first,
144 const GLsizei * count,
145 GLsizei primcount, GLint modestride);
146
147
148 void GLAPIENTRY
149 _mesa_MultiModeDrawElementsIBM(const GLenum * mode, const GLsizei * count,
150 GLenum type, const GLvoid * const * indices,
151 GLsizei primcount, GLint modestride);
152
153
154 #ifdef __cplusplus
155 } // extern "C"
156 #endif
157
158 #endif