1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by generate_entry_points.py using data from gl.xml.
3 //
4 // Copyright 2017 The ANGLE Project Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style license that can be
6 // found in the LICENSE file.
7 //
8 // entry_points_gles_3_0_autogen.cpp:
9 //   Defines the GLES 3.0 entry points.
10 
11 #include "libANGLE/Context.h"
12 #include "libANGLE/validationES3.h"
13 #include "libGLESv2/global_state.h"
14 
15 namespace gl
16 {
ReadBuffer(GLenum src)17 void GL_APIENTRY ReadBuffer(GLenum src)
18 {
19     EVENT("(GLenum src = 0x%X)", src);
20 
21     Context *context = GetValidGlobalContext();
22     if (context)
23     {
24         context->gatherParams<EntryPoint::ReadBuffer>(src);
25 
26         if (context->skipValidation() || ValidateReadBuffer(context, src))
27         {
28             context->readBuffer(src);
29         }
30     }
31 }
32 
DrawRangeElements(GLenum mode,GLuint start,GLuint end,GLsizei count,GLenum type,const void * indices)33 void GL_APIENTRY DrawRangeElements(GLenum mode,
34                                    GLuint start,
35                                    GLuint end,
36                                    GLsizei count,
37                                    GLenum type,
38                                    const void *indices)
39 {
40     EVENT(
41         "(GLenum mode = 0x%X, GLuint start = %u, GLuint end = %u, GLsizei count = %d, GLenum type "
42         "= 0x%X, const void *indices = 0x%0.8p)",
43         mode, start, end, count, type, indices);
44 
45     Context *context = GetValidGlobalContext();
46     if (context)
47     {
48         context->gatherParams<EntryPoint::DrawRangeElements>(mode, start, end, count, type,
49                                                              indices);
50 
51         if (context->skipValidation() ||
52             ValidateDrawRangeElements(context, mode, start, end, count, type, indices))
53         {
54             context->drawRangeElements(mode, start, end, count, type, indices);
55         }
56     }
57 }
58 
TexImage3D(GLenum target,GLint level,GLint internalformat,GLsizei width,GLsizei height,GLsizei depth,GLint border,GLenum format,GLenum type,const void * pixels)59 void GL_APIENTRY TexImage3D(GLenum target,
60                             GLint level,
61                             GLint internalformat,
62                             GLsizei width,
63                             GLsizei height,
64                             GLsizei depth,
65                             GLint border,
66                             GLenum format,
67                             GLenum type,
68                             const void *pixels)
69 {
70     EVENT(
71         "(GLenum target = 0x%X, GLint level = %d, GLint internalformat = %d, GLsizei width = %d, "
72         "GLsizei height = %d, GLsizei depth = %d, GLint border = %d, GLenum format = 0x%X, GLenum "
73         "type = 0x%X, const void *pixels = 0x%0.8p)",
74         target, level, internalformat, width, height, depth, border, format, type, pixels);
75 
76     Context *context = GetValidGlobalContext();
77     if (context)
78     {
79         context->gatherParams<EntryPoint::TexImage3D>(target, level, internalformat, width, height,
80                                                       depth, border, format, type, pixels);
81 
82         if (context->skipValidation() ||
83             ValidateTexImage3D(context, target, level, internalformat, width, height, depth, border,
84                                format, type, pixels))
85         {
86             context->texImage3D(target, level, internalformat, width, height, depth, border, format,
87                                 type, pixels);
88         }
89     }
90 }
91 
TexSubImage3D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLenum type,const void * pixels)92 void GL_APIENTRY TexSubImage3D(GLenum target,
93                                GLint level,
94                                GLint xoffset,
95                                GLint yoffset,
96                                GLint zoffset,
97                                GLsizei width,
98                                GLsizei height,
99                                GLsizei depth,
100                                GLenum format,
101                                GLenum type,
102                                const void *pixels)
103 {
104     EVENT(
105         "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
106         "zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, GLenum format "
107         "= 0x%X, GLenum type = 0x%X, const void *pixels = 0x%0.8p)",
108         target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
109 
110     Context *context = GetValidGlobalContext();
111     if (context)
112     {
113         context->gatherParams<EntryPoint::TexSubImage3D>(
114             target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
115 
116         if (context->skipValidation() ||
117             ValidateTexSubImage3D(context, target, level, xoffset, yoffset, zoffset, width, height,
118                                   depth, format, type, pixels))
119         {
120             context->texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth,
121                                    format, type, pixels);
122         }
123     }
124 }
125 
CopyTexSubImage3D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLint x,GLint y,GLsizei width,GLsizei height)126 void GL_APIENTRY CopyTexSubImage3D(GLenum target,
127                                    GLint level,
128                                    GLint xoffset,
129                                    GLint yoffset,
130                                    GLint zoffset,
131                                    GLint x,
132                                    GLint y,
133                                    GLsizei width,
134                                    GLsizei height)
135 {
136     EVENT(
137         "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
138         "zoffset = %d, GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d)",
139         target, level, xoffset, yoffset, zoffset, x, y, width, height);
140 
141     Context *context = GetValidGlobalContext();
142     if (context)
143     {
144         context->gatherParams<EntryPoint::CopyTexSubImage3D>(target, level, xoffset, yoffset,
145                                                              zoffset, x, y, width, height);
146 
147         if (context->skipValidation() ||
148             ValidateCopyTexSubImage3D(context, target, level, xoffset, yoffset, zoffset, x, y,
149                                       width, height))
150         {
151             context->copyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width,
152                                        height);
153         }
154     }
155 }
156 
CompressedTexImage3D(GLenum target,GLint level,GLenum internalformat,GLsizei width,GLsizei height,GLsizei depth,GLint border,GLsizei imageSize,const void * data)157 void GL_APIENTRY CompressedTexImage3D(GLenum target,
158                                       GLint level,
159                                       GLenum internalformat,
160                                       GLsizei width,
161                                       GLsizei height,
162                                       GLsizei depth,
163                                       GLint border,
164                                       GLsizei imageSize,
165                                       const void *data)
166 {
167     EVENT(
168         "(GLenum target = 0x%X, GLint level = %d, GLenum internalformat = 0x%X, GLsizei width = "
169         "%d, GLsizei height = %d, GLsizei depth = %d, GLint border = %d, GLsizei imageSize = %d, "
170         "const void *data = 0x%0.8p)",
171         target, level, internalformat, width, height, depth, border, imageSize, data);
172 
173     Context *context = GetValidGlobalContext();
174     if (context)
175     {
176         context->gatherParams<EntryPoint::CompressedTexImage3D>(
177             target, level, internalformat, width, height, depth, border, imageSize, data);
178 
179         if (context->skipValidation() ||
180             ValidateCompressedTexImage3D(context, target, level, internalformat, width, height,
181                                          depth, border, imageSize, data))
182         {
183             context->compressedTexImage3D(target, level, internalformat, width, height, depth,
184                                           border, imageSize, data);
185         }
186     }
187 }
188 
CompressedTexSubImage3D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLsizei imageSize,const void * data)189 void GL_APIENTRY CompressedTexSubImage3D(GLenum target,
190                                          GLint level,
191                                          GLint xoffset,
192                                          GLint yoffset,
193                                          GLint zoffset,
194                                          GLsizei width,
195                                          GLsizei height,
196                                          GLsizei depth,
197                                          GLenum format,
198                                          GLsizei imageSize,
199                                          const void *data)
200 {
201     EVENT(
202         "(GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
203         "zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, GLenum format "
204         "= 0x%X, GLsizei imageSize = %d, const void *data = 0x%0.8p)",
205         target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
206 
207     Context *context = GetValidGlobalContext();
208     if (context)
209     {
210         context->gatherParams<EntryPoint::CompressedTexSubImage3D>(target, level, xoffset, yoffset,
211                                                                    zoffset, width, height, depth,
212                                                                    format, imageSize, data);
213 
214         if (context->skipValidation() ||
215             ValidateCompressedTexSubImage3D(context, target, level, xoffset, yoffset, zoffset,
216                                             width, height, depth, format, imageSize, data))
217         {
218             context->compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width,
219                                              height, depth, format, imageSize, data);
220         }
221     }
222 }
223 
GenQueries(GLsizei n,GLuint * ids)224 void GL_APIENTRY GenQueries(GLsizei n, GLuint *ids)
225 {
226     EVENT("(GLsizei n = %d, GLuint *ids = 0x%0.8p)", n, ids);
227 
228     Context *context = GetValidGlobalContext();
229     if (context)
230     {
231         context->gatherParams<EntryPoint::GenQueries>(n, ids);
232 
233         if (context->skipValidation() || ValidateGenQueries(context, n, ids))
234         {
235             context->genQueries(n, ids);
236         }
237     }
238 }
239 
DeleteQueries(GLsizei n,const GLuint * ids)240 void GL_APIENTRY DeleteQueries(GLsizei n, const GLuint *ids)
241 {
242     EVENT("(GLsizei n = %d, const GLuint *ids = 0x%0.8p)", n, ids);
243 
244     Context *context = GetValidGlobalContext();
245     if (context)
246     {
247         context->gatherParams<EntryPoint::DeleteQueries>(n, ids);
248 
249         if (context->skipValidation() || ValidateDeleteQueries(context, n, ids))
250         {
251             context->deleteQueries(n, ids);
252         }
253     }
254 }
255 
IsQuery(GLuint id)256 GLboolean GL_APIENTRY IsQuery(GLuint id)
257 {
258     EVENT("(GLuint id = %u)", id);
259 
260     Context *context = GetValidGlobalContext();
261     if (context)
262     {
263         context->gatherParams<EntryPoint::IsQuery>(id);
264 
265         if (context->skipValidation() || ValidateIsQuery(context, id))
266         {
267             return context->isQuery(id);
268         }
269     }
270 
271     return GetDefaultReturnValue<EntryPoint::IsQuery, GLboolean>();
272 }
273 
BeginQuery(GLenum target,GLuint id)274 void GL_APIENTRY BeginQuery(GLenum target, GLuint id)
275 {
276     EVENT("(GLenum target = 0x%X, GLuint id = %u)", target, id);
277 
278     Context *context = GetValidGlobalContext();
279     if (context)
280     {
281         context->gatherParams<EntryPoint::BeginQuery>(target, id);
282 
283         if (context->skipValidation() || ValidateBeginQuery(context, target, id))
284         {
285             context->beginQuery(target, id);
286         }
287     }
288 }
289 
EndQuery(GLenum target)290 void GL_APIENTRY EndQuery(GLenum target)
291 {
292     EVENT("(GLenum target = 0x%X)", target);
293 
294     Context *context = GetValidGlobalContext();
295     if (context)
296     {
297         context->gatherParams<EntryPoint::EndQuery>(target);
298 
299         if (context->skipValidation() || ValidateEndQuery(context, target))
300         {
301             context->endQuery(target);
302         }
303     }
304 }
305 
GetQueryiv(GLenum target,GLenum pname,GLint * params)306 void GL_APIENTRY GetQueryiv(GLenum target, GLenum pname, GLint *params)
307 {
308     EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", target, pname,
309           params);
310 
311     Context *context = GetValidGlobalContext();
312     if (context)
313     {
314         context->gatherParams<EntryPoint::GetQueryiv>(target, pname, params);
315 
316         if (context->skipValidation() || ValidateGetQueryiv(context, target, pname, params))
317         {
318             context->getQueryiv(target, pname, params);
319         }
320     }
321 }
322 
GetQueryObjectuiv(GLuint id,GLenum pname,GLuint * params)323 void GL_APIENTRY GetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params)
324 {
325     EVENT("(GLuint id = %u, GLenum pname = 0x%X, GLuint *params = 0x%0.8p)", id, pname, params);
326 
327     Context *context = GetValidGlobalContext();
328     if (context)
329     {
330         context->gatherParams<EntryPoint::GetQueryObjectuiv>(id, pname, params);
331 
332         if (context->skipValidation() || ValidateGetQueryObjectuiv(context, id, pname, params))
333         {
334             context->getQueryObjectuiv(id, pname, params);
335         }
336     }
337 }
338 
UnmapBuffer(GLenum target)339 GLboolean GL_APIENTRY UnmapBuffer(GLenum target)
340 {
341     EVENT("(GLenum target = 0x%X)", target);
342 
343     Context *context = GetValidGlobalContext();
344     if (context)
345     {
346         BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
347         context->gatherParams<EntryPoint::UnmapBuffer>(targetPacked);
348 
349         if (context->skipValidation() || ValidateUnmapBuffer(context, targetPacked))
350         {
351             return context->unmapBuffer(targetPacked);
352         }
353     }
354 
355     return GetDefaultReturnValue<EntryPoint::UnmapBuffer, GLboolean>();
356 }
357 
GetBufferPointerv(GLenum target,GLenum pname,void ** params)358 void GL_APIENTRY GetBufferPointerv(GLenum target, GLenum pname, void **params)
359 {
360     EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, void **params = 0x%0.8p)", target, pname,
361           params);
362 
363     Context *context = GetValidGlobalContext();
364     if (context)
365     {
366         BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
367         context->gatherParams<EntryPoint::GetBufferPointerv>(targetPacked, pname, params);
368 
369         if (context->skipValidation() ||
370             ValidateGetBufferPointerv(context, targetPacked, pname, params))
371         {
372             context->getBufferPointerv(targetPacked, pname, params);
373         }
374     }
375 }
376 
DrawBuffers(GLsizei n,const GLenum * bufs)377 void GL_APIENTRY DrawBuffers(GLsizei n, const GLenum *bufs)
378 {
379     EVENT("(GLsizei n = %d, const GLenum *bufs = 0x%0.8p)", n, bufs);
380 
381     Context *context = GetValidGlobalContext();
382     if (context)
383     {
384         context->gatherParams<EntryPoint::DrawBuffers>(n, bufs);
385 
386         if (context->skipValidation() || ValidateDrawBuffers(context, n, bufs))
387         {
388             context->drawBuffers(n, bufs);
389         }
390     }
391 }
392 
UniformMatrix2x3fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)393 void GL_APIENTRY UniformMatrix2x3fv(GLint location,
394                                     GLsizei count,
395                                     GLboolean transpose,
396                                     const GLfloat *value)
397 {
398     EVENT(
399         "(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat *value "
400         "= 0x%0.8p)",
401         location, count, transpose, value);
402 
403     Context *context = GetValidGlobalContext();
404     if (context)
405     {
406         context->gatherParams<EntryPoint::UniformMatrix2x3fv>(location, count, transpose, value);
407 
408         if (context->skipValidation() ||
409             ValidateUniformMatrix2x3fv(context, location, count, transpose, value))
410         {
411             context->uniformMatrix2x3fv(location, count, transpose, value);
412         }
413     }
414 }
415 
UniformMatrix3x2fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)416 void GL_APIENTRY UniformMatrix3x2fv(GLint location,
417                                     GLsizei count,
418                                     GLboolean transpose,
419                                     const GLfloat *value)
420 {
421     EVENT(
422         "(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat *value "
423         "= 0x%0.8p)",
424         location, count, transpose, value);
425 
426     Context *context = GetValidGlobalContext();
427     if (context)
428     {
429         context->gatherParams<EntryPoint::UniformMatrix3x2fv>(location, count, transpose, value);
430 
431         if (context->skipValidation() ||
432             ValidateUniformMatrix3x2fv(context, location, count, transpose, value))
433         {
434             context->uniformMatrix3x2fv(location, count, transpose, value);
435         }
436     }
437 }
438 
UniformMatrix2x4fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)439 void GL_APIENTRY UniformMatrix2x4fv(GLint location,
440                                     GLsizei count,
441                                     GLboolean transpose,
442                                     const GLfloat *value)
443 {
444     EVENT(
445         "(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat *value "
446         "= 0x%0.8p)",
447         location, count, transpose, value);
448 
449     Context *context = GetValidGlobalContext();
450     if (context)
451     {
452         context->gatherParams<EntryPoint::UniformMatrix2x4fv>(location, count, transpose, value);
453 
454         if (context->skipValidation() ||
455             ValidateUniformMatrix2x4fv(context, location, count, transpose, value))
456         {
457             context->uniformMatrix2x4fv(location, count, transpose, value);
458         }
459     }
460 }
461 
UniformMatrix4x2fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)462 void GL_APIENTRY UniformMatrix4x2fv(GLint location,
463                                     GLsizei count,
464                                     GLboolean transpose,
465                                     const GLfloat *value)
466 {
467     EVENT(
468         "(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat *value "
469         "= 0x%0.8p)",
470         location, count, transpose, value);
471 
472     Context *context = GetValidGlobalContext();
473     if (context)
474     {
475         context->gatherParams<EntryPoint::UniformMatrix4x2fv>(location, count, transpose, value);
476 
477         if (context->skipValidation() ||
478             ValidateUniformMatrix4x2fv(context, location, count, transpose, value))
479         {
480             context->uniformMatrix4x2fv(location, count, transpose, value);
481         }
482     }
483 }
484 
UniformMatrix3x4fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)485 void GL_APIENTRY UniformMatrix3x4fv(GLint location,
486                                     GLsizei count,
487                                     GLboolean transpose,
488                                     const GLfloat *value)
489 {
490     EVENT(
491         "(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat *value "
492         "= 0x%0.8p)",
493         location, count, transpose, value);
494 
495     Context *context = GetValidGlobalContext();
496     if (context)
497     {
498         context->gatherParams<EntryPoint::UniformMatrix3x4fv>(location, count, transpose, value);
499 
500         if (context->skipValidation() ||
501             ValidateUniformMatrix3x4fv(context, location, count, transpose, value))
502         {
503             context->uniformMatrix3x4fv(location, count, transpose, value);
504         }
505     }
506 }
507 
UniformMatrix4x3fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)508 void GL_APIENTRY UniformMatrix4x3fv(GLint location,
509                                     GLsizei count,
510                                     GLboolean transpose,
511                                     const GLfloat *value)
512 {
513     EVENT(
514         "(GLint location = %d, GLsizei count = %d, GLboolean transpose = %u, const GLfloat *value "
515         "= 0x%0.8p)",
516         location, count, transpose, value);
517 
518     Context *context = GetValidGlobalContext();
519     if (context)
520     {
521         context->gatherParams<EntryPoint::UniformMatrix4x3fv>(location, count, transpose, value);
522 
523         if (context->skipValidation() ||
524             ValidateUniformMatrix4x3fv(context, location, count, transpose, value))
525         {
526             context->uniformMatrix4x3fv(location, count, transpose, value);
527         }
528     }
529 }
530 
BlitFramebuffer(GLint srcX0,GLint srcY0,GLint srcX1,GLint srcY1,GLint dstX0,GLint dstY0,GLint dstX1,GLint dstY1,GLbitfield mask,GLenum filter)531 void GL_APIENTRY BlitFramebuffer(GLint srcX0,
532                                  GLint srcY0,
533                                  GLint srcX1,
534                                  GLint srcY1,
535                                  GLint dstX0,
536                                  GLint dstY0,
537                                  GLint dstX1,
538                                  GLint dstY1,
539                                  GLbitfield mask,
540                                  GLenum filter)
541 {
542     EVENT(
543         "(GLint srcX0 = %d, GLint srcY0 = %d, GLint srcX1 = %d, GLint srcY1 = %d, GLint dstX0 = "
544         "%d, GLint dstY0 = %d, GLint dstX1 = %d, GLint dstY1 = %d, GLbitfield mask = 0x%X, GLenum "
545         "filter = 0x%X)",
546         srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
547 
548     Context *context = GetValidGlobalContext();
549     if (context)
550     {
551         context->gatherParams<EntryPoint::BlitFramebuffer>(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0,
552                                                            dstX1, dstY1, mask, filter);
553 
554         if (context->skipValidation() ||
555             ValidateBlitFramebuffer(context, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1,
556                                     mask, filter))
557         {
558             context->blitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask,
559                                      filter);
560         }
561     }
562 }
563 
RenderbufferStorageMultisample(GLenum target,GLsizei samples,GLenum internalformat,GLsizei width,GLsizei height)564 void GL_APIENTRY RenderbufferStorageMultisample(GLenum target,
565                                                 GLsizei samples,
566                                                 GLenum internalformat,
567                                                 GLsizei width,
568                                                 GLsizei height)
569 {
570     EVENT(
571         "(GLenum target = 0x%X, GLsizei samples = %d, GLenum internalformat = 0x%X, GLsizei width "
572         "= %d, GLsizei height = %d)",
573         target, samples, internalformat, width, height);
574 
575     Context *context = GetValidGlobalContext();
576     if (context)
577     {
578         context->gatherParams<EntryPoint::RenderbufferStorageMultisample>(
579             target, samples, internalformat, width, height);
580 
581         if (context->skipValidation() ||
582             ValidateRenderbufferStorageMultisample(context, target, samples, internalformat, width,
583                                                    height))
584         {
585             context->renderbufferStorageMultisample(target, samples, internalformat, width, height);
586         }
587     }
588 }
589 
590 void GL_APIENTRY
FramebufferTextureLayer(GLenum target,GLenum attachment,GLuint texture,GLint level,GLint layer)591 FramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
592 {
593     EVENT(
594         "(GLenum target = 0x%X, GLenum attachment = 0x%X, GLuint texture = %u, GLint level = %d, "
595         "GLint layer = %d)",
596         target, attachment, texture, level, layer);
597 
598     Context *context = GetValidGlobalContext();
599     if (context)
600     {
601         context->gatherParams<EntryPoint::FramebufferTextureLayer>(target, attachment, texture,
602                                                                    level, layer);
603 
604         if (context->skipValidation() ||
605             ValidateFramebufferTextureLayer(context, target, attachment, texture, level, layer))
606         {
607             context->framebufferTextureLayer(target, attachment, texture, level, layer);
608         }
609     }
610 }
611 
MapBufferRange(GLenum target,GLintptr offset,GLsizeiptr length,GLbitfield access)612 void *GL_APIENTRY MapBufferRange(GLenum target,
613                                  GLintptr offset,
614                                  GLsizeiptr length,
615                                  GLbitfield access)
616 {
617     EVENT(
618         "(GLenum target = 0x%X, GLintptr offset = %d, GLsizeiptr length = %d, GLbitfield access = "
619         "0x%X)",
620         target, offset, length, access);
621 
622     Context *context = GetValidGlobalContext();
623     if (context)
624     {
625         BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
626         context->gatherParams<EntryPoint::MapBufferRange>(targetPacked, offset, length, access);
627 
628         if (context->skipValidation() ||
629             ValidateMapBufferRange(context, targetPacked, offset, length, access))
630         {
631             return context->mapBufferRange(targetPacked, offset, length, access);
632         }
633     }
634 
635     return GetDefaultReturnValue<EntryPoint::MapBufferRange, void *>();
636 }
637 
FlushMappedBufferRange(GLenum target,GLintptr offset,GLsizeiptr length)638 void GL_APIENTRY FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
639 {
640     EVENT("(GLenum target = 0x%X, GLintptr offset = %d, GLsizeiptr length = %d)", target, offset,
641           length);
642 
643     Context *context = GetValidGlobalContext();
644     if (context)
645     {
646         BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
647         context->gatherParams<EntryPoint::FlushMappedBufferRange>(targetPacked, offset, length);
648 
649         if (context->skipValidation() ||
650             ValidateFlushMappedBufferRange(context, targetPacked, offset, length))
651         {
652             context->flushMappedBufferRange(targetPacked, offset, length);
653         }
654     }
655 }
656 
BindVertexArray(GLuint array)657 void GL_APIENTRY BindVertexArray(GLuint array)
658 {
659     EVENT("(GLuint array = %u)", array);
660 
661     Context *context = GetValidGlobalContext();
662     if (context)
663     {
664         context->gatherParams<EntryPoint::BindVertexArray>(array);
665 
666         if (context->skipValidation() || ValidateBindVertexArray(context, array))
667         {
668             context->bindVertexArray(array);
669         }
670     }
671 }
672 
DeleteVertexArrays(GLsizei n,const GLuint * arrays)673 void GL_APIENTRY DeleteVertexArrays(GLsizei n, const GLuint *arrays)
674 {
675     EVENT("(GLsizei n = %d, const GLuint *arrays = 0x%0.8p)", n, arrays);
676 
677     Context *context = GetValidGlobalContext();
678     if (context)
679     {
680         context->gatherParams<EntryPoint::DeleteVertexArrays>(n, arrays);
681 
682         if (context->skipValidation() || ValidateDeleteVertexArrays(context, n, arrays))
683         {
684             context->deleteVertexArrays(n, arrays);
685         }
686     }
687 }
688 
GenVertexArrays(GLsizei n,GLuint * arrays)689 void GL_APIENTRY GenVertexArrays(GLsizei n, GLuint *arrays)
690 {
691     EVENT("(GLsizei n = %d, GLuint *arrays = 0x%0.8p)", n, arrays);
692 
693     Context *context = GetValidGlobalContext();
694     if (context)
695     {
696         context->gatherParams<EntryPoint::GenVertexArrays>(n, arrays);
697 
698         if (context->skipValidation() || ValidateGenVertexArrays(context, n, arrays))
699         {
700             context->genVertexArrays(n, arrays);
701         }
702     }
703 }
704 
IsVertexArray(GLuint array)705 GLboolean GL_APIENTRY IsVertexArray(GLuint array)
706 {
707     EVENT("(GLuint array = %u)", array);
708 
709     Context *context = GetValidGlobalContext();
710     if (context)
711     {
712         context->gatherParams<EntryPoint::IsVertexArray>(array);
713 
714         if (context->skipValidation() || ValidateIsVertexArray(context, array))
715         {
716             return context->isVertexArray(array);
717         }
718     }
719 
720     return GetDefaultReturnValue<EntryPoint::IsVertexArray, GLboolean>();
721 }
722 
GetIntegeri_v(GLenum target,GLuint index,GLint * data)723 void GL_APIENTRY GetIntegeri_v(GLenum target, GLuint index, GLint *data)
724 {
725     EVENT("(GLenum target = 0x%X, GLuint index = %u, GLint *data = 0x%0.8p)", target, index, data);
726 
727     Context *context = GetValidGlobalContext();
728     if (context)
729     {
730         context->gatherParams<EntryPoint::GetIntegeri_v>(target, index, data);
731 
732         if (context->skipValidation() || ValidateGetIntegeri_v(context, target, index, data))
733         {
734             context->getIntegeri_v(target, index, data);
735         }
736     }
737 }
738 
BeginTransformFeedback(GLenum primitiveMode)739 void GL_APIENTRY BeginTransformFeedback(GLenum primitiveMode)
740 {
741     EVENT("(GLenum primitiveMode = 0x%X)", primitiveMode);
742 
743     Context *context = GetValidGlobalContext();
744     if (context)
745     {
746         context->gatherParams<EntryPoint::BeginTransformFeedback>(primitiveMode);
747 
748         if (context->skipValidation() || ValidateBeginTransformFeedback(context, primitiveMode))
749         {
750             context->beginTransformFeedback(primitiveMode);
751         }
752     }
753 }
754 
EndTransformFeedback()755 void GL_APIENTRY EndTransformFeedback()
756 {
757     EVENT("()");
758 
759     Context *context = GetValidGlobalContext();
760     if (context)
761     {
762         context->gatherParams<EntryPoint::EndTransformFeedback>();
763 
764         if (context->skipValidation() || ValidateEndTransformFeedback(context))
765         {
766             context->endTransformFeedback();
767         }
768     }
769 }
770 
771 void GL_APIENTRY
BindBufferRange(GLenum target,GLuint index,GLuint buffer,GLintptr offset,GLsizeiptr size)772 BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
773 {
774     EVENT(
775         "(GLenum target = 0x%X, GLuint index = %u, GLuint buffer = %u, GLintptr offset = %d, "
776         "GLsizeiptr size = %d)",
777         target, index, buffer, offset, size);
778 
779     Context *context = GetValidGlobalContext();
780     if (context)
781     {
782         BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
783         context->gatherParams<EntryPoint::BindBufferRange>(targetPacked, index, buffer, offset,
784                                                            size);
785 
786         if (context->skipValidation() ||
787             ValidateBindBufferRange(context, targetPacked, index, buffer, offset, size))
788         {
789             context->bindBufferRange(targetPacked, index, buffer, offset, size);
790         }
791     }
792 }
793 
BindBufferBase(GLenum target,GLuint index,GLuint buffer)794 void GL_APIENTRY BindBufferBase(GLenum target, GLuint index, GLuint buffer)
795 {
796     EVENT("(GLenum target = 0x%X, GLuint index = %u, GLuint buffer = %u)", target, index, buffer);
797 
798     Context *context = GetValidGlobalContext();
799     if (context)
800     {
801         BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
802         context->gatherParams<EntryPoint::BindBufferBase>(targetPacked, index, buffer);
803 
804         if (context->skipValidation() ||
805             ValidateBindBufferBase(context, targetPacked, index, buffer))
806         {
807             context->bindBufferBase(targetPacked, index, buffer);
808         }
809     }
810 }
811 
TransformFeedbackVaryings(GLuint program,GLsizei count,const GLchar * const * varyings,GLenum bufferMode)812 void GL_APIENTRY TransformFeedbackVaryings(GLuint program,
813                                            GLsizei count,
814                                            const GLchar *const *varyings,
815                                            GLenum bufferMode)
816 {
817     EVENT(
818         "(GLuint program = %u, GLsizei count = %d, const GLchar *const*varyings = 0x%0.8p, GLenum "
819         "bufferMode = 0x%X)",
820         program, count, varyings, bufferMode);
821 
822     Context *context = GetValidGlobalContext();
823     if (context)
824     {
825         context->gatherParams<EntryPoint::TransformFeedbackVaryings>(program, count, varyings,
826                                                                      bufferMode);
827 
828         if (context->skipValidation() ||
829             ValidateTransformFeedbackVaryings(context, program, count, varyings, bufferMode))
830         {
831             context->transformFeedbackVaryings(program, count, varyings, bufferMode);
832         }
833     }
834 }
835 
GetTransformFeedbackVarying(GLuint program,GLuint index,GLsizei bufSize,GLsizei * length,GLsizei * size,GLenum * type,GLchar * name)836 void GL_APIENTRY GetTransformFeedbackVarying(GLuint program,
837                                              GLuint index,
838                                              GLsizei bufSize,
839                                              GLsizei *length,
840                                              GLsizei *size,
841                                              GLenum *type,
842                                              GLchar *name)
843 {
844     EVENT(
845         "(GLuint program = %u, GLuint index = %u, GLsizei bufSize = %d, GLsizei *length = 0x%0.8p, "
846         "GLsizei *size = 0x%0.8p, GLenum *type = 0x%0.8p, GLchar *name = 0x%0.8p)",
847         program, index, bufSize, length, size, type, name);
848 
849     Context *context = GetValidGlobalContext();
850     if (context)
851     {
852         context->gatherParams<EntryPoint::GetTransformFeedbackVarying>(program, index, bufSize,
853                                                                        length, size, type, name);
854 
855         if (context->skipValidation() ||
856             ValidateGetTransformFeedbackVarying(context, program, index, bufSize, length, size,
857                                                 type, name))
858         {
859             context->getTransformFeedbackVarying(program, index, bufSize, length, size, type, name);
860         }
861     }
862 }
863 
864 void GL_APIENTRY
VertexAttribIPointer(GLuint index,GLint size,GLenum type,GLsizei stride,const void * pointer)865 VertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer)
866 {
867     EVENT(
868         "(GLuint index = %u, GLint size = %d, GLenum type = 0x%X, GLsizei stride = %d, const void "
869         "*pointer = 0x%0.8p)",
870         index, size, type, stride, pointer);
871 
872     Context *context = GetValidGlobalContext();
873     if (context)
874     {
875         context->gatherParams<EntryPoint::VertexAttribIPointer>(index, size, type, stride, pointer);
876 
877         if (context->skipValidation() ||
878             ValidateVertexAttribIPointer(context, index, size, type, stride, pointer))
879         {
880             context->vertexAttribIPointer(index, size, type, stride, pointer);
881         }
882     }
883 }
884 
GetVertexAttribIiv(GLuint index,GLenum pname,GLint * params)885 void GL_APIENTRY GetVertexAttribIiv(GLuint index, GLenum pname, GLint *params)
886 {
887     EVENT("(GLuint index = %u, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", index, pname,
888           params);
889 
890     Context *context = GetValidGlobalContext();
891     if (context)
892     {
893         context->gatherParams<EntryPoint::GetVertexAttribIiv>(index, pname, params);
894 
895         if (context->skipValidation() || ValidateGetVertexAttribIiv(context, index, pname, params))
896         {
897             context->getVertexAttribIiv(index, pname, params);
898         }
899     }
900 }
901 
GetVertexAttribIuiv(GLuint index,GLenum pname,GLuint * params)902 void GL_APIENTRY GetVertexAttribIuiv(GLuint index, GLenum pname, GLuint *params)
903 {
904     EVENT("(GLuint index = %u, GLenum pname = 0x%X, GLuint *params = 0x%0.8p)", index, pname,
905           params);
906 
907     Context *context = GetValidGlobalContext();
908     if (context)
909     {
910         context->gatherParams<EntryPoint::GetVertexAttribIuiv>(index, pname, params);
911 
912         if (context->skipValidation() || ValidateGetVertexAttribIuiv(context, index, pname, params))
913         {
914             context->getVertexAttribIuiv(index, pname, params);
915         }
916     }
917 }
918 
VertexAttribI4i(GLuint index,GLint x,GLint y,GLint z,GLint w)919 void GL_APIENTRY VertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w)
920 {
921     EVENT("(GLuint index = %u, GLint x = %d, GLint y = %d, GLint z = %d, GLint w = %d)", index, x,
922           y, z, w);
923 
924     Context *context = GetValidGlobalContext();
925     if (context)
926     {
927         context->gatherParams<EntryPoint::VertexAttribI4i>(index, x, y, z, w);
928 
929         if (context->skipValidation() || ValidateVertexAttribI4i(context, index, x, y, z, w))
930         {
931             context->vertexAttribI4i(index, x, y, z, w);
932         }
933     }
934 }
935 
VertexAttribI4ui(GLuint index,GLuint x,GLuint y,GLuint z,GLuint w)936 void GL_APIENTRY VertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
937 {
938     EVENT("(GLuint index = %u, GLuint x = %u, GLuint y = %u, GLuint z = %u, GLuint w = %u)", index,
939           x, y, z, w);
940 
941     Context *context = GetValidGlobalContext();
942     if (context)
943     {
944         context->gatherParams<EntryPoint::VertexAttribI4ui>(index, x, y, z, w);
945 
946         if (context->skipValidation() || ValidateVertexAttribI4ui(context, index, x, y, z, w))
947         {
948             context->vertexAttribI4ui(index, x, y, z, w);
949         }
950     }
951 }
952 
VertexAttribI4iv(GLuint index,const GLint * v)953 void GL_APIENTRY VertexAttribI4iv(GLuint index, const GLint *v)
954 {
955     EVENT("(GLuint index = %u, const GLint *v = 0x%0.8p)", index, v);
956 
957     Context *context = GetValidGlobalContext();
958     if (context)
959     {
960         context->gatherParams<EntryPoint::VertexAttribI4iv>(index, v);
961 
962         if (context->skipValidation() || ValidateVertexAttribI4iv(context, index, v))
963         {
964             context->vertexAttribI4iv(index, v);
965         }
966     }
967 }
968 
VertexAttribI4uiv(GLuint index,const GLuint * v)969 void GL_APIENTRY VertexAttribI4uiv(GLuint index, const GLuint *v)
970 {
971     EVENT("(GLuint index = %u, const GLuint *v = 0x%0.8p)", index, v);
972 
973     Context *context = GetValidGlobalContext();
974     if (context)
975     {
976         context->gatherParams<EntryPoint::VertexAttribI4uiv>(index, v);
977 
978         if (context->skipValidation() || ValidateVertexAttribI4uiv(context, index, v))
979         {
980             context->vertexAttribI4uiv(index, v);
981         }
982     }
983 }
984 
GetUniformuiv(GLuint program,GLint location,GLuint * params)985 void GL_APIENTRY GetUniformuiv(GLuint program, GLint location, GLuint *params)
986 {
987     EVENT("(GLuint program = %u, GLint location = %d, GLuint *params = 0x%0.8p)", program, location,
988           params);
989 
990     Context *context = GetValidGlobalContext();
991     if (context)
992     {
993         context->gatherParams<EntryPoint::GetUniformuiv>(program, location, params);
994 
995         if (context->skipValidation() || ValidateGetUniformuiv(context, program, location, params))
996         {
997             context->getUniformuiv(program, location, params);
998         }
999     }
1000 }
1001 
GetFragDataLocation(GLuint program,const GLchar * name)1002 GLint GL_APIENTRY GetFragDataLocation(GLuint program, const GLchar *name)
1003 {
1004     EVENT("(GLuint program = %u, const GLchar *name = 0x%0.8p)", program, name);
1005 
1006     Context *context = GetValidGlobalContext();
1007     if (context)
1008     {
1009         context->gatherParams<EntryPoint::GetFragDataLocation>(program, name);
1010 
1011         if (context->skipValidation() || ValidateGetFragDataLocation(context, program, name))
1012         {
1013             return context->getFragDataLocation(program, name);
1014         }
1015     }
1016 
1017     return GetDefaultReturnValue<EntryPoint::GetFragDataLocation, GLint>();
1018 }
1019 
Uniform1ui(GLint location,GLuint v0)1020 void GL_APIENTRY Uniform1ui(GLint location, GLuint v0)
1021 {
1022     EVENT("(GLint location = %d, GLuint v0 = %u)", location, v0);
1023 
1024     Context *context = GetValidGlobalContext();
1025     if (context)
1026     {
1027         context->gatherParams<EntryPoint::Uniform1ui>(location, v0);
1028 
1029         if (context->skipValidation() || ValidateUniform1ui(context, location, v0))
1030         {
1031             context->uniform1ui(location, v0);
1032         }
1033     }
1034 }
1035 
Uniform2ui(GLint location,GLuint v0,GLuint v1)1036 void GL_APIENTRY Uniform2ui(GLint location, GLuint v0, GLuint v1)
1037 {
1038     EVENT("(GLint location = %d, GLuint v0 = %u, GLuint v1 = %u)", location, v0, v1);
1039 
1040     Context *context = GetValidGlobalContext();
1041     if (context)
1042     {
1043         context->gatherParams<EntryPoint::Uniform2ui>(location, v0, v1);
1044 
1045         if (context->skipValidation() || ValidateUniform2ui(context, location, v0, v1))
1046         {
1047             context->uniform2ui(location, v0, v1);
1048         }
1049     }
1050 }
1051 
Uniform3ui(GLint location,GLuint v0,GLuint v1,GLuint v2)1052 void GL_APIENTRY Uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
1053 {
1054     EVENT("(GLint location = %d, GLuint v0 = %u, GLuint v1 = %u, GLuint v2 = %u)", location, v0, v1,
1055           v2);
1056 
1057     Context *context = GetValidGlobalContext();
1058     if (context)
1059     {
1060         context->gatherParams<EntryPoint::Uniform3ui>(location, v0, v1, v2);
1061 
1062         if (context->skipValidation() || ValidateUniform3ui(context, location, v0, v1, v2))
1063         {
1064             context->uniform3ui(location, v0, v1, v2);
1065         }
1066     }
1067 }
1068 
Uniform4ui(GLint location,GLuint v0,GLuint v1,GLuint v2,GLuint v3)1069 void GL_APIENTRY Uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
1070 {
1071     EVENT("(GLint location = %d, GLuint v0 = %u, GLuint v1 = %u, GLuint v2 = %u, GLuint v3 = %u)",
1072           location, v0, v1, v2, v3);
1073 
1074     Context *context = GetValidGlobalContext();
1075     if (context)
1076     {
1077         context->gatherParams<EntryPoint::Uniform4ui>(location, v0, v1, v2, v3);
1078 
1079         if (context->skipValidation() || ValidateUniform4ui(context, location, v0, v1, v2, v3))
1080         {
1081             context->uniform4ui(location, v0, v1, v2, v3);
1082         }
1083     }
1084 }
1085 
Uniform1uiv(GLint location,GLsizei count,const GLuint * value)1086 void GL_APIENTRY Uniform1uiv(GLint location, GLsizei count, const GLuint *value)
1087 {
1088     EVENT("(GLint location = %d, GLsizei count = %d, const GLuint *value = 0x%0.8p)", location,
1089           count, value);
1090 
1091     Context *context = GetValidGlobalContext();
1092     if (context)
1093     {
1094         context->gatherParams<EntryPoint::Uniform1uiv>(location, count, value);
1095 
1096         if (context->skipValidation() || ValidateUniform1uiv(context, location, count, value))
1097         {
1098             context->uniform1uiv(location, count, value);
1099         }
1100     }
1101 }
1102 
Uniform2uiv(GLint location,GLsizei count,const GLuint * value)1103 void GL_APIENTRY Uniform2uiv(GLint location, GLsizei count, const GLuint *value)
1104 {
1105     EVENT("(GLint location = %d, GLsizei count = %d, const GLuint *value = 0x%0.8p)", location,
1106           count, value);
1107 
1108     Context *context = GetValidGlobalContext();
1109     if (context)
1110     {
1111         context->gatherParams<EntryPoint::Uniform2uiv>(location, count, value);
1112 
1113         if (context->skipValidation() || ValidateUniform2uiv(context, location, count, value))
1114         {
1115             context->uniform2uiv(location, count, value);
1116         }
1117     }
1118 }
1119 
Uniform3uiv(GLint location,GLsizei count,const GLuint * value)1120 void GL_APIENTRY Uniform3uiv(GLint location, GLsizei count, const GLuint *value)
1121 {
1122     EVENT("(GLint location = %d, GLsizei count = %d, const GLuint *value = 0x%0.8p)", location,
1123           count, value);
1124 
1125     Context *context = GetValidGlobalContext();
1126     if (context)
1127     {
1128         context->gatherParams<EntryPoint::Uniform3uiv>(location, count, value);
1129 
1130         if (context->skipValidation() || ValidateUniform3uiv(context, location, count, value))
1131         {
1132             context->uniform3uiv(location, count, value);
1133         }
1134     }
1135 }
1136 
Uniform4uiv(GLint location,GLsizei count,const GLuint * value)1137 void GL_APIENTRY Uniform4uiv(GLint location, GLsizei count, const GLuint *value)
1138 {
1139     EVENT("(GLint location = %d, GLsizei count = %d, const GLuint *value = 0x%0.8p)", location,
1140           count, value);
1141 
1142     Context *context = GetValidGlobalContext();
1143     if (context)
1144     {
1145         context->gatherParams<EntryPoint::Uniform4uiv>(location, count, value);
1146 
1147         if (context->skipValidation() || ValidateUniform4uiv(context, location, count, value))
1148         {
1149             context->uniform4uiv(location, count, value);
1150         }
1151     }
1152 }
1153 
ClearBufferiv(GLenum buffer,GLint drawbuffer,const GLint * value)1154 void GL_APIENTRY ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value)
1155 {
1156     EVENT("(GLenum buffer = 0x%X, GLint drawbuffer = %d, const GLint *value = 0x%0.8p)", buffer,
1157           drawbuffer, value);
1158 
1159     Context *context = GetValidGlobalContext();
1160     if (context)
1161     {
1162         context->gatherParams<EntryPoint::ClearBufferiv>(buffer, drawbuffer, value);
1163 
1164         if (context->skipValidation() || ValidateClearBufferiv(context, buffer, drawbuffer, value))
1165         {
1166             context->clearBufferiv(buffer, drawbuffer, value);
1167         }
1168     }
1169 }
1170 
ClearBufferuiv(GLenum buffer,GLint drawbuffer,const GLuint * value)1171 void GL_APIENTRY ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value)
1172 {
1173     EVENT("(GLenum buffer = 0x%X, GLint drawbuffer = %d, const GLuint *value = 0x%0.8p)", buffer,
1174           drawbuffer, value);
1175 
1176     Context *context = GetValidGlobalContext();
1177     if (context)
1178     {
1179         context->gatherParams<EntryPoint::ClearBufferuiv>(buffer, drawbuffer, value);
1180 
1181         if (context->skipValidation() || ValidateClearBufferuiv(context, buffer, drawbuffer, value))
1182         {
1183             context->clearBufferuiv(buffer, drawbuffer, value);
1184         }
1185     }
1186 }
1187 
ClearBufferfv(GLenum buffer,GLint drawbuffer,const GLfloat * value)1188 void GL_APIENTRY ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value)
1189 {
1190     EVENT("(GLenum buffer = 0x%X, GLint drawbuffer = %d, const GLfloat *value = 0x%0.8p)", buffer,
1191           drawbuffer, value);
1192 
1193     Context *context = GetValidGlobalContext();
1194     if (context)
1195     {
1196         context->gatherParams<EntryPoint::ClearBufferfv>(buffer, drawbuffer, value);
1197 
1198         if (context->skipValidation() || ValidateClearBufferfv(context, buffer, drawbuffer, value))
1199         {
1200             context->clearBufferfv(buffer, drawbuffer, value);
1201         }
1202     }
1203 }
1204 
ClearBufferfi(GLenum buffer,GLint drawbuffer,GLfloat depth,GLint stencil)1205 void GL_APIENTRY ClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
1206 {
1207     EVENT("(GLenum buffer = 0x%X, GLint drawbuffer = %d, GLfloat depth = %f, GLint stencil = %d)",
1208           buffer, drawbuffer, depth, stencil);
1209 
1210     Context *context = GetValidGlobalContext();
1211     if (context)
1212     {
1213         context->gatherParams<EntryPoint::ClearBufferfi>(buffer, drawbuffer, depth, stencil);
1214 
1215         if (context->skipValidation() ||
1216             ValidateClearBufferfi(context, buffer, drawbuffer, depth, stencil))
1217         {
1218             context->clearBufferfi(buffer, drawbuffer, depth, stencil);
1219         }
1220     }
1221 }
1222 
GetStringi(GLenum name,GLuint index)1223 const GLubyte *GL_APIENTRY GetStringi(GLenum name, GLuint index)
1224 {
1225     EVENT("(GLenum name = 0x%X, GLuint index = %u)", name, index);
1226 
1227     Context *context = GetValidGlobalContext();
1228     if (context)
1229     {
1230         context->gatherParams<EntryPoint::GetStringi>(name, index);
1231 
1232         if (context->skipValidation() || ValidateGetStringi(context, name, index))
1233         {
1234             return context->getStringi(name, index);
1235         }
1236     }
1237 
1238     return GetDefaultReturnValue<EntryPoint::GetStringi, const GLubyte *>();
1239 }
1240 
CopyBufferSubData(GLenum readTarget,GLenum writeTarget,GLintptr readOffset,GLintptr writeOffset,GLsizeiptr size)1241 void GL_APIENTRY CopyBufferSubData(GLenum readTarget,
1242                                    GLenum writeTarget,
1243                                    GLintptr readOffset,
1244                                    GLintptr writeOffset,
1245                                    GLsizeiptr size)
1246 {
1247     EVENT(
1248         "(GLenum readTarget = 0x%X, GLenum writeTarget = 0x%X, GLintptr readOffset = %d, GLintptr "
1249         "writeOffset = %d, GLsizeiptr size = %d)",
1250         readTarget, writeTarget, readOffset, writeOffset, size);
1251 
1252     Context *context = GetValidGlobalContext();
1253     if (context)
1254     {
1255         BufferBinding readTargetPacked  = FromGLenum<BufferBinding>(readTarget);
1256         BufferBinding writeTargetPacked = FromGLenum<BufferBinding>(writeTarget);
1257         context->gatherParams<EntryPoint::CopyBufferSubData>(readTargetPacked, writeTargetPacked,
1258                                                              readOffset, writeOffset, size);
1259 
1260         if (context->skipValidation() ||
1261             ValidateCopyBufferSubData(context, readTargetPacked, writeTargetPacked, readOffset,
1262                                       writeOffset, size))
1263         {
1264             context->copyBufferSubData(readTargetPacked, writeTargetPacked, readOffset, writeOffset,
1265                                        size);
1266         }
1267     }
1268 }
1269 
GetUniformIndices(GLuint program,GLsizei uniformCount,const GLchar * const * uniformNames,GLuint * uniformIndices)1270 void GL_APIENTRY GetUniformIndices(GLuint program,
1271                                    GLsizei uniformCount,
1272                                    const GLchar *const *uniformNames,
1273                                    GLuint *uniformIndices)
1274 {
1275     EVENT(
1276         "(GLuint program = %u, GLsizei uniformCount = %d, const GLchar *const*uniformNames = "
1277         "0x%0.8p, GLuint *uniformIndices = 0x%0.8p)",
1278         program, uniformCount, uniformNames, uniformIndices);
1279 
1280     Context *context = GetValidGlobalContext();
1281     if (context)
1282     {
1283         context->gatherParams<EntryPoint::GetUniformIndices>(program, uniformCount, uniformNames,
1284                                                              uniformIndices);
1285 
1286         if (context->skipValidation() ||
1287             ValidateGetUniformIndices(context, program, uniformCount, uniformNames, uniformIndices))
1288         {
1289             context->getUniformIndices(program, uniformCount, uniformNames, uniformIndices);
1290         }
1291     }
1292 }
1293 
GetActiveUniformsiv(GLuint program,GLsizei uniformCount,const GLuint * uniformIndices,GLenum pname,GLint * params)1294 void GL_APIENTRY GetActiveUniformsiv(GLuint program,
1295                                      GLsizei uniformCount,
1296                                      const GLuint *uniformIndices,
1297                                      GLenum pname,
1298                                      GLint *params)
1299 {
1300     EVENT(
1301         "(GLuint program = %u, GLsizei uniformCount = %d, const GLuint *uniformIndices = 0x%0.8p, "
1302         "GLenum pname = 0x%X, GLint *params = 0x%0.8p)",
1303         program, uniformCount, uniformIndices, pname, params);
1304 
1305     Context *context = GetValidGlobalContext();
1306     if (context)
1307     {
1308         context->gatherParams<EntryPoint::GetActiveUniformsiv>(program, uniformCount,
1309                                                                uniformIndices, pname, params);
1310 
1311         if (context->skipValidation() || ValidateGetActiveUniformsiv(context, program, uniformCount,
1312                                                                      uniformIndices, pname, params))
1313         {
1314             context->getActiveUniformsiv(program, uniformCount, uniformIndices, pname, params);
1315         }
1316     }
1317 }
1318 
GetUniformBlockIndex(GLuint program,const GLchar * uniformBlockName)1319 GLuint GL_APIENTRY GetUniformBlockIndex(GLuint program, const GLchar *uniformBlockName)
1320 {
1321     EVENT("(GLuint program = %u, const GLchar *uniformBlockName = 0x%0.8p)", program,
1322           uniformBlockName);
1323 
1324     Context *context = GetValidGlobalContext();
1325     if (context)
1326     {
1327         context->gatherParams<EntryPoint::GetUniformBlockIndex>(program, uniformBlockName);
1328 
1329         if (context->skipValidation() ||
1330             ValidateGetUniformBlockIndex(context, program, uniformBlockName))
1331         {
1332             return context->getUniformBlockIndex(program, uniformBlockName);
1333         }
1334     }
1335 
1336     return GetDefaultReturnValue<EntryPoint::GetUniformBlockIndex, GLuint>();
1337 }
1338 
GetActiveUniformBlockiv(GLuint program,GLuint uniformBlockIndex,GLenum pname,GLint * params)1339 void GL_APIENTRY GetActiveUniformBlockiv(GLuint program,
1340                                          GLuint uniformBlockIndex,
1341                                          GLenum pname,
1342                                          GLint *params)
1343 {
1344     EVENT(
1345         "(GLuint program = %u, GLuint uniformBlockIndex = %u, GLenum pname = 0x%X, GLint *params = "
1346         "0x%0.8p)",
1347         program, uniformBlockIndex, pname, params);
1348 
1349     Context *context = GetValidGlobalContext();
1350     if (context)
1351     {
1352         context->gatherParams<EntryPoint::GetActiveUniformBlockiv>(program, uniformBlockIndex,
1353                                                                    pname, params);
1354 
1355         if (context->skipValidation() ||
1356             ValidateGetActiveUniformBlockiv(context, program, uniformBlockIndex, pname, params))
1357         {
1358             context->getActiveUniformBlockiv(program, uniformBlockIndex, pname, params);
1359         }
1360     }
1361 }
1362 
GetActiveUniformBlockName(GLuint program,GLuint uniformBlockIndex,GLsizei bufSize,GLsizei * length,GLchar * uniformBlockName)1363 void GL_APIENTRY GetActiveUniformBlockName(GLuint program,
1364                                            GLuint uniformBlockIndex,
1365                                            GLsizei bufSize,
1366                                            GLsizei *length,
1367                                            GLchar *uniformBlockName)
1368 {
1369     EVENT(
1370         "(GLuint program = %u, GLuint uniformBlockIndex = %u, GLsizei bufSize = %d, GLsizei "
1371         "*length = 0x%0.8p, GLchar *uniformBlockName = 0x%0.8p)",
1372         program, uniformBlockIndex, bufSize, length, uniformBlockName);
1373 
1374     Context *context = GetValidGlobalContext();
1375     if (context)
1376     {
1377         context->gatherParams<EntryPoint::GetActiveUniformBlockName>(
1378             program, uniformBlockIndex, bufSize, length, uniformBlockName);
1379 
1380         if (context->skipValidation() ||
1381             ValidateGetActiveUniformBlockName(context, program, uniformBlockIndex, bufSize, length,
1382                                               uniformBlockName))
1383         {
1384             context->getActiveUniformBlockName(program, uniformBlockIndex, bufSize, length,
1385                                                uniformBlockName);
1386         }
1387     }
1388 }
1389 
UniformBlockBinding(GLuint program,GLuint uniformBlockIndex,GLuint uniformBlockBinding)1390 void GL_APIENTRY UniformBlockBinding(GLuint program,
1391                                      GLuint uniformBlockIndex,
1392                                      GLuint uniformBlockBinding)
1393 {
1394     EVENT("(GLuint program = %u, GLuint uniformBlockIndex = %u, GLuint uniformBlockBinding = %u)",
1395           program, uniformBlockIndex, uniformBlockBinding);
1396 
1397     Context *context = GetValidGlobalContext();
1398     if (context)
1399     {
1400         context->gatherParams<EntryPoint::UniformBlockBinding>(program, uniformBlockIndex,
1401                                                                uniformBlockBinding);
1402 
1403         if (context->skipValidation() ||
1404             ValidateUniformBlockBinding(context, program, uniformBlockIndex, uniformBlockBinding))
1405         {
1406             context->uniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding);
1407         }
1408     }
1409 }
1410 
DrawArraysInstanced(GLenum mode,GLint first,GLsizei count,GLsizei instancecount)1411 void GL_APIENTRY DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instancecount)
1412 {
1413     EVENT("(GLenum mode = 0x%X, GLint first = %d, GLsizei count = %d, GLsizei instancecount = %d)",
1414           mode, first, count, instancecount);
1415 
1416     Context *context = GetValidGlobalContext();
1417     if (context)
1418     {
1419         context->gatherParams<EntryPoint::DrawArraysInstanced>(mode, first, count, instancecount);
1420 
1421         if (context->skipValidation() ||
1422             ValidateDrawArraysInstanced(context, mode, first, count, instancecount))
1423         {
1424             context->drawArraysInstanced(mode, first, count, instancecount);
1425         }
1426     }
1427 }
1428 
DrawElementsInstanced(GLenum mode,GLsizei count,GLenum type,const void * indices,GLsizei instancecount)1429 void GL_APIENTRY DrawElementsInstanced(GLenum mode,
1430                                        GLsizei count,
1431                                        GLenum type,
1432                                        const void *indices,
1433                                        GLsizei instancecount)
1434 {
1435     EVENT(
1436         "(GLenum mode = 0x%X, GLsizei count = %d, GLenum type = 0x%X, const void *indices = "
1437         "0x%0.8p, GLsizei instancecount = %d)",
1438         mode, count, type, indices, instancecount);
1439 
1440     Context *context = GetValidGlobalContext();
1441     if (context)
1442     {
1443         context->gatherParams<EntryPoint::DrawElementsInstanced>(mode, count, type, indices,
1444                                                                  instancecount);
1445 
1446         if (context->skipValidation() ||
1447             ValidateDrawElementsInstanced(context, mode, count, type, indices, instancecount))
1448         {
1449             context->drawElementsInstanced(mode, count, type, indices, instancecount);
1450         }
1451     }
1452 }
1453 
FenceSync(GLenum condition,GLbitfield flags)1454 GLsync GL_APIENTRY FenceSync(GLenum condition, GLbitfield flags)
1455 {
1456     EVENT("(GLenum condition = 0x%X, GLbitfield flags = 0x%X)", condition, flags);
1457 
1458     Context *context = GetValidGlobalContext();
1459     if (context)
1460     {
1461         context->gatherParams<EntryPoint::FenceSync>(condition, flags);
1462 
1463         if (context->skipValidation() || ValidateFenceSync(context, condition, flags))
1464         {
1465             return context->fenceSync(condition, flags);
1466         }
1467     }
1468 
1469     return GetDefaultReturnValue<EntryPoint::FenceSync, GLsync>();
1470 }
1471 
IsSync(GLsync sync)1472 GLboolean GL_APIENTRY IsSync(GLsync sync)
1473 {
1474     EVENT("(GLsync sync = 0x%0.8p)", sync);
1475 
1476     Context *context = GetValidGlobalContext();
1477     if (context)
1478     {
1479         context->gatherParams<EntryPoint::IsSync>(sync);
1480 
1481         if (context->skipValidation() || ValidateIsSync(context, sync))
1482         {
1483             return context->isSync(sync);
1484         }
1485     }
1486 
1487     return GetDefaultReturnValue<EntryPoint::IsSync, GLboolean>();
1488 }
1489 
DeleteSync(GLsync sync)1490 void GL_APIENTRY DeleteSync(GLsync sync)
1491 {
1492     EVENT("(GLsync sync = 0x%0.8p)", sync);
1493 
1494     Context *context = GetValidGlobalContext();
1495     if (context)
1496     {
1497         context->gatherParams<EntryPoint::DeleteSync>(sync);
1498 
1499         if (context->skipValidation() || ValidateDeleteSync(context, sync))
1500         {
1501             context->deleteSync(sync);
1502         }
1503     }
1504 }
1505 
ClientWaitSync(GLsync sync,GLbitfield flags,GLuint64 timeout)1506 GLenum GL_APIENTRY ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
1507 {
1508     EVENT("(GLsync sync = 0x%0.8p, GLbitfield flags = 0x%X, GLuint64 timeout = %llu)", sync, flags,
1509           timeout);
1510 
1511     Context *context = GetValidGlobalContext();
1512     if (context)
1513     {
1514         context->gatherParams<EntryPoint::ClientWaitSync>(sync, flags, timeout);
1515 
1516         if (context->skipValidation() || ValidateClientWaitSync(context, sync, flags, timeout))
1517         {
1518             return context->clientWaitSync(sync, flags, timeout);
1519         }
1520     }
1521 
1522     return GetDefaultReturnValue<EntryPoint::ClientWaitSync, GLenum>();
1523 }
1524 
WaitSync(GLsync sync,GLbitfield flags,GLuint64 timeout)1525 void GL_APIENTRY WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
1526 {
1527     EVENT("(GLsync sync = 0x%0.8p, GLbitfield flags = 0x%X, GLuint64 timeout = %llu)", sync, flags,
1528           timeout);
1529 
1530     Context *context = GetValidGlobalContext();
1531     if (context)
1532     {
1533         context->gatherParams<EntryPoint::WaitSync>(sync, flags, timeout);
1534 
1535         if (context->skipValidation() || ValidateWaitSync(context, sync, flags, timeout))
1536         {
1537             context->waitSync(sync, flags, timeout);
1538         }
1539     }
1540 }
1541 
GetInteger64v(GLenum pname,GLint64 * data)1542 void GL_APIENTRY GetInteger64v(GLenum pname, GLint64 *data)
1543 {
1544     EVENT("(GLenum pname = 0x%X, GLint64 *data = 0x%0.8p)", pname, data);
1545 
1546     Context *context = GetValidGlobalContext();
1547     if (context)
1548     {
1549         context->gatherParams<EntryPoint::GetInteger64v>(pname, data);
1550 
1551         if (context->skipValidation() || ValidateGetInteger64v(context, pname, data))
1552         {
1553             context->getInteger64v(pname, data);
1554         }
1555     }
1556 }
1557 
1558 void GL_APIENTRY
GetSynciv(GLsync sync,GLenum pname,GLsizei bufSize,GLsizei * length,GLint * values)1559 GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values)
1560 {
1561     EVENT(
1562         "(GLsync sync = 0x%0.8p, GLenum pname = 0x%X, GLsizei bufSize = %d, GLsizei *length = "
1563         "0x%0.8p, GLint *values = 0x%0.8p)",
1564         sync, pname, bufSize, length, values);
1565 
1566     Context *context = GetValidGlobalContext();
1567     if (context)
1568     {
1569         context->gatherParams<EntryPoint::GetSynciv>(sync, pname, bufSize, length, values);
1570 
1571         if (context->skipValidation() ||
1572             ValidateGetSynciv(context, sync, pname, bufSize, length, values))
1573         {
1574             context->getSynciv(sync, pname, bufSize, length, values);
1575         }
1576     }
1577 }
1578 
GetInteger64i_v(GLenum target,GLuint index,GLint64 * data)1579 void GL_APIENTRY GetInteger64i_v(GLenum target, GLuint index, GLint64 *data)
1580 {
1581     EVENT("(GLenum target = 0x%X, GLuint index = %u, GLint64 *data = 0x%0.8p)", target, index,
1582           data);
1583 
1584     Context *context = GetValidGlobalContext();
1585     if (context)
1586     {
1587         context->gatherParams<EntryPoint::GetInteger64i_v>(target, index, data);
1588 
1589         if (context->skipValidation() || ValidateGetInteger64i_v(context, target, index, data))
1590         {
1591             context->getInteger64i_v(target, index, data);
1592         }
1593     }
1594 }
1595 
GetBufferParameteri64v(GLenum target,GLenum pname,GLint64 * params)1596 void GL_APIENTRY GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params)
1597 {
1598     EVENT("(GLenum target = 0x%X, GLenum pname = 0x%X, GLint64 *params = 0x%0.8p)", target, pname,
1599           params);
1600 
1601     Context *context = GetValidGlobalContext();
1602     if (context)
1603     {
1604         BufferBinding targetPacked = FromGLenum<BufferBinding>(target);
1605         context->gatherParams<EntryPoint::GetBufferParameteri64v>(targetPacked, pname, params);
1606 
1607         if (context->skipValidation() ||
1608             ValidateGetBufferParameteri64v(context, targetPacked, pname, params))
1609         {
1610             context->getBufferParameteri64v(targetPacked, pname, params);
1611         }
1612     }
1613 }
1614 
GenSamplers(GLsizei count,GLuint * samplers)1615 void GL_APIENTRY GenSamplers(GLsizei count, GLuint *samplers)
1616 {
1617     EVENT("(GLsizei count = %d, GLuint *samplers = 0x%0.8p)", count, samplers);
1618 
1619     Context *context = GetValidGlobalContext();
1620     if (context)
1621     {
1622         context->gatherParams<EntryPoint::GenSamplers>(count, samplers);
1623 
1624         if (context->skipValidation() || ValidateGenSamplers(context, count, samplers))
1625         {
1626             context->genSamplers(count, samplers);
1627         }
1628     }
1629 }
1630 
DeleteSamplers(GLsizei count,const GLuint * samplers)1631 void GL_APIENTRY DeleteSamplers(GLsizei count, const GLuint *samplers)
1632 {
1633     EVENT("(GLsizei count = %d, const GLuint *samplers = 0x%0.8p)", count, samplers);
1634 
1635     Context *context = GetValidGlobalContext();
1636     if (context)
1637     {
1638         context->gatherParams<EntryPoint::DeleteSamplers>(count, samplers);
1639 
1640         if (context->skipValidation() || ValidateDeleteSamplers(context, count, samplers))
1641         {
1642             context->deleteSamplers(count, samplers);
1643         }
1644     }
1645 }
1646 
IsSampler(GLuint sampler)1647 GLboolean GL_APIENTRY IsSampler(GLuint sampler)
1648 {
1649     EVENT("(GLuint sampler = %u)", sampler);
1650 
1651     Context *context = GetValidGlobalContext();
1652     if (context)
1653     {
1654         context->gatherParams<EntryPoint::IsSampler>(sampler);
1655 
1656         if (context->skipValidation() || ValidateIsSampler(context, sampler))
1657         {
1658             return context->isSampler(sampler);
1659         }
1660     }
1661 
1662     return GetDefaultReturnValue<EntryPoint::IsSampler, GLboolean>();
1663 }
1664 
BindSampler(GLuint unit,GLuint sampler)1665 void GL_APIENTRY BindSampler(GLuint unit, GLuint sampler)
1666 {
1667     EVENT("(GLuint unit = %u, GLuint sampler = %u)", unit, sampler);
1668 
1669     Context *context = GetValidGlobalContext();
1670     if (context)
1671     {
1672         context->gatherParams<EntryPoint::BindSampler>(unit, sampler);
1673 
1674         if (context->skipValidation() || ValidateBindSampler(context, unit, sampler))
1675         {
1676             context->bindSampler(unit, sampler);
1677         }
1678     }
1679 }
1680 
SamplerParameteri(GLuint sampler,GLenum pname,GLint param)1681 void GL_APIENTRY SamplerParameteri(GLuint sampler, GLenum pname, GLint param)
1682 {
1683     EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, GLint param = %d)", sampler, pname, param);
1684 
1685     Context *context = GetValidGlobalContext();
1686     if (context)
1687     {
1688         context->gatherParams<EntryPoint::SamplerParameteri>(sampler, pname, param);
1689 
1690         if (context->skipValidation() || ValidateSamplerParameteri(context, sampler, pname, param))
1691         {
1692             context->samplerParameteri(sampler, pname, param);
1693         }
1694     }
1695 }
1696 
SamplerParameteriv(GLuint sampler,GLenum pname,const GLint * param)1697 void GL_APIENTRY SamplerParameteriv(GLuint sampler, GLenum pname, const GLint *param)
1698 {
1699     EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, const GLint *param = 0x%0.8p)", sampler,
1700           pname, param);
1701 
1702     Context *context = GetValidGlobalContext();
1703     if (context)
1704     {
1705         context->gatherParams<EntryPoint::SamplerParameteriv>(sampler, pname, param);
1706 
1707         if (context->skipValidation() || ValidateSamplerParameteriv(context, sampler, pname, param))
1708         {
1709             context->samplerParameteriv(sampler, pname, param);
1710         }
1711     }
1712 }
1713 
SamplerParameterf(GLuint sampler,GLenum pname,GLfloat param)1714 void GL_APIENTRY SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
1715 {
1716     EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, GLfloat param = %f)", sampler, pname, param);
1717 
1718     Context *context = GetValidGlobalContext();
1719     if (context)
1720     {
1721         context->gatherParams<EntryPoint::SamplerParameterf>(sampler, pname, param);
1722 
1723         if (context->skipValidation() || ValidateSamplerParameterf(context, sampler, pname, param))
1724         {
1725             context->samplerParameterf(sampler, pname, param);
1726         }
1727     }
1728 }
1729 
SamplerParameterfv(GLuint sampler,GLenum pname,const GLfloat * param)1730 void GL_APIENTRY SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat *param)
1731 {
1732     EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, const GLfloat *param = 0x%0.8p)", sampler,
1733           pname, param);
1734 
1735     Context *context = GetValidGlobalContext();
1736     if (context)
1737     {
1738         context->gatherParams<EntryPoint::SamplerParameterfv>(sampler, pname, param);
1739 
1740         if (context->skipValidation() || ValidateSamplerParameterfv(context, sampler, pname, param))
1741         {
1742             context->samplerParameterfv(sampler, pname, param);
1743         }
1744     }
1745 }
1746 
GetSamplerParameteriv(GLuint sampler,GLenum pname,GLint * params)1747 void GL_APIENTRY GetSamplerParameteriv(GLuint sampler, GLenum pname, GLint *params)
1748 {
1749     EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", sampler, pname,
1750           params);
1751 
1752     Context *context = GetValidGlobalContext();
1753     if (context)
1754     {
1755         context->gatherParams<EntryPoint::GetSamplerParameteriv>(sampler, pname, params);
1756 
1757         if (context->skipValidation() ||
1758             ValidateGetSamplerParameteriv(context, sampler, pname, params))
1759         {
1760             context->getSamplerParameteriv(sampler, pname, params);
1761         }
1762     }
1763 }
1764 
GetSamplerParameterfv(GLuint sampler,GLenum pname,GLfloat * params)1765 void GL_APIENTRY GetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat *params)
1766 {
1767     EVENT("(GLuint sampler = %u, GLenum pname = 0x%X, GLfloat *params = 0x%0.8p)", sampler, pname,
1768           params);
1769 
1770     Context *context = GetValidGlobalContext();
1771     if (context)
1772     {
1773         context->gatherParams<EntryPoint::GetSamplerParameterfv>(sampler, pname, params);
1774 
1775         if (context->skipValidation() ||
1776             ValidateGetSamplerParameterfv(context, sampler, pname, params))
1777         {
1778             context->getSamplerParameterfv(sampler, pname, params);
1779         }
1780     }
1781 }
1782 
VertexAttribDivisor(GLuint index,GLuint divisor)1783 void GL_APIENTRY VertexAttribDivisor(GLuint index, GLuint divisor)
1784 {
1785     EVENT("(GLuint index = %u, GLuint divisor = %u)", index, divisor);
1786 
1787     Context *context = GetValidGlobalContext();
1788     if (context)
1789     {
1790         context->gatherParams<EntryPoint::VertexAttribDivisor>(index, divisor);
1791 
1792         if (context->skipValidation() || ValidateVertexAttribDivisor(context, index, divisor))
1793         {
1794             context->vertexAttribDivisor(index, divisor);
1795         }
1796     }
1797 }
1798 
BindTransformFeedback(GLenum target,GLuint id)1799 void GL_APIENTRY BindTransformFeedback(GLenum target, GLuint id)
1800 {
1801     EVENT("(GLenum target = 0x%X, GLuint id = %u)", target, id);
1802 
1803     Context *context = GetValidGlobalContext();
1804     if (context)
1805     {
1806         context->gatherParams<EntryPoint::BindTransformFeedback>(target, id);
1807 
1808         if (context->skipValidation() || ValidateBindTransformFeedback(context, target, id))
1809         {
1810             context->bindTransformFeedback(target, id);
1811         }
1812     }
1813 }
1814 
DeleteTransformFeedbacks(GLsizei n,const GLuint * ids)1815 void GL_APIENTRY DeleteTransformFeedbacks(GLsizei n, const GLuint *ids)
1816 {
1817     EVENT("(GLsizei n = %d, const GLuint *ids = 0x%0.8p)", n, ids);
1818 
1819     Context *context = GetValidGlobalContext();
1820     if (context)
1821     {
1822         context->gatherParams<EntryPoint::DeleteTransformFeedbacks>(n, ids);
1823 
1824         if (context->skipValidation() || ValidateDeleteTransformFeedbacks(context, n, ids))
1825         {
1826             context->deleteTransformFeedbacks(n, ids);
1827         }
1828     }
1829 }
1830 
GenTransformFeedbacks(GLsizei n,GLuint * ids)1831 void GL_APIENTRY GenTransformFeedbacks(GLsizei n, GLuint *ids)
1832 {
1833     EVENT("(GLsizei n = %d, GLuint *ids = 0x%0.8p)", n, ids);
1834 
1835     Context *context = GetValidGlobalContext();
1836     if (context)
1837     {
1838         context->gatherParams<EntryPoint::GenTransformFeedbacks>(n, ids);
1839 
1840         if (context->skipValidation() || ValidateGenTransformFeedbacks(context, n, ids))
1841         {
1842             context->genTransformFeedbacks(n, ids);
1843         }
1844     }
1845 }
1846 
IsTransformFeedback(GLuint id)1847 GLboolean GL_APIENTRY IsTransformFeedback(GLuint id)
1848 {
1849     EVENT("(GLuint id = %u)", id);
1850 
1851     Context *context = GetValidGlobalContext();
1852     if (context)
1853     {
1854         context->gatherParams<EntryPoint::IsTransformFeedback>(id);
1855 
1856         if (context->skipValidation() || ValidateIsTransformFeedback(context, id))
1857         {
1858             return context->isTransformFeedback(id);
1859         }
1860     }
1861 
1862     return GetDefaultReturnValue<EntryPoint::IsTransformFeedback, GLboolean>();
1863 }
1864 
PauseTransformFeedback()1865 void GL_APIENTRY PauseTransformFeedback()
1866 {
1867     EVENT("()");
1868 
1869     Context *context = GetValidGlobalContext();
1870     if (context)
1871     {
1872         context->gatherParams<EntryPoint::PauseTransformFeedback>();
1873 
1874         if (context->skipValidation() || ValidatePauseTransformFeedback(context))
1875         {
1876             context->pauseTransformFeedback();
1877         }
1878     }
1879 }
1880 
ResumeTransformFeedback()1881 void GL_APIENTRY ResumeTransformFeedback()
1882 {
1883     EVENT("()");
1884 
1885     Context *context = GetValidGlobalContext();
1886     if (context)
1887     {
1888         context->gatherParams<EntryPoint::ResumeTransformFeedback>();
1889 
1890         if (context->skipValidation() || ValidateResumeTransformFeedback(context))
1891         {
1892             context->resumeTransformFeedback();
1893         }
1894     }
1895 }
1896 
GetProgramBinary(GLuint program,GLsizei bufSize,GLsizei * length,GLenum * binaryFormat,void * binary)1897 void GL_APIENTRY GetProgramBinary(GLuint program,
1898                                   GLsizei bufSize,
1899                                   GLsizei *length,
1900                                   GLenum *binaryFormat,
1901                                   void *binary)
1902 {
1903     EVENT(
1904         "(GLuint program = %u, GLsizei bufSize = %d, GLsizei *length = 0x%0.8p, GLenum "
1905         "*binaryFormat = 0x%0.8p, void *binary = 0x%0.8p)",
1906         program, bufSize, length, binaryFormat, binary);
1907 
1908     Context *context = GetValidGlobalContext();
1909     if (context)
1910     {
1911         context->gatherParams<EntryPoint::GetProgramBinary>(program, bufSize, length, binaryFormat,
1912                                                             binary);
1913 
1914         if (context->skipValidation() ||
1915             ValidateGetProgramBinary(context, program, bufSize, length, binaryFormat, binary))
1916         {
1917             context->getProgramBinary(program, bufSize, length, binaryFormat, binary);
1918         }
1919     }
1920 }
1921 
ProgramBinary(GLuint program,GLenum binaryFormat,const void * binary,GLsizei length)1922 void GL_APIENTRY ProgramBinary(GLuint program,
1923                                GLenum binaryFormat,
1924                                const void *binary,
1925                                GLsizei length)
1926 {
1927     EVENT(
1928         "(GLuint program = %u, GLenum binaryFormat = 0x%X, const void *binary = 0x%0.8p, GLsizei "
1929         "length = %d)",
1930         program, binaryFormat, binary, length);
1931 
1932     Context *context = GetValidGlobalContext();
1933     if (context)
1934     {
1935         context->gatherParams<EntryPoint::ProgramBinary>(program, binaryFormat, binary, length);
1936 
1937         if (context->skipValidation() ||
1938             ValidateProgramBinary(context, program, binaryFormat, binary, length))
1939         {
1940             context->programBinary(program, binaryFormat, binary, length);
1941         }
1942     }
1943 }
1944 
ProgramParameteri(GLuint program,GLenum pname,GLint value)1945 void GL_APIENTRY ProgramParameteri(GLuint program, GLenum pname, GLint value)
1946 {
1947     EVENT("(GLuint program = %u, GLenum pname = 0x%X, GLint value = %d)", program, pname, value);
1948 
1949     Context *context = GetValidGlobalContext();
1950     if (context)
1951     {
1952         context->gatherParams<EntryPoint::ProgramParameteri>(program, pname, value);
1953 
1954         if (context->skipValidation() || ValidateProgramParameteri(context, program, pname, value))
1955         {
1956             context->programParameteri(program, pname, value);
1957         }
1958     }
1959 }
1960 
InvalidateFramebuffer(GLenum target,GLsizei numAttachments,const GLenum * attachments)1961 void GL_APIENTRY InvalidateFramebuffer(GLenum target,
1962                                        GLsizei numAttachments,
1963                                        const GLenum *attachments)
1964 {
1965     EVENT(
1966         "(GLenum target = 0x%X, GLsizei numAttachments = %d, const GLenum *attachments = 0x%0.8p)",
1967         target, numAttachments, attachments);
1968 
1969     Context *context = GetValidGlobalContext();
1970     if (context)
1971     {
1972         context->gatherParams<EntryPoint::InvalidateFramebuffer>(target, numAttachments,
1973                                                                  attachments);
1974 
1975         if (context->skipValidation() ||
1976             ValidateInvalidateFramebuffer(context, target, numAttachments, attachments))
1977         {
1978             context->invalidateFramebuffer(target, numAttachments, attachments);
1979         }
1980     }
1981 }
1982 
InvalidateSubFramebuffer(GLenum target,GLsizei numAttachments,const GLenum * attachments,GLint x,GLint y,GLsizei width,GLsizei height)1983 void GL_APIENTRY InvalidateSubFramebuffer(GLenum target,
1984                                           GLsizei numAttachments,
1985                                           const GLenum *attachments,
1986                                           GLint x,
1987                                           GLint y,
1988                                           GLsizei width,
1989                                           GLsizei height)
1990 {
1991     EVENT(
1992         "(GLenum target = 0x%X, GLsizei numAttachments = %d, const GLenum *attachments = 0x%0.8p, "
1993         "GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d)",
1994         target, numAttachments, attachments, x, y, width, height);
1995 
1996     Context *context = GetValidGlobalContext();
1997     if (context)
1998     {
1999         context->gatherParams<EntryPoint::InvalidateSubFramebuffer>(
2000             target, numAttachments, attachments, x, y, width, height);
2001 
2002         if (context->skipValidation() ||
2003             ValidateInvalidateSubFramebuffer(context, target, numAttachments, attachments, x, y,
2004                                              width, height))
2005         {
2006             context->invalidateSubFramebuffer(target, numAttachments, attachments, x, y, width,
2007                                               height);
2008         }
2009     }
2010 }
2011 
2012 void GL_APIENTRY
TexStorage2D(GLenum target,GLsizei levels,GLenum internalformat,GLsizei width,GLsizei height)2013 TexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
2014 {
2015     EVENT(
2016         "(GLenum target = 0x%X, GLsizei levels = %d, GLenum internalformat = 0x%X, GLsizei width = "
2017         "%d, GLsizei height = %d)",
2018         target, levels, internalformat, width, height);
2019 
2020     Context *context = GetValidGlobalContext();
2021     if (context)
2022     {
2023         context->gatherParams<EntryPoint::TexStorage2D>(target, levels, internalformat, width,
2024                                                         height);
2025 
2026         if (context->skipValidation() ||
2027             ValidateTexStorage2D(context, target, levels, internalformat, width, height))
2028         {
2029             context->texStorage2D(target, levels, internalformat, width, height);
2030         }
2031     }
2032 }
2033 
TexStorage3D(GLenum target,GLsizei levels,GLenum internalformat,GLsizei width,GLsizei height,GLsizei depth)2034 void GL_APIENTRY TexStorage3D(GLenum target,
2035                               GLsizei levels,
2036                               GLenum internalformat,
2037                               GLsizei width,
2038                               GLsizei height,
2039                               GLsizei depth)
2040 {
2041     EVENT(
2042         "(GLenum target = 0x%X, GLsizei levels = %d, GLenum internalformat = 0x%X, GLsizei width = "
2043         "%d, GLsizei height = %d, GLsizei depth = %d)",
2044         target, levels, internalformat, width, height, depth);
2045 
2046     Context *context = GetValidGlobalContext();
2047     if (context)
2048     {
2049         context->gatherParams<EntryPoint::TexStorage3D>(target, levels, internalformat, width,
2050                                                         height, depth);
2051 
2052         if (context->skipValidation() ||
2053             ValidateTexStorage3D(context, target, levels, internalformat, width, height, depth))
2054         {
2055             context->texStorage3D(target, levels, internalformat, width, height, depth);
2056         }
2057     }
2058 }
2059 
GetInternalformativ(GLenum target,GLenum internalformat,GLenum pname,GLsizei bufSize,GLint * params)2060 void GL_APIENTRY GetInternalformativ(GLenum target,
2061                                      GLenum internalformat,
2062                                      GLenum pname,
2063                                      GLsizei bufSize,
2064                                      GLint *params)
2065 {
2066     EVENT(
2067         "(GLenum target = 0x%X, GLenum internalformat = 0x%X, GLenum pname = 0x%X, GLsizei bufSize "
2068         "= %d, GLint *params = 0x%0.8p)",
2069         target, internalformat, pname, bufSize, params);
2070 
2071     Context *context = GetValidGlobalContext();
2072     if (context)
2073     {
2074         context->gatherParams<EntryPoint::GetInternalformativ>(target, internalformat, pname,
2075                                                                bufSize, params);
2076 
2077         if (context->skipValidation() ||
2078             ValidateGetInternalformativ(context, target, internalformat, pname, bufSize, params))
2079         {
2080             context->getInternalformativ(target, internalformat, pname, bufSize, params);
2081         }
2082     }
2083 }
2084 }  // namespace gl
2085