1 // Auto-generated with: android/scripts/gen-entries.py --mode=translator_passthrough android/android-emugl/host/libs/libOpenGLESDispatch/gles3_only.entries --output=android/android-emugl/host/libs/Translator/GLES_V2/GLESv30Imp.cpp
2 // This file is best left unedited.
3 // Try to make changes through gen_translator in gen-entries.py,
4 // and/or parcel out custom functionality in separate code.
5
glGetStringi(GLenum name,GLint index)6 EXTERN_PART GL_APICALL GLconstubyteptr GL_APIENTRY glGetStringi(GLenum name, GLint index) {
7 GET_CTX_V2_RET(0);
8 GLconstubyteptr glGetStringiRET = ctx->dispatcher().glGetStringi(name, index);
9 return glGetStringiRET;
10 }
11
glGenVertexArrays(GLsizei n,GLuint * arrays)12 GL_APICALL void GL_APIENTRY glGenVertexArrays(GLsizei n, GLuint* arrays) {
13 glGenVertexArraysOES(n, arrays);
14 }
15
glBindVertexArray(GLuint array)16 GL_APICALL void GL_APIENTRY glBindVertexArray(GLuint array) {
17 glBindVertexArrayOES(array);
18 }
19
glDeleteVertexArrays(GLsizei n,const GLuint * arrays)20 GL_APICALL void GL_APIENTRY glDeleteVertexArrays(GLsizei n, const GLuint * arrays) {
21 glDeleteVertexArraysOES(n, arrays);
22 }
23
glIsVertexArray(GLuint array)24 GL_APICALL GLboolean GL_APIENTRY glIsVertexArray(GLuint array) {
25 return glIsVertexArrayOES(array);
26 }
27
glMapBufferRange(GLenum target,GLintptr offset,GLsizeiptr length,GLbitfield access)28 GL_APICALL void * GL_APIENTRY glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) {
29 GET_CTX_V2_RET(0);
30 RET_AND_SET_ERROR_IF(!GLESv2Validate::bufferTarget(ctx, target),GL_INVALID_ENUM,0);
31 void * glMapBufferRangeRET = ctx->dispatcher().glMapBufferRange(target, offset, length, access);
32 return glMapBufferRangeRET;
33 }
34
glUnmapBuffer(GLenum target)35 GL_APICALL GLboolean GL_APIENTRY glUnmapBuffer(GLenum target) {
36 GET_CTX_V2_RET(0);
37 RET_AND_SET_ERROR_IF(!GLESv2Validate::bufferTarget(ctx, target),GL_INVALID_ENUM,0);
38 GLboolean glUnmapBufferRET = ctx->dispatcher().glUnmapBuffer(target);
39 return glUnmapBufferRET;
40 }
41
glFlushMappedBufferRange(GLenum target,GLintptr offset,GLsizeiptr length)42 GL_APICALL void GL_APIENTRY glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) {
43 GET_CTX_V2();
44 SET_ERROR_IF(!GLESv2Validate::bufferTarget(ctx, target),GL_INVALID_ENUM);
45 ctx->dispatcher().glFlushMappedBufferRange(target, offset, length);
46 }
47
glBindBufferRange(GLenum target,GLuint index,GLuint buffer,GLintptr offset,GLsizeiptr size)48 GL_APICALL void GL_APIENTRY glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) {
49 GET_CTX_V2();
50 SET_ERROR_IF(!GLESv2Validate::bufferTarget(ctx, target),GL_INVALID_ENUM);
51 ctx->bindBuffer(target, buffer);
52 ctx->bindIndexedBuffer(target, index, buffer, offset, size);
53 if (ctx->shareGroup().get()) {
54 const GLuint globalBufferName = ctx->shareGroup()->getGlobalName(NamedObjectType::VERTEXBUFFER, buffer);
55 ctx->dispatcher().glBindBufferRange(target, index, globalBufferName, offset, size);
56 }
57 }
58
glBindBufferBase(GLenum target,GLuint index,GLuint buffer)59 GL_APICALL void GL_APIENTRY glBindBufferBase(GLenum target, GLuint index, GLuint buffer) {
60 GET_CTX_V2();
61 SET_ERROR_IF(!GLESv2Validate::bufferTarget(ctx, target),GL_INVALID_ENUM);
62 ctx->bindBuffer(target, buffer);
63 ctx->bindIndexedBuffer(target, index, buffer);
64 if (ctx->shareGroup().get()) {
65 const GLuint globalBufferName = ctx->shareGroup()->getGlobalName(NamedObjectType::VERTEXBUFFER, buffer);
66 ctx->dispatcher().glBindBufferBase(target, index, globalBufferName);
67 }
68 }
69
glCopyBufferSubData(GLenum readtarget,GLenum writetarget,GLintptr readoffset,GLintptr writeoffset,GLsizeiptr size)70 GL_APICALL void GL_APIENTRY glCopyBufferSubData(GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size) {
71 GET_CTX_V2();
72 ctx->dispatcher().glCopyBufferSubData(readtarget, writetarget, readoffset, writeoffset, size);
73 }
74
glClearBufferiv(GLenum buffer,GLint drawBuffer,const GLint * value)75 GL_APICALL void GL_APIENTRY glClearBufferiv(GLenum buffer, GLint drawBuffer, const GLint * value) {
76 GET_CTX_V2();
77 ctx->dispatcher().glClearBufferiv(buffer, drawBuffer, value);
78 }
79
glClearBufferuiv(GLenum buffer,GLint drawBuffer,const GLuint * value)80 GL_APICALL void GL_APIENTRY glClearBufferuiv(GLenum buffer, GLint drawBuffer, const GLuint * value) {
81 GET_CTX_V2();
82 ctx->dispatcher().glClearBufferuiv(buffer, drawBuffer, value);
83 }
84
glClearBufferfv(GLenum buffer,GLint drawBuffer,const GLfloat * value)85 GL_APICALL void GL_APIENTRY glClearBufferfv(GLenum buffer, GLint drawBuffer, const GLfloat * value) {
86 GET_CTX_V2();
87 ctx->dispatcher().glClearBufferfv(buffer, drawBuffer, value);
88 }
89
glClearBufferfi(GLenum buffer,GLint drawBuffer,GLfloat depth,GLint stencil)90 GL_APICALL void GL_APIENTRY glClearBufferfi(GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil) {
91 GET_CTX_V2();
92 ctx->dispatcher().glClearBufferfi(buffer, drawBuffer, depth, stencil);
93 }
94
glGetBufferParameteri64v(GLenum target,GLenum value,GLint64 * data)95 GL_APICALL void GL_APIENTRY glGetBufferParameteri64v(GLenum target, GLenum value, GLint64 * data) {
96 GET_CTX_V2();
97 SET_ERROR_IF(!GLESv2Validate::bufferTarget(ctx, target),GL_INVALID_ENUM);
98 ctx->dispatcher().glGetBufferParameteri64v(target, value, data);
99 }
100
glGetBufferPointerv(GLenum target,GLenum pname,GLvoid ** params)101 GL_APICALL void GL_APIENTRY glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params) {
102 GET_CTX_V2();
103 SET_ERROR_IF(!GLESv2Validate::bufferTarget(ctx, target),GL_INVALID_ENUM);
104 ctx->dispatcher().glGetBufferPointerv(target, pname, params);
105 }
106
glUniformBlockBinding(GLuint program,GLuint uniformBlockIndex,GLuint uniformBlockBinding)107 GL_APICALL void GL_APIENTRY glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding) {
108 GET_CTX_V2();
109 if (ctx->shareGroup().get()) {
110 const GLuint globalProgramName = ctx->shareGroup()->getGlobalName(NamedObjectType::SHADER_OR_PROGRAM, program);
111 ctx->dispatcher().glUniformBlockBinding(globalProgramName, uniformBlockIndex, uniformBlockBinding);
112 }
113 }
114
glGetUniformBlockIndex(GLuint program,const GLchar * uniformBlockName)115 GL_APICALL GLuint GL_APIENTRY glGetUniformBlockIndex(GLuint program, const GLchar * uniformBlockName) {
116 GET_CTX_V2_RET(0);
117 if (ctx->shareGroup().get()) {
118 const GLuint globalProgramName = ctx->shareGroup()->getGlobalName(NamedObjectType::SHADER_OR_PROGRAM, program);
119 GLuint glGetUniformBlockIndexRET = ctx->dispatcher().glGetUniformBlockIndex(globalProgramName, uniformBlockName);
120 return glGetUniformBlockIndexRET;
121 } else return 0;
122 }
123
glGetUniformIndices(GLuint program,GLsizei uniformCount,const GLchar ** uniformNames,GLuint * uniformIndices)124 EXTERN_PART GL_APICALL void GL_APIENTRY glGetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar ** uniformNames, GLuint * uniformIndices) {
125 GET_CTX_V2();
126 if (ctx->shareGroup().get()) {
127 const GLuint globalProgramName = ctx->shareGroup()->getGlobalName(NamedObjectType::SHADER_OR_PROGRAM, program);
128 ctx->dispatcher().glGetUniformIndices(globalProgramName, uniformCount, uniformNames, uniformIndices);
129 }
130 }
131
glGetActiveUniformBlockiv(GLuint program,GLuint uniformBlockIndex,GLenum pname,GLint * params)132 GL_APICALL void GL_APIENTRY glGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params) {
133 GET_CTX_V2();
134 if (ctx->shareGroup().get()) {
135 const GLuint globalProgramName = ctx->shareGroup()->getGlobalName(NamedObjectType::SHADER_OR_PROGRAM, program);
136 ctx->dispatcher().glGetActiveUniformBlockiv(globalProgramName, uniformBlockIndex, pname, params);
137 }
138 }
139
glGetActiveUniformBlockName(GLuint program,GLuint uniformBlockIndex,GLsizei bufSize,GLsizei * length,GLchar * uniformBlockName)140 GL_APICALL void GL_APIENTRY glGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName) {
141 GET_CTX_V2();
142 if (ctx->shareGroup().get()) {
143 const GLuint globalProgramName = ctx->shareGroup()->getGlobalName(NamedObjectType::SHADER_OR_PROGRAM, program);
144 ctx->dispatcher().glGetActiveUniformBlockName(globalProgramName, uniformBlockIndex, bufSize, length, uniformBlockName);
145 }
146 }
147
glUniform1ui(GLint location,GLuint v0)148 GL_APICALL void GL_APIENTRY glUniform1ui(GLint location, GLuint v0) {
149 GET_CTX_V2();
150 int hostLoc = s_getHostLocOrSetError(ctx, location);
151 SET_ERROR_IF(hostLoc < -1, GL_INVALID_OPERATION);
152 ctx->dispatcher().glUniform1ui(hostLoc, v0);
153 }
154
glUniform2ui(GLint location,GLuint v0,GLuint v1)155 GL_APICALL void GL_APIENTRY glUniform2ui(GLint location, GLuint v0, GLuint v1) {
156 GET_CTX_V2();
157 int hostLoc = s_getHostLocOrSetError(ctx, location);
158 SET_ERROR_IF(hostLoc < -1, GL_INVALID_OPERATION);
159 ctx->dispatcher().glUniform2ui(hostLoc, v0, v1);
160 }
161
glUniform3ui(GLint location,GLuint v0,GLuint v1,GLuint v2)162 GL_APICALL void GL_APIENTRY glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2) {
163 GET_CTX_V2();
164 int hostLoc = s_getHostLocOrSetError(ctx, location);
165 SET_ERROR_IF(hostLoc < -1, GL_INVALID_OPERATION);
166 ctx->dispatcher().glUniform3ui(hostLoc, v0, v1, v2);
167 }
168
glUniform4ui(GLint location,GLint v0,GLuint v1,GLuint v2,GLuint v3)169 EXTERN_PART GL_APICALL void GL_APIENTRY glUniform4ui(GLint location, GLint v0, GLuint v1, GLuint v2, GLuint v3) {
170 GET_CTX_V2();
171 int hostLoc = s_getHostLocOrSetError(ctx, location);
172 SET_ERROR_IF(hostLoc < -1, GL_INVALID_OPERATION);
173 ctx->dispatcher().glUniform4ui(hostLoc, v0, v1, v2, v3);
174 }
175
glUniform1uiv(GLint location,GLsizei count,const GLuint * value)176 GL_APICALL void GL_APIENTRY glUniform1uiv(GLint location, GLsizei count, const GLuint * value) {
177 GET_CTX_V2();
178 int hostLoc = s_getHostLocOrSetError(ctx, location);
179 SET_ERROR_IF(hostLoc < -1, GL_INVALID_OPERATION);
180 ctx->dispatcher().glUniform1uiv(hostLoc, count, value);
181 }
182
glUniform2uiv(GLint location,GLsizei count,const GLuint * value)183 GL_APICALL void GL_APIENTRY glUniform2uiv(GLint location, GLsizei count, const GLuint * value) {
184 GET_CTX_V2();
185 int hostLoc = s_getHostLocOrSetError(ctx, location);
186 SET_ERROR_IF(hostLoc < -1, GL_INVALID_OPERATION);
187 ctx->dispatcher().glUniform2uiv(hostLoc, count, value);
188 }
189
glUniform3uiv(GLint location,GLsizei count,const GLuint * value)190 GL_APICALL void GL_APIENTRY glUniform3uiv(GLint location, GLsizei count, const GLuint * value) {
191 GET_CTX_V2();
192 int hostLoc = s_getHostLocOrSetError(ctx, location);
193 SET_ERROR_IF(hostLoc < -1, GL_INVALID_OPERATION);
194 ctx->dispatcher().glUniform3uiv(hostLoc, count, value);
195 }
196
glUniform4uiv(GLint location,GLsizei count,const GLuint * value)197 GL_APICALL void GL_APIENTRY glUniform4uiv(GLint location, GLsizei count, const GLuint * value) {
198 GET_CTX_V2();
199 int hostLoc = s_getHostLocOrSetError(ctx, location);
200 SET_ERROR_IF(hostLoc < -1, GL_INVALID_OPERATION);
201 ctx->dispatcher().glUniform4uiv(hostLoc, count, value);
202 }
203
glUniformMatrix2x3fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)204 GL_APICALL void GL_APIENTRY glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
205 GET_CTX_V2();
206 int hostLoc = s_getHostLocOrSetError(ctx, location);
207 SET_ERROR_IF(hostLoc < -1, GL_INVALID_OPERATION);
208 ctx->dispatcher().glUniformMatrix2x3fv(hostLoc, count, transpose, value);
209 }
210
glUniformMatrix3x2fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)211 GL_APICALL void GL_APIENTRY glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
212 GET_CTX_V2();
213 int hostLoc = s_getHostLocOrSetError(ctx, location);
214 SET_ERROR_IF(hostLoc < -1, GL_INVALID_OPERATION);
215 ctx->dispatcher().glUniformMatrix3x2fv(hostLoc, count, transpose, value);
216 }
217
glUniformMatrix2x4fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)218 GL_APICALL void GL_APIENTRY glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
219 GET_CTX_V2();
220 int hostLoc = s_getHostLocOrSetError(ctx, location);
221 SET_ERROR_IF(hostLoc < -1, GL_INVALID_OPERATION);
222 ctx->dispatcher().glUniformMatrix2x4fv(hostLoc, count, transpose, value);
223 }
224
glUniformMatrix4x2fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)225 GL_APICALL void GL_APIENTRY glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
226 GET_CTX_V2();
227 int hostLoc = s_getHostLocOrSetError(ctx, location);
228 SET_ERROR_IF(hostLoc < -1, GL_INVALID_OPERATION);
229 ctx->dispatcher().glUniformMatrix4x2fv(hostLoc, count, transpose, value);
230 }
231
glUniformMatrix3x4fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)232 GL_APICALL void GL_APIENTRY glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
233 GET_CTX_V2();
234 int hostLoc = s_getHostLocOrSetError(ctx, location);
235 SET_ERROR_IF(hostLoc < -1, GL_INVALID_OPERATION);
236 ctx->dispatcher().glUniformMatrix3x4fv(hostLoc, count, transpose, value);
237 }
238
glUniformMatrix4x3fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)239 GL_APICALL void GL_APIENTRY glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
240 GET_CTX_V2();
241 int hostLoc = s_getHostLocOrSetError(ctx, location);
242 SET_ERROR_IF(hostLoc < -1, GL_INVALID_OPERATION);
243 ctx->dispatcher().glUniformMatrix4x3fv(hostLoc, count, transpose, value);
244 }
245
glGetUniformuiv(GLuint program,GLint location,GLuint * params)246 GL_APICALL void GL_APIENTRY glGetUniformuiv(GLuint program, GLint location, GLuint * params) {
247 GET_CTX_V2();
248
249 SET_ERROR_IF(location < 0,GL_INVALID_OPERATION);
250 if (ctx->shareGroup().get()) {
251 const GLuint globalProgramName = ctx->shareGroup()->getGlobalName(NamedObjectType::SHADER_OR_PROGRAM, program);
252
253 SET_ERROR_IF(globalProgramName==0, GL_INVALID_VALUE);
254 auto objData = ctx->shareGroup()->getObjectData(
255 NamedObjectType::SHADER_OR_PROGRAM, program);
256 SET_ERROR_IF(objData->getDataType()!=PROGRAM_DATA,GL_INVALID_OPERATION);
257 ProgramData* pData = (ProgramData *)objData;
258 (void)pData;
259 #if !defined(TOLERATE_PROGRAM_LINK_ERROR) || !TOLERATE_PROGRAM_LINK_ERROR
260 SET_ERROR_IF(!pData->getLinkStatus(), GL_INVALID_OPERATION);
261 #endif
262 int hostLoc = s_getHostLocOrSetError(ctx, location);
263 SET_ERROR_IF(hostLoc < -1, GL_INVALID_OPERATION);
264 ctx->dispatcher().glGetUniformuiv(globalProgramName, hostLoc, params);
265 }
266 }
267
glGetActiveUniformsiv(GLuint program,GLsizei uniformCount,const GLuint * uniformIndices,GLenum pname,GLint * params)268 GL_APICALL void GL_APIENTRY glGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params) {
269 GET_CTX_V2();
270 if (ctx->shareGroup().get()) {
271 const GLuint globalProgramName = ctx->shareGroup()->getGlobalName(NamedObjectType::SHADER_OR_PROGRAM, program);
272 ctx->dispatcher().glGetActiveUniformsiv(globalProgramName, uniformCount, uniformIndices, pname, params);
273 }
274 }
275
glVertexAttribI4i(GLuint index,GLint v0,GLint v1,GLint v2,GLint v3)276 GL_APICALL void GL_APIENTRY glVertexAttribI4i(GLuint index, GLint v0, GLint v1, GLint v2, GLint v3) {
277 GET_CTX_V2();
278 ctx->dispatcher().glVertexAttribI4i(index, v0, v1, v2, v3);
279 }
280
glVertexAttribI4ui(GLuint index,GLuint v0,GLuint v1,GLuint v2,GLuint v3)281 GL_APICALL void GL_APIENTRY glVertexAttribI4ui(GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {
282 GET_CTX_V2();
283 ctx->dispatcher().glVertexAttribI4ui(index, v0, v1, v2, v3);
284 }
285
glVertexAttribI4iv(GLuint index,const GLint * v)286 GL_APICALL void GL_APIENTRY glVertexAttribI4iv(GLuint index, const GLint * v) {
287 GET_CTX_V2();
288 ctx->dispatcher().glVertexAttribI4iv(index, v);
289 }
290
glVertexAttribI4uiv(GLuint index,const GLuint * v)291 GL_APICALL void GL_APIENTRY glVertexAttribI4uiv(GLuint index, const GLuint * v) {
292 GET_CTX_V2();
293 ctx->dispatcher().glVertexAttribI4uiv(index, v);
294 }
295
glVertexAttribIPointerWithDataSize(GLuint index,GLint size,GLenum type,GLsizei stride,const GLvoid * ptr,GLsizei dataSize)296 GL_APICALL void GL_APIENTRY glVertexAttribIPointerWithDataSize(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* ptr, GLsizei dataSize) {
297 GET_CTX_V2();
298 SET_ERROR_IF((!GLESv2Validate::arrayIndex(ctx,index)),GL_INVALID_VALUE);
299
300 s_glPrepareVertexAttribPointer(ctx, index, size, type, false, stride, ptr, dataSize, true);
301 if (ctx->isBindedBuffer(GL_ARRAY_BUFFER)) {
302 ctx->dispatcher().glVertexAttribIPointer(index, size, type, stride, ptr);
303 }
304 }
305
glVertexAttribIPointer(GLuint index,GLint size,GLenum type,GLsizei stride,const GLvoid * pointer)306 GL_APICALL void GL_APIENTRY glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) {
307 GET_CTX_V2();
308 SET_ERROR_IF((!GLESv2Validate::arrayIndex(ctx,index)),GL_INVALID_VALUE);
309 s_glPrepareVertexAttribPointer(ctx, index, size, type, false, stride, pointer, 0, true);
310 if (ctx->isBindedBuffer(GL_ARRAY_BUFFER)) {
311 ctx->dispatcher().glVertexAttribIPointer(index, size, type, stride, pointer);
312 }
313 }
314
glGetVertexAttribIiv(GLuint index,GLenum pname,GLint * params)315 GL_APICALL void GL_APIENTRY glGetVertexAttribIiv(GLuint index, GLenum pname, GLint * params) {
316 GET_CTX_V2();
317 ctx->dispatcher().glGetVertexAttribIiv(index, pname, params);
318 }
319
glGetVertexAttribIuiv(GLuint index,GLenum pname,GLuint * params)320 GL_APICALL void GL_APIENTRY glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint * params) {
321 GET_CTX_V2();
322 ctx->dispatcher().glGetVertexAttribIuiv(index, pname, params);
323 }
324
glVertexAttribDivisor(GLuint index,GLuint divisor)325 GL_APICALL void GL_APIENTRY glVertexAttribDivisor(GLuint index, GLuint divisor) {
326 GET_CTX_V2();
327 SET_ERROR_IF((!GLESv2Validate::arrayIndex(ctx,index)),GL_INVALID_VALUE);
328 ctx->setVertexAttribBindingIndex(index, index);
329 ctx->setVertexAttribDivisor(index, divisor);
330 ctx->dispatcher().glVertexAttribDivisor(index, divisor);
331 }
332
glDrawArraysInstanced(GLenum mode,GLint first,GLsizei count,GLsizei primcount)333 GL_APICALL void GL_APIENTRY glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount) {
334 GET_CTX_V2();
335 SET_ERROR_IF(count < 0,GL_INVALID_VALUE)
336 SET_ERROR_IF(!(GLESv2Validate::drawMode(mode)),GL_INVALID_ENUM);
337 if (ctx->vertexAttributesBufferBacked()) {
338 s_glDrawPre(ctx, mode);
339 ctx->dispatcher().glDrawArraysInstanced(mode, first, count, primcount);
340 s_glDrawPost(ctx, mode);
341 } else {
342 ctx->drawWithEmulations(
343 GLESv2Context::DrawCallCmd::ArraysInstanced,
344 mode, first, count,
345 0, nullptr, primcount, 0, 0 /* type, indices, start, end unused */);
346 }
347 }
348
glDrawElementsInstanced(GLenum mode,GLsizei count,GLenum type,const void * indices,GLsizei primcount)349 GL_APICALL void GL_APIENTRY glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount) {
350 GET_CTX_V2();
351 SET_ERROR_IF(count < 0,GL_INVALID_VALUE)
352 SET_ERROR_IF(!(GLESv2Validate::drawMode(mode) && GLESv2Validate::drawType(type)),GL_INVALID_ENUM);
353
354 if (ctx->isBindedBuffer(GL_ELEMENT_ARRAY_BUFFER) &&
355 ctx->vertexAttributesBufferBacked()) {
356 s_glDrawPre(ctx, mode, type);
357 ctx->dispatcher().glDrawElementsInstanced(mode, count, type, indices, primcount);
358 s_glDrawPost(ctx, mode);
359 } else {
360 ctx->drawWithEmulations(
361 GLESv2Context::DrawCallCmd::ElementsInstanced,
362 mode, 0 /* first (unused) */, count, type, indices, primcount,
363 0, 0 /* start, end (unused) */);
364 }
365 }
366
glDrawRangeElements(GLenum mode,GLuint start,GLuint end,GLsizei count,GLenum type,const GLvoid * indices)367 GL_APICALL void GL_APIENTRY glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices) {
368 GET_CTX_V2();
369 SET_ERROR_IF(count < 0,GL_INVALID_VALUE)
370 SET_ERROR_IF(!(GLESv2Validate::drawMode(mode) && GLESv2Validate::drawType(type)),GL_INVALID_ENUM);
371
372 if (ctx->isBindedBuffer(GL_ELEMENT_ARRAY_BUFFER) &&
373 ctx->vertexAttributesBufferBacked()) {
374 s_glDrawPre(ctx, mode, type);
375 ctx->dispatcher().glDrawRangeElements(mode, start, end, count, type, indices);
376 s_glDrawPost(ctx, mode);
377 } else {
378 ctx->drawWithEmulations(
379 GLESv2Context::DrawCallCmd::RangeElements,
380 mode, 0 /* first (unused) */, count, type, indices, 0 /* primcount (unused) */,
381 start, end);
382 }
383 }
384
385 // GuestSyncs: Tracks the system-wide set of GL syncs, puts them in a
386 // distinguished namespace from EGL syncs. This is in its own class as opposed
387 // to a NameSpace because a) no real need to snapshot save/load those and b) it
388 // needs to span all contexts and give the same names across the entire system,
389 // as sync objects live outside of GL context state.
390 // This is to fix dEQP negative_api tests that delete sync object 0x1 but fail due
391 // to it colliding with an EGL fence name.
392 class GuestSyncs {
393 public:
GuestSyncs()394 GuestSyncs() { }
395
create(GLsync newHostSync)396 GLsync create(GLsync newHostSync) {
397 GLsync res = (GLsync)(uintptr_t)mNameCounter;
398 mSyncs[res] = newHostSync;
399 mNameCounter++;
400 if (!mNameCounter) mNameCounter = 0x1000;
401 return res;
402 }
403
lookupWithError(GLsync guestSync,GLint * err)404 GLsync lookupWithError(GLsync guestSync, GLint* err) {
405 *err = GL_NO_ERROR;
406 GLsync host = (GLsync)0x0;
407
408 const auto& it = mSyncs.find(guestSync);
409 if (it == mSyncs.end()) {
410 *err = GL_INVALID_VALUE;
411 return host;
412 } else {
413 host = it->second;
414 }
415 return host;
416 }
417
removeWithError(GLsync guestSyncToDelete,GLint * err)418 GLsync removeWithError(GLsync guestSyncToDelete, GLint* err) {
419 *err = GL_NO_ERROR;
420 GLsync host = (GLsync)0x0;
421
422 if (!guestSyncToDelete) {
423 return host;
424 }
425
426 const auto& it = mSyncs.find(guestSyncToDelete);
427 if (it == mSyncs.end()) {
428 *err = GL_INVALID_VALUE;
429 return host;
430 } else {
431 host = it->second;
432 }
433
434 mSyncs.erase(it);
435 return host;
436 }
437
isSync(GLsync guestSync)438 bool isSync(GLsync guestSync) {
439 return mSyncs.find(guestSync) != mSyncs.end();
440 }
441
lock()442 android::base::Lock& lock() { return mLock; }
443
444 private:
445 std::unordered_map<GLsync, GLsync> mSyncs;
446 mutable android::base::Lock mLock;
447 uint32_t mNameCounter = 0x1;
448 };
449
sSyncs()450 static GuestSyncs* sSyncs() {
451 static GuestSyncs* s = new GuestSyncs;
452 return s;
453 }
454
internal_glFenceSync(GLenum condition,GLbitfield flags)455 static GLsync internal_glFenceSync(GLenum condition, GLbitfield flags) {
456 GET_CTX_V2_RET(0);
457 if (!ctx->dispatcher().glFenceSync) {
458 ctx->dispatcher().glFinish();
459 return (GLsync)0x42;
460 }
461 GLsync glFenceSyncRET = ctx->dispatcher().glFenceSync(condition, flags);
462 return glFenceSyncRET;
463 }
464
internal_glClientWaitSync(GLsync wait_on,GLbitfield flags,GLuint64 timeout)465 static GLenum internal_glClientWaitSync(GLsync wait_on, GLbitfield flags, GLuint64 timeout) {
466 GET_CTX_V2_RET(GL_WAIT_FAILED);
467 if (!ctx->dispatcher().glFenceSync) {
468 return GL_ALREADY_SIGNALED;
469 }
470 GLenum glClientWaitSyncRET = ctx->dispatcher().glClientWaitSync(wait_on, flags, timeout);
471 return glClientWaitSyncRET;
472 }
473
internal_glWaitSync(GLsync wait_on,GLbitfield flags,GLuint64 timeout)474 static void internal_glWaitSync(GLsync wait_on, GLbitfield flags, GLuint64 timeout) {
475 GET_CTX_V2();
476 if (!ctx->dispatcher().glFenceSync) {
477 return;
478 }
479 ctx->dispatcher().glWaitSync(wait_on, flags, timeout);
480 }
481
internal_glDeleteSync(GLsync to_delete)482 static void internal_glDeleteSync(GLsync to_delete) {
483 GET_CTX_V2();
484 if (!ctx->dispatcher().glFenceSync) {
485 return;
486 }
487 ctx->dispatcher().glDeleteSync(to_delete);
488 }
489
internal_glGetSynciv(GLsync sync,GLenum pname,GLsizei bufsize,GLsizei * length,GLint * values)490 static void internal_glGetSynciv(GLsync sync, GLenum pname, GLsizei bufsize, GLsizei *length, GLint *values) {
491 GET_CTX_V2();
492 if (!ctx->dispatcher().glGetSynciv) {
493 if (bufsize < sizeof(GLint)) return;
494 switch (pname) {
495 case GL_OBJECT_TYPE:
496 if (length) *length = sizeof(GLint);
497 *values = GL_SYNC_FENCE;
498 break;
499 case GL_SYNC_CONDITION:
500 if (length) *length = sizeof(GLint);
501 *values = GL_SYNC_GPU_COMMANDS_COMPLETE;
502 break;
503 case GL_SYNC_FLAGS:
504 // Not supported
505 break;
506 case GL_SYNC_STATUS:
507 if (length) *length = sizeof(GLint);
508 *values = GL_SIGNALED;
509 break;
510 default:
511 break;
512 }
513 return;
514 }
515 ctx->dispatcher().glGetSynciv(sync, pname, bufsize, length, values);
516 }
517
glFenceSync(GLenum condition,GLbitfield flags)518 GL_APICALL GLsync GL_APIENTRY glFenceSync(GLenum condition, GLbitfield flags) {
519 GET_CTX_V2_RET(0);
520
521 android::base::AutoLock lock(sSyncs()->lock());
522 GLsync hostSync = internal_glFenceSync(condition, flags);
523 GLsync guestSync = sSyncs()->create(hostSync);
524 return guestSync;
525 }
526
glClientWaitSync(GLsync wait_on,GLbitfield flags,GLuint64 timeout)527 GL_APICALL GLenum GL_APIENTRY glClientWaitSync(GLsync wait_on, GLbitfield flags, GLuint64 timeout) {
528 GET_CTX_V2_RET(GL_WAIT_FAILED);
529 GLint err = GL_NO_ERROR;
530
531 android::base::AutoLock lock(sSyncs()->lock());
532 GLsync hostSync = sSyncs()->lookupWithError(wait_on, &err);
533 RET_AND_SET_ERROR_IF(err != GL_NO_ERROR, err, GL_WAIT_FAILED);
534 return internal_glClientWaitSync(hostSync, flags, timeout);
535 }
536
glWaitSync(GLsync wait_on,GLbitfield flags,GLuint64 timeout)537 GL_APICALL void GL_APIENTRY glWaitSync(GLsync wait_on, GLbitfield flags, GLuint64 timeout) {
538 GET_CTX_V2();
539 GLint err = GL_NO_ERROR;
540
541 android::base::AutoLock lock(sSyncs()->lock());
542 GLsync hostSync = sSyncs()->lookupWithError(wait_on, &err);
543 SET_ERROR_IF(err != GL_NO_ERROR, err);
544 internal_glWaitSync(hostSync, flags, timeout);
545 }
546
glDeleteSync(GLsync to_delete)547 GL_APICALL void GL_APIENTRY glDeleteSync(GLsync to_delete) {
548 GET_CTX_V2();
549 GLint err = GL_NO_ERROR;
550
551 android::base::AutoLock lock(sSyncs()->lock());
552 GLsync hostSync = sSyncs()->removeWithError(to_delete, &err);
553 SET_ERROR_IF(err != GL_NO_ERROR, err);
554 internal_glDeleteSync(hostSync);
555 }
556
glIsSync(GLsync sync)557 GL_APICALL GLboolean GL_APIENTRY glIsSync(GLsync sync) {
558 GET_CTX_V2_RET(0);
559
560 android::base::AutoLock lock(sSyncs()->lock());
561 return sSyncs()->isSync(sync) ? GL_TRUE : GL_FALSE;
562 }
563
glGetSynciv(GLsync sync,GLenum pname,GLsizei bufSize,GLsizei * length,GLint * values)564 GL_APICALL void GL_APIENTRY glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values) {
565 GET_CTX_V2();
566 GLint err = GL_NO_ERROR;
567
568 android::base::AutoLock lock(sSyncs()->lock());
569 GLsync hostSync = sSyncs()->lookupWithError(sync, &err);
570 SET_ERROR_IF(err != GL_NO_ERROR, err);
571 ctx->dispatcher().glGetSynciv(hostSync, pname, bufSize, length, values);
572 }
573
glDrawBuffers(GLsizei n,const GLenum * bufs)574 GL_APICALL void GL_APIENTRY glDrawBuffers(GLsizei n, const GLenum * bufs) {
575 GET_CTX_V2();
576 if (ctx->isDefaultFBOBound(GL_DRAW_FRAMEBUFFER)) {
577 SET_ERROR_IF(n != 1 || (bufs[0] != GL_NONE && bufs[0] != GL_BACK),
578 GL_INVALID_OPERATION);
579 GLenum emulatedBufs = bufs[0] == GL_NONE ? GL_NONE
580 : GL_COLOR_ATTACHMENT0;
581 ctx->setDefaultFBODrawBuffer(emulatedBufs);
582 ctx->dispatcher().glDrawBuffers(1, &emulatedBufs);
583 } else {
584 GLuint framebuffer = ctx->getFramebufferBinding(GL_DRAW_FRAMEBUFFER);
585 FramebufferData* fbObj = ctx->getFBOData(framebuffer);
586 fbObj->setDrawBuffers(n, bufs);
587 ctx->dispatcher().glDrawBuffers(n, bufs);
588 }
589 }
590
glReadBuffer(GLenum src)591 GL_APICALL void GL_APIENTRY glReadBuffer(GLenum src) {
592 GET_CTX_V2();
593 // if default fbo is bound and src is GL_BACK,
594 // use GL_COLOR_ATTACHMENT0 all of a sudden.
595 // bc we are using fbo emulation.
596 if (ctx->isDefaultFBOBound(GL_READ_FRAMEBUFFER)) {
597 SET_ERROR_IF(src != GL_NONE && src != GL_BACK, GL_INVALID_OPERATION);
598 GLenum emulatedSrc = src == GL_NONE ? GL_NONE
599 : GL_COLOR_ATTACHMENT0;
600 ctx->setDefaultFBOReadBuffer(emulatedSrc);
601 ctx->dispatcher().glReadBuffer(emulatedSrc);
602 } else {
603 GLuint framebuffer = ctx->getFramebufferBinding(GL_READ_FRAMEBUFFER);
604 FramebufferData* fbObj = ctx->getFBOData(framebuffer);
605 fbObj->setReadBuffers(src);
606 ctx->dispatcher().glReadBuffer(src);
607 }
608 }
609
glBlitFramebuffer(GLint srcX0,GLint srcY0,GLint srcX1,GLint srcY1,GLint dstX0,GLint dstY0,GLint dstX1,GLint dstY1,GLbitfield mask,GLenum filter)610 GL_APICALL void GL_APIENTRY glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
611 GET_CTX_V2();
612 ctx->dispatcher().glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
613 }
614
sGetEmulatedAttachmentList(GLESv2Context * ctx,GLenum target,GLsizei numAttachments,const GLenum * attachments)615 static std::vector<GLenum> sGetEmulatedAttachmentList(GLESv2Context* ctx, GLenum target,
616 GLsizei numAttachments, const GLenum* attachments) {
617 std::vector<GLenum> res(numAttachments);
618 memcpy(&res[0], attachments, numAttachments * sizeof(GLenum));
619
620 if (!ctx->hasEmulatedDefaultFBO() ||
621 !ctx->isDefaultFBOBound(target)) return res;
622
623
624 for (int i = 0; i < numAttachments; i++) {
625 if (attachments[i] == GL_COLOR) res[i] = GL_COLOR_ATTACHMENT0;
626 if (attachments[i] == GL_DEPTH) res[i] = GL_DEPTH_ATTACHMENT;
627 if (attachments[i] == GL_STENCIL) res[i] = GL_STENCIL_ATTACHMENT;
628 }
629
630 return res;
631 }
632
glInvalidateFramebuffer(GLenum target,GLsizei numAttachments,const GLenum * attachments)633 GL_APICALL void GL_APIENTRY glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum * attachments) {
634 GET_CTX_V2();
635 SET_ERROR_IF(target != GL_FRAMEBUFFER &&
636 target != GL_READ_FRAMEBUFFER &&
637 target != GL_DRAW_FRAMEBUFFER, GL_INVALID_ENUM);
638
639 GLint maxColorAttachments;
640 glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &maxColorAttachments);
641
642 for (int i = 0; i < numAttachments; i++) {
643 if (attachments[i] >= GL_COLOR_ATTACHMENT0 &&
644 attachments[i] <= GL_COLOR_ATTACHMENT15) {
645 SET_ERROR_IF((GLint)(attachments[i] - GL_COLOR_ATTACHMENT0 + 1) >
646 maxColorAttachments, GL_INVALID_OPERATION);
647 }
648 }
649
650 std::vector<GLenum> emulatedAttachments = sGetEmulatedAttachmentList(ctx, target, numAttachments, attachments);
651 if (ctx->dispatcher().glInvalidateFramebuffer) {
652 ctx->dispatcher().glInvalidateFramebuffer(target, numAttachments, &emulatedAttachments[0]);
653 } else {
654 // If we are missing glInvalidateFramebuffer, just don't do anything and hope things work out.
655 }
656 }
657
glInvalidateSubFramebuffer(GLenum target,GLsizei numAttachments,const GLenum * attachments,GLint x,GLint y,GLsizei width,GLsizei height)658 GL_APICALL void GL_APIENTRY glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height) {
659 GET_CTX_V2();
660 SET_ERROR_IF(target != GL_FRAMEBUFFER &&
661 target != GL_READ_FRAMEBUFFER &&
662 target != GL_DRAW_FRAMEBUFFER, GL_INVALID_ENUM);
663
664 GLint maxColorAttachments;
665 glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &maxColorAttachments);
666
667 for (int i = 0; i < numAttachments; i++) {
668 if (attachments[i] >= GL_COLOR_ATTACHMENT0 &&
669 attachments[i] <= GL_COLOR_ATTACHMENT15) {
670 SET_ERROR_IF((GLint)(attachments[i] - GL_COLOR_ATTACHMENT0 + 1) >
671 maxColorAttachments, GL_INVALID_OPERATION);
672 }
673 }
674
675 std::vector<GLenum> emulatedAttachments = sGetEmulatedAttachmentList(ctx, target, numAttachments, attachments);
676 if (ctx->dispatcher().glInvalidateSubFramebuffer) {
677 ctx->dispatcher().glInvalidateSubFramebuffer(target, numAttachments, &emulatedAttachments[0], x, y, width, height);
678 } else {
679 // If we are missing glInvalidateSubFramebuffer, just don't do anything and hope things work out.
680 }
681 }
682
glFramebufferTextureLayer(GLenum target,GLenum attachment,GLuint texture,GLint level,GLint layer)683 GL_APICALL void GL_APIENTRY glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) {
684 GET_CTX_V2();
685 GLenum textarget = GL_TEXTURE_2D_ARRAY;
686 SET_ERROR_IF(!(GLESv2Validate::framebufferTarget(ctx, target) &&
687 GLESv2Validate::framebufferAttachment(ctx, attachment)), GL_INVALID_ENUM);
688 SET_ERROR_IF(ctx->isDefaultFBOBound(target), GL_INVALID_OPERATION);
689 if (texture) {
690 if (!ctx->shareGroup()->isObject(NamedObjectType::TEXTURE, texture)) {
691 ctx->shareGroup()->genName(NamedObjectType::TEXTURE, texture);
692 }
693 TextureData* texData = getTextureData(texture);
694 textarget = texData->target;
695 }
696 if (ctx->shareGroup().get()) {
697 const GLuint globalTextureName = ctx->shareGroup()->getGlobalName(NamedObjectType::TEXTURE, texture);
698 ctx->dispatcher().glFramebufferTextureLayer(target, attachment, globalTextureName, level, layer);
699 }
700
701 GLuint fbName = ctx->getFramebufferBinding(target);
702 auto fbObj = ctx->getFBOData(fbName);
703 if (fbObj) {
704 fbObj->setAttachment(
705 ctx, attachment, textarget, texture, ObjectDataPtr());
706 }
707
708 }
709
glRenderbufferStorageMultisample(GLenum target,GLsizei samples,GLenum internalformat,GLsizei width,GLsizei height)710 GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
711 GET_CTX_V2();
712 GLint err = GL_NO_ERROR;
713 internalformat = sPrepareRenderbufferStorage(internalformat, width, height, samples, &err);
714 SET_ERROR_IF(err != GL_NO_ERROR, err);
715 ctx->dispatcher().glRenderbufferStorageMultisample(target, samples, internalformat, width, height);
716 }
717
glGetInternalformativ(GLenum target,GLenum internalformat,GLenum pname,GLsizei bufSize,GLint * params)718 GL_APICALL void GL_APIENTRY glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint * params) {
719 GET_CTX_V2();
720 ctx->dispatcher().glGetInternalformativ(target, internalformat, pname, bufSize, params);
721 }
722
glTexStorage2D(GLenum target,GLsizei levels,GLenum internalformat,GLsizei width,GLsizei height)723 GL_APICALL void GL_APIENTRY glTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
724 GET_CTX_V2();
725 GLint err = GL_NO_ERROR;
726 GLenum format, type;
727 GLESv2Validate::getCompatibleFormatTypeForInternalFormat(internalformat, &format, &type);
728 sPrepareTexImage2D(target, 0, (GLint)internalformat, width, height, 0, format, type, 0, NULL, &type, (GLint*)&internalformat, &err);
729 SET_ERROR_IF(err != GL_NO_ERROR, err);
730 TextureData *texData = getTextureTargetData(target);
731 texData->texStorageLevels = levels;
732 ctx->dispatcher().glTexStorage2D(target, levels, internalformat, width, height);
733 }
734
glBeginTransformFeedback(GLenum primitiveMode)735 GL_APICALL void GL_APIENTRY glBeginTransformFeedback(GLenum primitiveMode) {
736 GET_CTX_V2();
737 ctx->boundTransformFeedback()->mIsActive = true;
738 ctx->boundTransformFeedback()->mIsPaused = false;
739 ctx->dispatcher().glBeginTransformFeedback(primitiveMode);
740 }
741
glEndTransformFeedback()742 GL_APICALL void GL_APIENTRY glEndTransformFeedback() {
743 GET_CTX_V2();
744 ctx->boundTransformFeedback()->mIsActive = false;
745 ctx->dispatcher().glEndTransformFeedback();
746 }
747
glGenTransformFeedbacks(GLsizei n,GLuint * ids)748 GL_APICALL void GL_APIENTRY glGenTransformFeedbacks(GLsizei n, GLuint * ids) {
749 GET_CTX_V2();
750 SET_ERROR_IF(n < 0,GL_INVALID_VALUE);
751 for (int i = 0; i < n; i++) {
752 ids[i] = ctx->genTransformFeedbackName(0, true);
753 }
754 }
755
glDeleteTransformFeedbacks(GLsizei n,const GLuint * ids)756 GL_APICALL void GL_APIENTRY glDeleteTransformFeedbacks(GLsizei n, const GLuint * ids) {
757 GET_CTX_V2();
758 SET_ERROR_IF(n < 0,GL_INVALID_VALUE);
759 ObjectLocalName boundTransformFeedback = ctx->getTransformFeedbackBinding();
760 TransformFeedbackData* tfData = ctx->boundTransformFeedback();
761 if (boundTransformFeedback) {
762 for (GLsizei i = 0; i < n; i++) {
763 SET_ERROR_IF(ids[i] == boundTransformFeedback && tfData->mIsActive,
764 GL_INVALID_OPERATION);
765 }
766 }
767 for (GLsizei i = 0; i < n; i++) {
768 if (ids[i]) {
769 if (boundTransformFeedback == ids[i]) {
770 assert(!tfData->mIsActive);
771 ctx->bindTransformFeedback(0);
772 }
773 ctx->deleteTransformFeedback(ids[i]);
774 }
775 }
776 }
777
glBindTransformFeedback(GLenum target,GLuint id)778 GL_APICALL void GL_APIENTRY glBindTransformFeedback(GLenum target, GLuint id) {
779 GET_CTX_V2();
780 unsigned int globalName = ctx->getTransformFeedbackGlobalName(id);
781 SET_ERROR_IF(id != 0 && globalName == 0, GL_INVALID_OPERATION);
782 ctx->bindTransformFeedback(id);
783 ctx->dispatcher().glBindTransformFeedback(target, globalName);
784 }
785
glPauseTransformFeedback()786 GL_APICALL void GL_APIENTRY glPauseTransformFeedback() {
787 GET_CTX_V2();
788 ctx->boundTransformFeedback()->mIsPaused = true;
789 ctx->dispatcher().glPauseTransformFeedback();
790 }
791
glResumeTransformFeedback()792 GL_APICALL void GL_APIENTRY glResumeTransformFeedback() {
793 GET_CTX_V2();
794 ctx->boundTransformFeedback()->mIsPaused = false;
795 ctx->dispatcher().glResumeTransformFeedback();
796 }
797
glIsTransformFeedback(GLuint id)798 GL_APICALL GLboolean GL_APIENTRY glIsTransformFeedback(GLuint id) {
799 GET_CTX_V2_RET(0);
800 return ctx->hasBoundTransformFeedback(id);
801 }
802
glTransformFeedbackVaryings(GLuint program,GLsizei count,const char ** varyings,GLenum bufferMode)803 EXTERN_PART GL_APICALL void GL_APIENTRY glTransformFeedbackVaryings(GLuint program, GLsizei count, const char ** varyings, GLenum bufferMode) {
804 GET_CTX_V2();
805 if (ctx->shareGroup().get()) {
806 const GLuint globalProgramName = ctx->shareGroup()->getGlobalName(NamedObjectType::SHADER_OR_PROGRAM, program);
807 ctx->dispatcher().glTransformFeedbackVaryings(globalProgramName, count, varyings, bufferMode);
808 }
809 }
810
glGetTransformFeedbackVarying(GLuint program,GLuint index,GLsizei bufSize,GLsizei * length,GLsizei * size,GLenum * type,char * name)811 GL_APICALL void GL_APIENTRY glGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, char * name) {
812 GET_CTX_V2();
813 if (ctx->shareGroup().get()) {
814 const GLuint globalProgramName = ctx->shareGroup()->getGlobalName(NamedObjectType::SHADER_OR_PROGRAM, program);
815 ctx->dispatcher().glGetTransformFeedbackVarying(globalProgramName, index, bufSize, length, size, type, name);
816 }
817 }
818
glGenSamplers(GLsizei n,GLuint * samplers)819 GL_APICALL void GL_APIENTRY glGenSamplers(GLsizei n, GLuint * samplers) {
820 GET_CTX_V2();
821 SET_ERROR_IF(n < 0,GL_INVALID_VALUE);
822
823 if(ctx->shareGroup().get()) {
824 for(int i=0; i<n ;i++) {
825 samplers[i] = ctx->shareGroup()->genName(NamedObjectType::SAMPLER,
826 0, true);
827 ctx->shareGroup()->setObjectData(NamedObjectType::SAMPLER,
828 samplers[i], ObjectDataPtr(new SamplerData()));
829 }
830 }
831 }
832
glDeleteSamplers(GLsizei n,const GLuint * samplers)833 GL_APICALL void GL_APIENTRY glDeleteSamplers(GLsizei n, const GLuint * samplers) {
834 GET_CTX_V2();
835 SET_ERROR_IF(n < 0,GL_INVALID_VALUE);
836
837 if(ctx->shareGroup().get()) {
838 for(int i=0; i<n ;i++) {
839 ctx->shareGroup()->deleteName(NamedObjectType::SAMPLER, samplers[i]);
840 }
841 }
842 }
843
glBindSampler(GLuint unit,GLuint sampler)844 GL_APICALL void GL_APIENTRY glBindSampler(GLuint unit, GLuint sampler) {
845 GET_CTX_V2();
846 if (ctx->shareGroup().get()) {
847 const GLuint globalSampler = ctx->shareGroup()->getGlobalName(NamedObjectType::SAMPLER, sampler);
848 SET_ERROR_IF(sampler && !globalSampler, GL_INVALID_OPERATION);
849 ctx->setBindSampler(unit, sampler);
850 ctx->dispatcher().glBindSampler(unit, globalSampler);
851 }
852 }
853
glSamplerParameterf(GLuint sampler,GLenum pname,GLfloat param)854 GL_APICALL void GL_APIENTRY glSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param) {
855 GET_CTX_V2();
856 if (ctx->shareGroup().get()) {
857 const GLuint globalSampler = ctx->shareGroup()->getGlobalName(
858 NamedObjectType::SAMPLER, sampler);
859 SET_ERROR_IF(!globalSampler, GL_INVALID_OPERATION);
860 SamplerData* samplerData = (SamplerData*)ctx->shareGroup()->getObjectData(
861 NamedObjectType::SAMPLER, sampler);
862 samplerData->setParamf(pname, param);
863 ctx->dispatcher().glSamplerParameterf(globalSampler, pname, param);
864 }
865 }
866
glSamplerParameteri(GLuint sampler,GLenum pname,GLint param)867 GL_APICALL void GL_APIENTRY glSamplerParameteri(GLuint sampler, GLenum pname, GLint param) {
868 GET_CTX_V2();
869 if (ctx->shareGroup().get()) {
870 const GLuint globalSampler = ctx->shareGroup()->getGlobalName(
871 NamedObjectType::SAMPLER, sampler);
872 SET_ERROR_IF(!globalSampler, GL_INVALID_OPERATION);
873 SamplerData* samplerData = (SamplerData*)ctx->shareGroup()->getObjectData(
874 NamedObjectType::SAMPLER, sampler);
875 samplerData->setParami(pname, param);
876 ctx->dispatcher().glSamplerParameteri(globalSampler, pname, param);
877 }
878 }
879
glSamplerParameterfv(GLuint sampler,GLenum pname,const GLfloat * params)880 GL_APICALL void GL_APIENTRY glSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat * params) {
881 GET_CTX_V2();
882 if (ctx->shareGroup().get()) {
883 const GLuint globalSampler = ctx->shareGroup()->getGlobalName(NamedObjectType::SAMPLER, sampler);
884 ctx->dispatcher().glSamplerParameterfv(globalSampler, pname, params);
885 }
886 }
887
glSamplerParameteriv(GLuint sampler,GLenum pname,const GLint * params)888 GL_APICALL void GL_APIENTRY glSamplerParameteriv(GLuint sampler, GLenum pname, const GLint * params) {
889 GET_CTX_V2();
890 if (ctx->shareGroup().get()) {
891 const GLuint globalSampler = ctx->shareGroup()->getGlobalName(NamedObjectType::SAMPLER, sampler);
892 ctx->dispatcher().glSamplerParameteriv(globalSampler, pname, params);
893 }
894 }
895
glGetSamplerParameterfv(GLuint sampler,GLenum pname,GLfloat * params)896 GL_APICALL void GL_APIENTRY glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat * params) {
897 GET_CTX_V2();
898 if (ctx->shareGroup().get()) {
899 const GLuint globalSampler = ctx->shareGroup()->getGlobalName(NamedObjectType::SAMPLER, sampler);
900 ctx->dispatcher().glGetSamplerParameterfv(globalSampler, pname, params);
901 }
902 }
903
glGetSamplerParameteriv(GLuint sampler,GLenum pname,GLint * params)904 GL_APICALL void GL_APIENTRY glGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint * params) {
905 GET_CTX_V2();
906 if (ctx->shareGroup().get()) {
907 const GLuint globalSampler = ctx->shareGroup()->getGlobalName(NamedObjectType::SAMPLER, sampler);
908 ctx->dispatcher().glGetSamplerParameteriv(globalSampler, pname, params);
909 }
910 }
911
glIsSampler(GLuint sampler)912 GL_APICALL GLboolean GL_APIENTRY glIsSampler(GLuint sampler) {
913 GET_CTX_V2_RET(0);
914 if (ctx->shareGroup().get()) {
915 const GLuint globalSampler = ctx->shareGroup()->getGlobalName(NamedObjectType::SAMPLER, sampler);
916 GLboolean glIsSamplerRET = ctx->dispatcher().glIsSampler(globalSampler);
917 return glIsSamplerRET;
918 } else return 0;
919 }
920
glGenQueries(GLsizei n,GLuint * queries)921 GL_APICALL void GL_APIENTRY glGenQueries(GLsizei n, GLuint * queries) {
922 GET_CTX_V2();
923 SET_ERROR_IF(n < 0,GL_INVALID_VALUE);
924
925 if(ctx->shareGroup().get()) {
926 for(int i=0; i<n ;i++) {
927 queries[i] = ctx->shareGroup()->genName(NamedObjectType::QUERY,
928 0, true);
929 }
930 }
931 }
932
glDeleteQueries(GLsizei n,const GLuint * queries)933 GL_APICALL void GL_APIENTRY glDeleteQueries(GLsizei n, const GLuint * queries) {
934 GET_CTX_V2();
935 SET_ERROR_IF(n < 0,GL_INVALID_VALUE);
936
937 if(ctx->shareGroup().get()) {
938 for(int i=0; i<n ;i++) {
939 ctx->shareGroup()->deleteName(NamedObjectType::QUERY, queries[i]);
940 }
941 }
942 }
943
glBeginQuery(GLenum target,GLuint query)944 GL_APICALL void GL_APIENTRY glBeginQuery(GLenum target, GLuint query) {
945 GET_CTX_V2();
946 if (ctx->shareGroup().get()) {
947 const GLuint globalQuery = ctx->shareGroup()->getGlobalName(NamedObjectType::QUERY, query);
948 ctx->dispatcher().glBeginQuery(target, globalQuery);
949 }
950 }
951
glEndQuery(GLenum target)952 GL_APICALL void GL_APIENTRY glEndQuery(GLenum target) {
953 GET_CTX_V2();
954 ctx->dispatcher().glEndQuery(target);
955 }
956
glGetQueryiv(GLenum target,GLenum pname,GLint * params)957 GL_APICALL void GL_APIENTRY glGetQueryiv(GLenum target, GLenum pname, GLint * params) {
958 GET_CTX_V2();
959 ctx->dispatcher().glGetQueryiv(target, pname, params);
960 }
961
glGetQueryObjectuiv(GLuint query,GLenum pname,GLuint * params)962 GL_APICALL void GL_APIENTRY glGetQueryObjectuiv(GLuint query, GLenum pname, GLuint * params) {
963 GET_CTX_V2();
964 if (ctx->shareGroup().get()) {
965 const GLuint globalQuery = ctx->shareGroup()->getGlobalName(NamedObjectType::QUERY, query);
966 ctx->dispatcher().glGetQueryObjectuiv(globalQuery, pname, params);
967 }
968 }
969
glIsQuery(GLuint query)970 GL_APICALL GLboolean GL_APIENTRY glIsQuery(GLuint query) {
971 GET_CTX_V2_RET(0);
972 if (ctx->shareGroup().get()) {
973 const GLuint globalQuery = ctx->shareGroup()->getGlobalName(NamedObjectType::QUERY, query);
974 GLboolean glIsQueryRET = ctx->dispatcher().glIsQuery(globalQuery);
975 return glIsQueryRET;
976 } else return 0;
977 }
978
glProgramParameteri(GLuint program,GLenum pname,GLint value)979 GL_APICALL void GL_APIENTRY glProgramParameteri(GLuint program, GLenum pname, GLint value) {
980 GET_CTX_V2();
981 if (ctx->shareGroup().get()) {
982 const GLuint globalProgramName = ctx->shareGroup()->getGlobalName(NamedObjectType::SHADER_OR_PROGRAM, program);
983 ctx->dispatcher().glProgramParameteri(globalProgramName, pname, value);
984 }
985 }
986
glProgramBinary(GLuint program,GLenum binaryFormat,const void * binary,GLsizei length)987 GL_APICALL void GL_APIENTRY glProgramBinary(GLuint program, GLenum binaryFormat, const void * binary, GLsizei length) {
988 GET_CTX_V2();
989 if (ctx->shareGroup().get()) {
990 const GLuint globalProgramName = ctx->shareGroup()->getGlobalName(NamedObjectType::SHADER_OR_PROGRAM, program);
991 ctx->dispatcher().glProgramBinary(globalProgramName, binaryFormat, binary, length);
992 }
993 }
994
glGetProgramBinary(GLuint program,GLsizei bufsize,GLsizei * length,GLenum * binaryFormat,void * binary)995 GL_APICALL void GL_APIENTRY glGetProgramBinary(GLuint program, GLsizei bufsize, GLsizei * length, GLenum * binaryFormat, void * binary) {
996 GET_CTX_V2();
997 if (ctx->shareGroup().get()) {
998 const GLuint globalProgramName = ctx->shareGroup()->getGlobalName(NamedObjectType::SHADER_OR_PROGRAM, program);
999 ctx->dispatcher().glGetProgramBinary(globalProgramName, bufsize, length, binaryFormat, binary);
1000 }
1001 }
1002
glGetFragDataLocation(GLuint program,const char * name)1003 GL_APICALL GLint GL_APIENTRY glGetFragDataLocation(GLuint program, const char * name) {
1004 GET_CTX_V2_RET(0);
1005 if (ctx->shareGroup().get()) {
1006 const GLuint globalProgramName = ctx->shareGroup()->getGlobalName(NamedObjectType::SHADER_OR_PROGRAM, program);
1007 GLint glGetFragDataLocationRET = ctx->dispatcher().glGetFragDataLocation(globalProgramName, name);
1008 return glGetFragDataLocationRET;
1009 } else return 0;
1010 }
1011
glGetInteger64v(GLenum pname,GLint64 * data)1012 GL_APICALL void GL_APIENTRY glGetInteger64v(GLenum pname, GLint64 * data) {
1013 GET_CTX_V2();
1014 s_glStateQueryTv<GLint64>(true, pname, data, s_glGetInteger64v_wrapper);
1015 }
1016
glGetIntegeri_v(GLenum target,GLuint index,GLint * data)1017 GL_APICALL void GL_APIENTRY glGetIntegeri_v(GLenum target, GLuint index, GLint * data) {
1018 GET_CTX_V2();
1019 s_glStateQueryTi_v<GLint>(target, index, data, s_glGetIntegeri_v_wrapper);
1020 }
1021
glGetInteger64i_v(GLenum target,GLuint index,GLint64 * data)1022 GL_APICALL void GL_APIENTRY glGetInteger64i_v(GLenum target, GLuint index, GLint64 * data) {
1023 GET_CTX_V2();
1024 s_glStateQueryTi_v<GLint64>(target, index, data, s_glGetInteger64i_v_wrapper);
1025 }
1026
glTexImage3D(GLenum target,GLint level,GLint internalFormat,GLsizei width,GLsizei height,GLsizei depth,GLint border,GLenum format,GLenum type,const GLvoid * data)1027 GL_APICALL void GL_APIENTRY glTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * data) {
1028 GET_CTX_V2();
1029 SET_ERROR_IF(!GLESv2Validate::pixelItnlFrmt(ctx,internalFormat), GL_INVALID_VALUE);
1030 SET_ERROR_IF(!GLESv2Validate::isCompressedFormat(internalFormat) &&
1031 !GLESv2Validate::pixelSizedFrmt(ctx, internalFormat, format, type),
1032 GL_INVALID_OPERATION);
1033
1034 s_glInitTexImage3D(target, level, internalFormat, width, height, depth,
1035 border, format, type);
1036 // Desktop OpenGL doesn't support GL_BGRA_EXT as internal format.
1037 if (!isGles2Gles() && type == GL_UNSIGNED_BYTE && format == GL_BGRA_EXT &&
1038 internalFormat == GL_BGRA_EXT) {
1039 internalFormat = GL_RGBA;
1040 }
1041
1042 if (isCoreProfile()) {
1043 GLEScontext::prepareCoreProfileEmulatedTexture(
1044 getTextureTargetData(target),
1045 true, target, format, type,
1046 &internalFormat, &format);
1047 }
1048
1049 ctx->dispatcher().glTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, data);
1050 }
1051
glTexStorage3D(GLenum target,GLsizei levels,GLenum internalformat,GLsizei width,GLsizei height,GLsizei depth)1052 GL_APICALL void GL_APIENTRY glTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
1053 GET_CTX_V2();
1054 GLenum format, type;
1055 GLESv2Validate::getCompatibleFormatTypeForInternalFormat(internalformat, &format, &type);
1056 s_glInitTexImage3D(target, 0, internalformat, width, height, depth, 0,
1057 format, type);
1058 // Desktop OpenGL doesn't support GL_BGRA_EXT as internal format.
1059 if (!isGles2Gles() && type == GL_UNSIGNED_BYTE && format == GL_BGRA_EXT &&
1060 internalformat == GL_BGRA8_EXT) {
1061 internalformat = GL_RGBA8;
1062 }
1063 TextureData *texData = getTextureTargetData(target);
1064 texData->texStorageLevels = levels;
1065 ctx->dispatcher().glTexStorage3D(target, levels, internalformat, width, height, depth);
1066 }
1067
glTexSubImage3D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLenum type,const GLvoid * data)1068 GL_APICALL void GL_APIENTRY glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * data) {
1069 GET_CTX_V2();
1070 if (isCoreProfile() &&
1071 isCoreProfileEmulatedFormat(format)) {
1072 format = getCoreProfileEmulatedFormat(format);
1073 }
1074 TextureData* texData = getTextureTargetData(target);
1075 if (texData) {
1076 texData->setMipmapLevelAtLeast(level);
1077 texData->makeDirty();
1078 }
1079 ctx->dispatcher().glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data);
1080 }
1081
glCompressedTexImage3D(GLenum target,GLint level,GLenum internalformat,GLsizei width,GLsizei height,GLsizei depth,GLint border,GLsizei imageSize,const GLvoid * data)1082 GL_APICALL void GL_APIENTRY glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data) {
1083 GET_CTX_V2();
1084 ctx->dispatcher().glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data);
1085 if (ctx->shareGroup().get()) {
1086 TextureData *texData = getTextureTargetData(target);
1087
1088 if (texData) {
1089 texData->hasStorage = true;
1090 texData->compressed = true;
1091 texData->compressedFormat = internalformat;
1092 texData->makeDirty();
1093 }
1094 }
1095 }
1096
glCompressedTexSubImage3D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLsizei imageSize,const GLvoid * data)1097 GL_APICALL void GL_APIENTRY glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data) {
1098 GET_CTX_V2();
1099 TextureData* texData = getTextureTargetData(target);
1100 if (texData) {
1101 texData->makeDirty();
1102 }
1103 ctx->dispatcher().glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
1104 }
1105
glCopyTexSubImage3D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLint x,GLint y,GLsizei width,GLsizei height)1106 GL_APICALL void GL_APIENTRY glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
1107 GET_CTX_V2();
1108 TextureData* texData = getTextureTargetData(target);
1109 if (texData) {
1110 texData->makeDirty();
1111 }
1112 ctx->dispatcher().glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
1113 }
1114
glEnableiEXT(GLenum cap,GLuint index)1115 GL_APICALL void GL_APIENTRY glEnableiEXT(GLenum cap, GLuint index)
1116 {
1117 GET_CTX_V2();
1118 SET_ERROR_IF(!ctx->getCaps()->ext_GL_EXT_draw_buffers_indexed, GL_INVALID_OPERATION);
1119 ctx->setEnablei(cap, index, true);
1120 ctx->dispatcher().glEnableiEXT(cap, index);
1121 }
glDisableiEXT(GLenum cap,GLuint index)1122 GL_APICALL void GL_APIENTRY glDisableiEXT(GLenum cap, GLuint index)
1123 {
1124 GET_CTX_V2();
1125 SET_ERROR_IF(!ctx->getCaps()->ext_GL_EXT_draw_buffers_indexed, GL_INVALID_OPERATION);
1126 ctx->setEnablei(cap, index, false);
1127 ctx->dispatcher().glDisableiEXT(cap, index);
1128 }
1129
glBlendEquationiEXT(GLuint buf,GLenum mode)1130 GL_APICALL void GL_APIENTRY glBlendEquationiEXT(GLuint buf, GLenum mode)
1131 {
1132 GET_CTX_V2();
1133 SET_ERROR_IF(!ctx->getCaps()->ext_GL_EXT_draw_buffers_indexed, GL_INVALID_OPERATION);
1134 ctx->setBlendEquationSeparatei(buf, mode, mode);
1135 ctx->dispatcher().glBlendEquationiEXT(buf, mode);
1136 }
1137
glBlendEquationSeparateiEXT(GLuint buf,GLenum modeRGB,GLenum modeAlpha)1138 GL_APICALL void GL_APIENTRY glBlendEquationSeparateiEXT(GLuint buf, GLenum modeRGB, GLenum modeAlpha)
1139 {
1140 GET_CTX_V2();
1141 SET_ERROR_IF(!ctx->getCaps()->ext_GL_EXT_draw_buffers_indexed, GL_INVALID_OPERATION);
1142 ctx->setBlendEquationSeparatei(buf, modeRGB, modeAlpha);
1143 ctx->dispatcher().glBlendEquationSeparateiEXT(buf, modeRGB, modeAlpha);
1144 }
1145
glBlendFunciEXT(GLuint buf,GLenum sfactor,GLenum dfactor)1146 GL_APICALL void GL_APIENTRY glBlendFunciEXT(GLuint buf, GLenum sfactor, GLenum dfactor)
1147 {
1148 GET_CTX_V2();
1149 SET_ERROR_IF(!ctx->getCaps()->ext_GL_EXT_draw_buffers_indexed, GL_INVALID_OPERATION);
1150 ctx->setBlendFuncSeparatei(buf, sfactor, dfactor, sfactor, dfactor);
1151 ctx->dispatcher().glBlendFunciEXT(buf, sfactor, dfactor);
1152 }
1153
glBlendFuncSeparateiEXT(GLuint buf,GLenum srcRGB,GLenum dstRGB,GLenum srcAlpha,GLenum dstAlpha)1154 GL_APICALL void GL_APIENTRY glBlendFuncSeparateiEXT(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
1155 {
1156 GET_CTX_V2();
1157 SET_ERROR_IF(!ctx->getCaps()->ext_GL_EXT_draw_buffers_indexed, GL_INVALID_OPERATION);
1158 ctx->setBlendFuncSeparatei(buf, srcRGB, dstRGB, srcAlpha, dstAlpha);
1159 ctx->dispatcher().glBlendFuncSeparateiEXT(buf, srcRGB, dstRGB, srcAlpha, dstAlpha);
1160 }
1161
glColorMaskiEXT(GLuint buf,GLboolean red,GLboolean green,GLboolean blue,GLboolean alpha)1162 GL_APICALL void GL_APIENTRY glColorMaskiEXT(GLuint buf, GLboolean red, GLboolean green,
1163 GLboolean blue, GLboolean alpha)
1164 {
1165 GET_CTX_V2();
1166 SET_ERROR_IF(!ctx->getCaps()->ext_GL_EXT_draw_buffers_indexed, GL_INVALID_OPERATION);
1167 ctx->setColorMaski(buf, red, green, blue, alpha);
1168 ctx->dispatcher().glColorMaskiEXT(buf, red, green, blue, alpha);
1169 }
1170
glIsEnablediEXT(GLenum cap,GLuint index)1171 GL_APICALL GLboolean GL_APIENTRY glIsEnablediEXT(GLenum cap, GLuint index) {
1172 GET_CTX_RET(GL_FALSE);
1173 return ctx->dispatcher().glIsEnablediEXT(cap, index);
1174 }
1175
1176