mesa: enable GL_EXT_draw_instanced for gles2
[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 GLubyte mode; /**< GL_POINTS, GL_LINES, GL_QUAD_STRIP, etc */
46
47 /**
48 * tnl: If true, line stipple emulation will reset the pattern walker.
49 * vbo: If false and the primitive is a line loop, the first vertex is
50 * the beginning of the line loop and it won't be drawn.
51 * Instead, it will be moved to the end.
52 */
53 bool begin;
54
55 /**
56 * tnl: If true and the primitive is a line loop, it will be closed.
57 * vbo: Same as tnl.
58 */
59 bool end;
60
61 GLuint start;
62 GLuint count;
63 GLint basevertex;
64 GLuint draw_id;
65 };
66
67 /* Would like to call this a "vbo_index_buffer", but this would be
68 * confusing as the indices are not neccessarily yet in a non-null
69 * buffer object.
70 */
71 struct _mesa_index_buffer
72 {
73 GLuint count;
74 uint8_t index_size_shift; /* logbase2(index_size) */
75 struct gl_buffer_object *obj;
76 const void *ptr;
77 };
78
79
80 void
81 _mesa_initialize_exec_dispatch(const struct gl_context *ctx,
82 struct _glapi_table *exec);
83
84
85 void GLAPIENTRY
86 _mesa_DrawArrays(GLenum mode, GLint first, GLsizei count);
87
88
89 void GLAPIENTRY
90 _mesa_DrawArraysInstanced(GLenum mode, GLint first, GLsizei count,
91 GLsizei primcount);
92
93
94 void GLAPIENTRY
95 _mesa_DrawElements(GLenum mode, GLsizei count, GLenum type,
96 const GLvoid *indices);
97
98
99 void GLAPIENTRY
100 _mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
101 GLenum type, const GLvoid *indices);
102
103
104 void GLAPIENTRY
105 _mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
106 const GLvoid *indices, GLint basevertex);
107
108
109 void GLAPIENTRY
110 _mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
111 GLsizei count, GLenum type,
112 const GLvoid *indices,
113 GLint basevertex);
114
115
116 void GLAPIENTRY
117 _mesa_DrawTransformFeedback(GLenum mode, GLuint name);
118
119
120
121 void GLAPIENTRY
122 _mesa_MultiDrawArrays(GLenum mode, const GLint *first,
123 const GLsizei *count, GLsizei primcount);
124
125
126 void GLAPIENTRY
127 _mesa_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type,
128 const GLvoid *const *indices, GLsizei primcount);
129
130
131 void GLAPIENTRY
132 _mesa_MultiDrawElementsBaseVertex(GLenum mode,
133 const GLsizei *count, GLenum type,
134 const GLvoid * const * indices, GLsizei primcount,
135 const GLint *basevertex);
136
137
138 void GLAPIENTRY
139 _mesa_MultiModeDrawArraysIBM(const GLenum * mode, const GLint * first,
140 const GLsizei * count,
141 GLsizei primcount, GLint modestride);
142
143
144 void GLAPIENTRY
145 _mesa_MultiModeDrawElementsIBM(const GLenum * mode, const GLsizei * count,
146 GLenum type, const GLvoid * const * indices,
147 GLsizei primcount, GLint modestride);
148
149
150 #ifdef __cplusplus
151 } // extern "C"
152 #endif
153
154 #endif