• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by generate_entry_points.py using data from gl.xml.
3 //
4 // Copyright 2019 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_gl_4_3_autogen.cpp:
9 //   Defines the GL 4.3 entry points.
10 
11 #include "libGL/entry_points_gl_4_3_autogen.h"
12 
13 #include "libANGLE/Context.h"
14 #include "libANGLE/Context.inl.h"
15 #include "libANGLE/entry_points_utils.h"
16 #include "libANGLE/gl_enum_utils_autogen.h"
17 #include "libANGLE/validationEGL.h"
18 #include "libANGLE/validationES.h"
19 #include "libANGLE/validationES1.h"
20 #include "libANGLE/validationES2.h"
21 #include "libANGLE/validationES3.h"
22 #include "libANGLE/validationES31.h"
23 #include "libANGLE/validationESEXT.h"
24 #include "libANGLE/validationGL43_autogen.h"
25 #include "libGLESv2/global_state.h"
26 
27 namespace gl
28 {
BindVertexBuffer(GLuint bindingindex,GLuint buffer,GLintptr offset,GLsizei stride)29 void GL_APIENTRY BindVertexBuffer(GLuint bindingindex,
30                                   GLuint buffer,
31                                   GLintptr offset,
32                                   GLsizei stride)
33 {
34     EVENT(
35         "(GLuint bindingindex = %u, GLuint buffer = %u, GLintptr offset = %llu, GLsizei stride = "
36         "%d)",
37         bindingindex, buffer, static_cast<unsigned long long>(offset), stride);
38 
39     Context *context = GetValidGlobalContext();
40     if (context)
41     {
42         BufferID bufferPacked                         = FromGL<BufferID>(buffer);
43         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
44         bool isCallValid =
45             (context->skipValidation() ||
46              ValidateBindVertexBuffer(context, bindingindex, bufferPacked, offset, stride));
47         if (isCallValid)
48         {
49             context->bindVertexBuffer(bindingindex, bufferPacked, offset, stride);
50         }
51         ANGLE_CAPTURE(BindVertexBuffer, isCallValid, context, bindingindex, bufferPacked, offset,
52                       stride);
53     }
54 }
55 
56 void GL_APIENTRY
ClearBufferData(GLenum target,GLenum internalformat,GLenum format,GLenum type,const void * data)57 ClearBufferData(GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data)
58 {
59     EVENT(
60         "(GLenum target = %s, GLenum internalformat = %s, GLenum format = %s, GLenum type = %s, "
61         "const void *data = 0x%016" PRIxPTR ")",
62         GLenumToString(GLenumGroup::BufferStorageTarget, target),
63         GLenumToString(GLenumGroup::InternalFormat, internalformat),
64         GLenumToString(GLenumGroup::PixelFormat, format),
65         GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)data);
66 
67     Context *context = GetValidGlobalContext();
68     if (context)
69     {
70         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
71         bool isCallValid =
72             (context->skipValidation() ||
73              ValidateClearBufferData(context, target, internalformat, format, type, data));
74         if (isCallValid)
75         {
76             context->clearBufferData(target, internalformat, format, type, data);
77         }
78         ANGLE_CAPTURE(ClearBufferData, isCallValid, context, target, internalformat, format, type,
79                       data);
80     }
81 }
82 
ClearBufferSubData(GLenum target,GLenum internalformat,GLintptr offset,GLsizeiptr size,GLenum format,GLenum type,const void * data)83 void GL_APIENTRY ClearBufferSubData(GLenum target,
84                                     GLenum internalformat,
85                                     GLintptr offset,
86                                     GLsizeiptr size,
87                                     GLenum format,
88                                     GLenum type,
89                                     const void *data)
90 {
91     EVENT(
92         "(GLenum target = %s, GLenum internalformat = %s, GLintptr offset = %llu, GLsizeiptr size "
93         "= %llu, GLenum format = %s, GLenum type = %s, const void *data = 0x%016" PRIxPTR ")",
94         GLenumToString(GLenumGroup::DefaultGroup, target),
95         GLenumToString(GLenumGroup::InternalFormat, internalformat),
96         static_cast<unsigned long long>(offset), static_cast<unsigned long long>(size),
97         GLenumToString(GLenumGroup::PixelFormat, format),
98         GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)data);
99 
100     Context *context = GetValidGlobalContext();
101     if (context)
102     {
103         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
104         bool isCallValid                              = (context->skipValidation() ||
105                             ValidateClearBufferSubData(context, target, internalformat, offset,
106                                                        size, format, type, data));
107         if (isCallValid)
108         {
109             context->clearBufferSubData(target, internalformat, offset, size, format, type, data);
110         }
111         ANGLE_CAPTURE(ClearBufferSubData, isCallValid, context, target, internalformat, offset,
112                       size, format, type, data);
113     }
114 }
115 
CopyImageSubData(GLuint srcName,GLenum srcTarget,GLint srcLevel,GLint srcX,GLint srcY,GLint srcZ,GLuint dstName,GLenum dstTarget,GLint dstLevel,GLint dstX,GLint dstY,GLint dstZ,GLsizei srcWidth,GLsizei srcHeight,GLsizei srcDepth)116 void GL_APIENTRY CopyImageSubData(GLuint srcName,
117                                   GLenum srcTarget,
118                                   GLint srcLevel,
119                                   GLint srcX,
120                                   GLint srcY,
121                                   GLint srcZ,
122                                   GLuint dstName,
123                                   GLenum dstTarget,
124                                   GLint dstLevel,
125                                   GLint dstX,
126                                   GLint dstY,
127                                   GLint dstZ,
128                                   GLsizei srcWidth,
129                                   GLsizei srcHeight,
130                                   GLsizei srcDepth)
131 {
132     EVENT(
133         "(GLuint srcName = %u, GLenum srcTarget = %s, GLint srcLevel = %d, GLint srcX = %d, GLint "
134         "srcY = %d, GLint srcZ = %d, GLuint dstName = %u, GLenum dstTarget = %s, GLint dstLevel = "
135         "%d, GLint dstX = %d, GLint dstY = %d, GLint dstZ = %d, GLsizei srcWidth = %d, GLsizei "
136         "srcHeight = %d, GLsizei srcDepth = %d)",
137         srcName, GLenumToString(GLenumGroup::CopyBufferSubDataTarget, srcTarget), srcLevel, srcX,
138         srcY, srcZ, dstName, GLenumToString(GLenumGroup::CopyBufferSubDataTarget, dstTarget),
139         dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth);
140 
141     Context *context = GetValidGlobalContext();
142     if (context)
143     {
144         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
145         bool isCallValid                              = (context->skipValidation() ||
146                             ValidateCopyImageSubData(context, srcName, srcTarget, srcLevel, srcX,
147                                                      srcY, srcZ, dstName, dstTarget, dstLevel, dstX,
148                                                      dstY, dstZ, srcWidth, srcHeight, srcDepth));
149         if (isCallValid)
150         {
151             context->copyImageSubData(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName,
152                                       dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight,
153                                       srcDepth);
154         }
155         ANGLE_CAPTURE(CopyImageSubData, isCallValid, context, srcName, srcTarget, srcLevel, srcX,
156                       srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth,
157                       srcHeight, srcDepth);
158     }
159 }
160 
DebugMessageCallback(GLDEBUGPROC callback,const void * userParam)161 void GL_APIENTRY DebugMessageCallback(GLDEBUGPROC callback, const void *userParam)
162 {
163     EVENT("(GLDEBUGPROC callback = 0x%016" PRIxPTR ", const void *userParam = 0x%016" PRIxPTR ")",
164           (uintptr_t)callback, (uintptr_t)userParam);
165 
166     Context *context = GetValidGlobalContext();
167     if (context)
168     {
169         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
170         bool isCallValid                              = (context->skipValidation() ||
171                             ValidateDebugMessageCallback(context, callback, userParam));
172         if (isCallValid)
173         {
174             context->debugMessageCallback(callback, userParam);
175         }
176         ANGLE_CAPTURE(DebugMessageCallback, isCallValid, context, callback, userParam);
177     }
178 }
179 
DebugMessageControl(GLenum source,GLenum type,GLenum severity,GLsizei count,const GLuint * ids,GLboolean enabled)180 void GL_APIENTRY DebugMessageControl(GLenum source,
181                                      GLenum type,
182                                      GLenum severity,
183                                      GLsizei count,
184                                      const GLuint *ids,
185                                      GLboolean enabled)
186 {
187     EVENT(
188         "(GLenum source = %s, GLenum type = %s, GLenum severity = %s, GLsizei count = %d, const "
189         "GLuint *ids = 0x%016" PRIxPTR ", GLboolean enabled = %s)",
190         GLenumToString(GLenumGroup::DebugSource, source),
191         GLenumToString(GLenumGroup::DebugType, type),
192         GLenumToString(GLenumGroup::DebugSeverity, severity), count, (uintptr_t)ids,
193         GLbooleanToString(enabled));
194 
195     Context *context = GetValidGlobalContext();
196     if (context)
197     {
198         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
199         bool isCallValid =
200             (context->skipValidation() ||
201              ValidateDebugMessageControl(context, source, type, severity, count, ids, enabled));
202         if (isCallValid)
203         {
204             context->debugMessageControl(source, type, severity, count, ids, enabled);
205         }
206         ANGLE_CAPTURE(DebugMessageControl, isCallValid, context, source, type, severity, count, ids,
207                       enabled);
208     }
209 }
210 
DebugMessageInsert(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar * buf)211 void GL_APIENTRY DebugMessageInsert(GLenum source,
212                                     GLenum type,
213                                     GLuint id,
214                                     GLenum severity,
215                                     GLsizei length,
216                                     const GLchar *buf)
217 {
218     EVENT(
219         "(GLenum source = %s, GLenum type = %s, GLuint id = %u, GLenum severity = %s, GLsizei "
220         "length = %d, const GLchar *buf = 0x%016" PRIxPTR ")",
221         GLenumToString(GLenumGroup::DebugSource, source),
222         GLenumToString(GLenumGroup::DebugType, type), id,
223         GLenumToString(GLenumGroup::DebugSeverity, severity), length, (uintptr_t)buf);
224 
225     Context *context = GetValidGlobalContext();
226     if (context)
227     {
228         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
229         bool isCallValid =
230             (context->skipValidation() ||
231              ValidateDebugMessageInsert(context, source, type, id, severity, length, buf));
232         if (isCallValid)
233         {
234             context->debugMessageInsert(source, type, id, severity, length, buf);
235         }
236         ANGLE_CAPTURE(DebugMessageInsert, isCallValid, context, source, type, id, severity, length,
237                       buf);
238     }
239 }
240 
DispatchCompute(GLuint num_groups_x,GLuint num_groups_y,GLuint num_groups_z)241 void GL_APIENTRY DispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z)
242 {
243     EVENT("(GLuint num_groups_x = %u, GLuint num_groups_y = %u, GLuint num_groups_z = %u)",
244           num_groups_x, num_groups_y, num_groups_z);
245 
246     Context *context = GetValidGlobalContext();
247     if (context)
248     {
249         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
250         bool isCallValid =
251             (context->skipValidation() ||
252              ValidateDispatchCompute(context, num_groups_x, num_groups_y, num_groups_z));
253         if (isCallValid)
254         {
255             context->dispatchCompute(num_groups_x, num_groups_y, num_groups_z);
256         }
257         ANGLE_CAPTURE(DispatchCompute, isCallValid, context, num_groups_x, num_groups_y,
258                       num_groups_z);
259     }
260 }
261 
DispatchComputeIndirect(GLintptr indirect)262 void GL_APIENTRY DispatchComputeIndirect(GLintptr indirect)
263 {
264     EVENT("(GLintptr indirect = %llu)", static_cast<unsigned long long>(indirect));
265 
266     Context *context = GetValidGlobalContext();
267     if (context)
268     {
269         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
270         bool isCallValid =
271             (context->skipValidation() || ValidateDispatchComputeIndirect(context, indirect));
272         if (isCallValid)
273         {
274             context->dispatchComputeIndirect(indirect);
275         }
276         ANGLE_CAPTURE(DispatchComputeIndirect, isCallValid, context, indirect);
277     }
278 }
279 
FramebufferParameteri(GLenum target,GLenum pname,GLint param)280 void GL_APIENTRY FramebufferParameteri(GLenum target, GLenum pname, GLint param)
281 {
282     EVENT("(GLenum target = %s, GLenum pname = %s, GLint param = %d)",
283           GLenumToString(GLenumGroup::FramebufferTarget, target),
284           GLenumToString(GLenumGroup::FramebufferParameterName, pname), param);
285 
286     Context *context = GetValidGlobalContext();
287     if (context)
288     {
289         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
290         bool isCallValid                              = (context->skipValidation() ||
291                             ValidateFramebufferParameteri(context, target, pname, param));
292         if (isCallValid)
293         {
294             context->framebufferParameteri(target, pname, param);
295         }
296         ANGLE_CAPTURE(FramebufferParameteri, isCallValid, context, target, pname, param);
297     }
298 }
299 
GetDebugMessageLog(GLuint count,GLsizei bufSize,GLenum * sources,GLenum * types,GLuint * ids,GLenum * severities,GLsizei * lengths,GLchar * messageLog)300 GLuint GL_APIENTRY GetDebugMessageLog(GLuint count,
301                                       GLsizei bufSize,
302                                       GLenum *sources,
303                                       GLenum *types,
304                                       GLuint *ids,
305                                       GLenum *severities,
306                                       GLsizei *lengths,
307                                       GLchar *messageLog)
308 {
309     EVENT("(GLuint count = %u, GLsizei bufSize = %d, GLenum *sources = 0x%016" PRIxPTR
310           ", GLenum *types = 0x%016" PRIxPTR ", GLuint *ids = 0x%016" PRIxPTR
311           ", GLenum *severities = 0x%016" PRIxPTR ", GLsizei *lengths = 0x%016" PRIxPTR
312           ", GLchar *messageLog = 0x%016" PRIxPTR ")",
313           count, bufSize, (uintptr_t)sources, (uintptr_t)types, (uintptr_t)ids,
314           (uintptr_t)severities, (uintptr_t)lengths, (uintptr_t)messageLog);
315 
316     Context *context = GetValidGlobalContext();
317     GLuint returnValue;
318     if (context)
319     {
320         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
321         bool isCallValid                              = (context->skipValidation() ||
322                             ValidateGetDebugMessageLog(context, count, bufSize, sources, types, ids,
323                                                        severities, lengths, messageLog));
324         if (isCallValid)
325         {
326             returnValue = context->getDebugMessageLog(count, bufSize, sources, types, ids,
327                                                       severities, lengths, messageLog);
328         }
329         else
330         {
331             returnValue = GetDefaultReturnValue<EntryPoint::GetDebugMessageLog, GLuint>();
332         }
333         ANGLE_CAPTURE(GetDebugMessageLog, isCallValid, context, count, bufSize, sources, types, ids,
334                       severities, lengths, messageLog, returnValue);
335     }
336     else
337     {
338         returnValue = GetDefaultReturnValue<EntryPoint::GetDebugMessageLog, GLuint>();
339     }
340     return returnValue;
341 }
342 
GetFramebufferParameteriv(GLenum target,GLenum pname,GLint * params)343 void GL_APIENTRY GetFramebufferParameteriv(GLenum target, GLenum pname, GLint *params)
344 {
345     EVENT("(GLenum target = %s, GLenum pname = %s, GLint *params = 0x%016" PRIxPTR ")",
346           GLenumToString(GLenumGroup::FramebufferTarget, target),
347           GLenumToString(GLenumGroup::FramebufferAttachmentParameterName, pname),
348           (uintptr_t)params);
349 
350     Context *context = GetValidGlobalContext();
351     if (context)
352     {
353         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
354         bool isCallValid                              = (context->skipValidation() ||
355                             ValidateGetFramebufferParameteriv(context, target, pname, params));
356         if (isCallValid)
357         {
358             context->getFramebufferParameteriv(target, pname, params);
359         }
360         ANGLE_CAPTURE(GetFramebufferParameteriv, isCallValid, context, target, pname, params);
361     }
362 }
363 
GetInternalformati64v(GLenum target,GLenum internalformat,GLenum pname,GLsizei bufSize,GLint64 * params)364 void GL_APIENTRY GetInternalformati64v(GLenum target,
365                                        GLenum internalformat,
366                                        GLenum pname,
367                                        GLsizei bufSize,
368                                        GLint64 *params)
369 {
370     EVENT(
371         "(GLenum target = %s, GLenum internalformat = %s, GLenum pname = %s, GLsizei bufSize = %d, "
372         "GLint64 *params = 0x%016" PRIxPTR ")",
373         GLenumToString(GLenumGroup::TextureTarget, target),
374         GLenumToString(GLenumGroup::InternalFormat, internalformat),
375         GLenumToString(GLenumGroup::InternalFormatPName, pname), bufSize, (uintptr_t)params);
376 
377     Context *context = GetValidGlobalContext();
378     if (context)
379     {
380         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
381         bool isCallValid                              = (context->skipValidation() ||
382                             ValidateGetInternalformati64v(context, target, internalformat, pname,
383                                                           bufSize, params));
384         if (isCallValid)
385         {
386             context->getInternalformati64v(target, internalformat, pname, bufSize, params);
387         }
388         ANGLE_CAPTURE(GetInternalformati64v, isCallValid, context, target, internalformat, pname,
389                       bufSize, params);
390     }
391 }
392 
393 void GL_APIENTRY
GetObjectLabel(GLenum identifier,GLuint name,GLsizei bufSize,GLsizei * length,GLchar * label)394 GetObjectLabel(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label)
395 {
396     EVENT(
397         "(GLenum identifier = %s, GLuint name = %u, GLsizei bufSize = %d, GLsizei *length = "
398         "0x%016" PRIxPTR ", GLchar *label = 0x%016" PRIxPTR ")",
399         GLenumToString(GLenumGroup::DefaultGroup, identifier), name, bufSize, (uintptr_t)length,
400         (uintptr_t)label);
401 
402     Context *context = GetValidGlobalContext();
403     if (context)
404     {
405         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
406         bool isCallValid =
407             (context->skipValidation() ||
408              ValidateGetObjectLabel(context, identifier, name, bufSize, length, label));
409         if (isCallValid)
410         {
411             context->getObjectLabel(identifier, name, bufSize, length, label);
412         }
413         ANGLE_CAPTURE(GetObjectLabel, isCallValid, context, identifier, name, bufSize, length,
414                       label);
415     }
416 }
417 
GetObjectPtrLabel(const void * ptr,GLsizei bufSize,GLsizei * length,GLchar * label)418 void GL_APIENTRY GetObjectPtrLabel(const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label)
419 {
420     EVENT("(const void *ptr = 0x%016" PRIxPTR
421           ", GLsizei bufSize = %d, GLsizei *length = 0x%016" PRIxPTR
422           ", GLchar *label = 0x%016" PRIxPTR ")",
423           (uintptr_t)ptr, bufSize, (uintptr_t)length, (uintptr_t)label);
424 
425     Context *context = GetValidGlobalContext();
426     if (context)
427     {
428         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
429         bool isCallValid                              = (context->skipValidation() ||
430                             ValidateGetObjectPtrLabel(context, ptr, bufSize, length, label));
431         if (isCallValid)
432         {
433             context->getObjectPtrLabel(ptr, bufSize, length, label);
434         }
435         ANGLE_CAPTURE(GetObjectPtrLabel, isCallValid, context, ptr, bufSize, length, label);
436     }
437 }
438 
GetProgramInterfaceiv(GLuint program,GLenum programInterface,GLenum pname,GLint * params)439 void GL_APIENTRY GetProgramInterfaceiv(GLuint program,
440                                        GLenum programInterface,
441                                        GLenum pname,
442                                        GLint *params)
443 {
444     EVENT(
445         "(GLuint program = %u, GLenum programInterface = %s, GLenum pname = %s, GLint *params = "
446         "0x%016" PRIxPTR ")",
447         program, GLenumToString(GLenumGroup::ProgramInterface, programInterface),
448         GLenumToString(GLenumGroup::ProgramInterfacePName, pname), (uintptr_t)params);
449 
450     Context *context = GetValidGlobalContext();
451     if (context)
452     {
453         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
454         bool isCallValid =
455             (context->skipValidation() ||
456              ValidateGetProgramInterfaceiv(context, program, programInterface, pname, params));
457         if (isCallValid)
458         {
459             context->getProgramInterfaceiv(program, programInterface, pname, params);
460         }
461         ANGLE_CAPTURE(GetProgramInterfaceiv, isCallValid, context, program, programInterface, pname,
462                       params);
463     }
464 }
465 
GetProgramResourceIndex(GLuint program,GLenum programInterface,const GLchar * name)466 GLuint GL_APIENTRY GetProgramResourceIndex(GLuint program,
467                                            GLenum programInterface,
468                                            const GLchar *name)
469 {
470     EVENT("(GLuint program = %u, GLenum programInterface = %s, const GLchar *name = 0x%016" PRIxPTR
471           ")",
472           program, GLenumToString(GLenumGroup::ProgramInterface, programInterface),
473           (uintptr_t)name);
474 
475     Context *context = GetValidGlobalContext();
476     GLuint returnValue;
477     if (context)
478     {
479         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
480         bool isCallValid =
481             (context->skipValidation() ||
482              ValidateGetProgramResourceIndex(context, program, programInterface, name));
483         if (isCallValid)
484         {
485             returnValue = context->getProgramResourceIndex(program, programInterface, name);
486         }
487         else
488         {
489             returnValue = GetDefaultReturnValue<EntryPoint::GetProgramResourceIndex, GLuint>();
490         }
491         ANGLE_CAPTURE(GetProgramResourceIndex, isCallValid, context, program, programInterface,
492                       name, returnValue);
493     }
494     else
495     {
496         returnValue = GetDefaultReturnValue<EntryPoint::GetProgramResourceIndex, GLuint>();
497     }
498     return returnValue;
499 }
500 
GetProgramResourceLocation(GLuint program,GLenum programInterface,const GLchar * name)501 GLint GL_APIENTRY GetProgramResourceLocation(GLuint program,
502                                              GLenum programInterface,
503                                              const GLchar *name)
504 {
505     EVENT("(GLuint program = %u, GLenum programInterface = %s, const GLchar *name = 0x%016" PRIxPTR
506           ")",
507           program, GLenumToString(GLenumGroup::ProgramInterface, programInterface),
508           (uintptr_t)name);
509 
510     Context *context = GetValidGlobalContext();
511     GLint returnValue;
512     if (context)
513     {
514         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
515         bool isCallValid =
516             (context->skipValidation() ||
517              ValidateGetProgramResourceLocation(context, program, programInterface, name));
518         if (isCallValid)
519         {
520             returnValue = context->getProgramResourceLocation(program, programInterface, name);
521         }
522         else
523         {
524             returnValue = GetDefaultReturnValue<EntryPoint::GetProgramResourceLocation, GLint>();
525         }
526         ANGLE_CAPTURE(GetProgramResourceLocation, isCallValid, context, program, programInterface,
527                       name, returnValue);
528     }
529     else
530     {
531         returnValue = GetDefaultReturnValue<EntryPoint::GetProgramResourceLocation, GLint>();
532     }
533     return returnValue;
534 }
535 
GetProgramResourceLocationIndex(GLuint program,GLenum programInterface,const GLchar * name)536 GLint GL_APIENTRY GetProgramResourceLocationIndex(GLuint program,
537                                                   GLenum programInterface,
538                                                   const GLchar *name)
539 {
540     EVENT("(GLuint program = %u, GLenum programInterface = %s, const GLchar *name = 0x%016" PRIxPTR
541           ")",
542           program, GLenumToString(GLenumGroup::ProgramInterface, programInterface),
543           (uintptr_t)name);
544 
545     Context *context = GetValidGlobalContext();
546     GLint returnValue;
547     if (context)
548     {
549         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
550         bool isCallValid =
551             (context->skipValidation() ||
552              ValidateGetProgramResourceLocationIndex(context, program, programInterface, name));
553         if (isCallValid)
554         {
555             returnValue = context->getProgramResourceLocationIndex(program, programInterface, name);
556         }
557         else
558         {
559             returnValue =
560                 GetDefaultReturnValue<EntryPoint::GetProgramResourceLocationIndex, GLint>();
561         }
562         ANGLE_CAPTURE(GetProgramResourceLocationIndex, isCallValid, context, program,
563                       programInterface, name, returnValue);
564     }
565     else
566     {
567         returnValue = GetDefaultReturnValue<EntryPoint::GetProgramResourceLocationIndex, GLint>();
568     }
569     return returnValue;
570 }
571 
GetProgramResourceName(GLuint program,GLenum programInterface,GLuint index,GLsizei bufSize,GLsizei * length,GLchar * name)572 void GL_APIENTRY GetProgramResourceName(GLuint program,
573                                         GLenum programInterface,
574                                         GLuint index,
575                                         GLsizei bufSize,
576                                         GLsizei *length,
577                                         GLchar *name)
578 {
579     EVENT(
580         "(GLuint program = %u, GLenum programInterface = %s, GLuint index = %u, GLsizei bufSize = "
581         "%d, GLsizei *length = 0x%016" PRIxPTR ", GLchar *name = 0x%016" PRIxPTR ")",
582         program, GLenumToString(GLenumGroup::ProgramInterface, programInterface), index, bufSize,
583         (uintptr_t)length, (uintptr_t)name);
584 
585     Context *context = GetValidGlobalContext();
586     if (context)
587     {
588         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
589         bool isCallValid                              = (context->skipValidation() ||
590                             ValidateGetProgramResourceName(context, program, programInterface,
591                                                            index, bufSize, length, name));
592         if (isCallValid)
593         {
594             context->getProgramResourceName(program, programInterface, index, bufSize, length,
595                                             name);
596         }
597         ANGLE_CAPTURE(GetProgramResourceName, isCallValid, context, program, programInterface,
598                       index, bufSize, length, name);
599     }
600 }
601 
GetProgramResourceiv(GLuint program,GLenum programInterface,GLuint index,GLsizei propCount,const GLenum * props,GLsizei bufSize,GLsizei * length,GLint * params)602 void GL_APIENTRY GetProgramResourceiv(GLuint program,
603                                       GLenum programInterface,
604                                       GLuint index,
605                                       GLsizei propCount,
606                                       const GLenum *props,
607                                       GLsizei bufSize,
608                                       GLsizei *length,
609                                       GLint *params)
610 {
611     EVENT(
612         "(GLuint program = %u, GLenum programInterface = %s, GLuint index = %u, GLsizei propCount "
613         "= %d, const GLenum *props = 0x%016" PRIxPTR
614         ", GLsizei bufSize = %d, GLsizei *length = 0x%016" PRIxPTR
615         ", GLint *params = 0x%016" PRIxPTR ")",
616         program, GLenumToString(GLenumGroup::ProgramInterface, programInterface), index, propCount,
617         (uintptr_t)props, bufSize, (uintptr_t)length, (uintptr_t)params);
618 
619     Context *context = GetValidGlobalContext();
620     if (context)
621     {
622         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
623         bool isCallValid =
624             (context->skipValidation() ||
625              ValidateGetProgramResourceiv(context, program, programInterface, index, propCount,
626                                           props, bufSize, length, params));
627         if (isCallValid)
628         {
629             context->getProgramResourceiv(program, programInterface, index, propCount, props,
630                                           bufSize, length, params);
631         }
632         ANGLE_CAPTURE(GetProgramResourceiv, isCallValid, context, program, programInterface, index,
633                       propCount, props, bufSize, length, params);
634     }
635 }
636 
InvalidateBufferData(GLuint buffer)637 void GL_APIENTRY InvalidateBufferData(GLuint buffer)
638 {
639     EVENT("(GLuint buffer = %u)", buffer);
640 
641     Context *context = GetValidGlobalContext();
642     if (context)
643     {
644         BufferID bufferPacked                         = FromGL<BufferID>(buffer);
645         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
646         bool isCallValid =
647             (context->skipValidation() || ValidateInvalidateBufferData(context, bufferPacked));
648         if (isCallValid)
649         {
650             context->invalidateBufferData(bufferPacked);
651         }
652         ANGLE_CAPTURE(InvalidateBufferData, isCallValid, context, bufferPacked);
653     }
654 }
655 
InvalidateBufferSubData(GLuint buffer,GLintptr offset,GLsizeiptr length)656 void GL_APIENTRY InvalidateBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr length)
657 {
658     EVENT("(GLuint buffer = %u, GLintptr offset = %llu, GLsizeiptr length = %llu)", buffer,
659           static_cast<unsigned long long>(offset), static_cast<unsigned long long>(length));
660 
661     Context *context = GetValidGlobalContext();
662     if (context)
663     {
664         BufferID bufferPacked                         = FromGL<BufferID>(buffer);
665         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
666         bool isCallValid                              = (context->skipValidation() ||
667                             ValidateInvalidateBufferSubData(context, bufferPacked, offset, length));
668         if (isCallValid)
669         {
670             context->invalidateBufferSubData(bufferPacked, offset, length);
671         }
672         ANGLE_CAPTURE(InvalidateBufferSubData, isCallValid, context, bufferPacked, offset, length);
673     }
674 }
675 
InvalidateFramebuffer(GLenum target,GLsizei numAttachments,const GLenum * attachments)676 void GL_APIENTRY InvalidateFramebuffer(GLenum target,
677                                        GLsizei numAttachments,
678                                        const GLenum *attachments)
679 {
680     EVENT(
681         "(GLenum target = %s, GLsizei numAttachments = %d, const GLenum *attachments = "
682         "0x%016" PRIxPTR ")",
683         GLenumToString(GLenumGroup::FramebufferTarget, target), numAttachments,
684         (uintptr_t)attachments);
685 
686     Context *context = GetValidGlobalContext();
687     if (context)
688     {
689         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
690         bool isCallValid =
691             (context->skipValidation() ||
692              ValidateInvalidateFramebuffer(context, target, numAttachments, attachments));
693         if (isCallValid)
694         {
695             context->invalidateFramebuffer(target, numAttachments, attachments);
696         }
697         ANGLE_CAPTURE(InvalidateFramebuffer, isCallValid, context, target, numAttachments,
698                       attachments);
699     }
700 }
701 
InvalidateSubFramebuffer(GLenum target,GLsizei numAttachments,const GLenum * attachments,GLint x,GLint y,GLsizei width,GLsizei height)702 void GL_APIENTRY InvalidateSubFramebuffer(GLenum target,
703                                           GLsizei numAttachments,
704                                           const GLenum *attachments,
705                                           GLint x,
706                                           GLint y,
707                                           GLsizei width,
708                                           GLsizei height)
709 {
710     EVENT(
711         "(GLenum target = %s, GLsizei numAttachments = %d, const GLenum *attachments = "
712         "0x%016" PRIxPTR ", GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d)",
713         GLenumToString(GLenumGroup::DefaultGroup, target), numAttachments, (uintptr_t)attachments,
714         x, y, width, height);
715 
716     Context *context = GetValidGlobalContext();
717     if (context)
718     {
719         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
720         bool isCallValid                              = (context->skipValidation() ||
721                             ValidateInvalidateSubFramebuffer(context, target, numAttachments,
722                                                              attachments, x, y, width, height));
723         if (isCallValid)
724         {
725             context->invalidateSubFramebuffer(target, numAttachments, attachments, x, y, width,
726                                               height);
727         }
728         ANGLE_CAPTURE(InvalidateSubFramebuffer, isCallValid, context, target, numAttachments,
729                       attachments, x, y, width, height);
730     }
731 }
732 
InvalidateTexImage(GLuint texture,GLint level)733 void GL_APIENTRY InvalidateTexImage(GLuint texture, GLint level)
734 {
735     EVENT("(GLuint texture = %u, GLint level = %d)", texture, level);
736 
737     Context *context = GetValidGlobalContext();
738     if (context)
739     {
740         TextureID texturePacked                       = FromGL<TextureID>(texture);
741         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
742         bool isCallValid                              = (context->skipValidation() ||
743                             ValidateInvalidateTexImage(context, texturePacked, level));
744         if (isCallValid)
745         {
746             context->invalidateTexImage(texturePacked, level);
747         }
748         ANGLE_CAPTURE(InvalidateTexImage, isCallValid, context, texturePacked, level);
749     }
750 }
751 
InvalidateTexSubImage(GLuint texture,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth)752 void GL_APIENTRY InvalidateTexSubImage(GLuint texture,
753                                        GLint level,
754                                        GLint xoffset,
755                                        GLint yoffset,
756                                        GLint zoffset,
757                                        GLsizei width,
758                                        GLsizei height,
759                                        GLsizei depth)
760 {
761     EVENT(
762         "(GLuint texture = %u, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
763         "zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d)",
764         texture, level, xoffset, yoffset, zoffset, width, height, depth);
765 
766     Context *context = GetValidGlobalContext();
767     if (context)
768     {
769         TextureID texturePacked                       = FromGL<TextureID>(texture);
770         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
771         bool isCallValid                              = (context->skipValidation() ||
772                             ValidateInvalidateTexSubImage(context, texturePacked, level, xoffset,
773                                                           yoffset, zoffset, width, height, depth));
774         if (isCallValid)
775         {
776             context->invalidateTexSubImage(texturePacked, level, xoffset, yoffset, zoffset, width,
777                                            height, depth);
778         }
779         ANGLE_CAPTURE(InvalidateTexSubImage, isCallValid, context, texturePacked, level, xoffset,
780                       yoffset, zoffset, width, height, depth);
781     }
782 }
783 
MultiDrawArraysIndirect(GLenum mode,const void * indirect,GLsizei drawcount,GLsizei stride)784 void GL_APIENTRY MultiDrawArraysIndirect(GLenum mode,
785                                          const void *indirect,
786                                          GLsizei drawcount,
787                                          GLsizei stride)
788 {
789     EVENT("(GLenum mode = %s, const void *indirect = 0x%016" PRIxPTR
790           ", GLsizei drawcount = %d, GLsizei stride = %d)",
791           GLenumToString(GLenumGroup::PrimitiveType, mode), (uintptr_t)indirect, drawcount, stride);
792 
793     Context *context = GetValidGlobalContext();
794     if (context)
795     {
796         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
797         bool isCallValid =
798             (context->skipValidation() ||
799              ValidateMultiDrawArraysIndirect(context, mode, indirect, drawcount, stride));
800         if (isCallValid)
801         {
802             context->multiDrawArraysIndirect(mode, indirect, drawcount, stride);
803         }
804         ANGLE_CAPTURE(MultiDrawArraysIndirect, isCallValid, context, mode, indirect, drawcount,
805                       stride);
806     }
807 }
808 
MultiDrawElementsIndirect(GLenum mode,GLenum type,const void * indirect,GLsizei drawcount,GLsizei stride)809 void GL_APIENTRY MultiDrawElementsIndirect(GLenum mode,
810                                            GLenum type,
811                                            const void *indirect,
812                                            GLsizei drawcount,
813                                            GLsizei stride)
814 {
815     EVENT("(GLenum mode = %s, GLenum type = %s, const void *indirect = 0x%016" PRIxPTR
816           ", GLsizei drawcount = %d, GLsizei stride = %d)",
817           GLenumToString(GLenumGroup::PrimitiveType, mode),
818           GLenumToString(GLenumGroup::DrawElementsType, type), (uintptr_t)indirect, drawcount,
819           stride);
820 
821     Context *context = GetValidGlobalContext();
822     if (context)
823     {
824         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
825         bool isCallValid =
826             (context->skipValidation() ||
827              ValidateMultiDrawElementsIndirect(context, mode, type, indirect, drawcount, stride));
828         if (isCallValid)
829         {
830             context->multiDrawElementsIndirect(mode, type, indirect, drawcount, stride);
831         }
832         ANGLE_CAPTURE(MultiDrawElementsIndirect, isCallValid, context, mode, type, indirect,
833                       drawcount, stride);
834     }
835 }
836 
ObjectLabel(GLenum identifier,GLuint name,GLsizei length,const GLchar * label)837 void GL_APIENTRY ObjectLabel(GLenum identifier, GLuint name, GLsizei length, const GLchar *label)
838 {
839     EVENT(
840         "(GLenum identifier = %s, GLuint name = %u, GLsizei length = %d, const GLchar *label = "
841         "0x%016" PRIxPTR ")",
842         GLenumToString(GLenumGroup::ObjectIdentifier, identifier), name, length, (uintptr_t)label);
843 
844     Context *context = GetValidGlobalContext();
845     if (context)
846     {
847         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
848         bool isCallValid                              = (context->skipValidation() ||
849                             ValidateObjectLabel(context, identifier, name, length, label));
850         if (isCallValid)
851         {
852             context->objectLabel(identifier, name, length, label);
853         }
854         ANGLE_CAPTURE(ObjectLabel, isCallValid, context, identifier, name, length, label);
855     }
856 }
857 
ObjectPtrLabel(const void * ptr,GLsizei length,const GLchar * label)858 void GL_APIENTRY ObjectPtrLabel(const void *ptr, GLsizei length, const GLchar *label)
859 {
860     EVENT("(const void *ptr = 0x%016" PRIxPTR
861           ", GLsizei length = %d, const GLchar *label = 0x%016" PRIxPTR ")",
862           (uintptr_t)ptr, length, (uintptr_t)label);
863 
864     Context *context = GetValidGlobalContext();
865     if (context)
866     {
867         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
868         bool isCallValid =
869             (context->skipValidation() || ValidateObjectPtrLabel(context, ptr, length, label));
870         if (isCallValid)
871         {
872             context->objectPtrLabel(ptr, length, label);
873         }
874         ANGLE_CAPTURE(ObjectPtrLabel, isCallValid, context, ptr, length, label);
875     }
876 }
877 
PopDebugGroup()878 void GL_APIENTRY PopDebugGroup()
879 {
880     EVENT("()");
881 
882     Context *context = GetValidGlobalContext();
883     if (context)
884     {
885         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
886         bool isCallValid = (context->skipValidation() || ValidatePopDebugGroup(context));
887         if (isCallValid)
888         {
889             context->popDebugGroup();
890         }
891         ANGLE_CAPTURE(PopDebugGroup, isCallValid, context);
892     }
893 }
894 
PushDebugGroup(GLenum source,GLuint id,GLsizei length,const GLchar * message)895 void GL_APIENTRY PushDebugGroup(GLenum source, GLuint id, GLsizei length, const GLchar *message)
896 {
897     EVENT(
898         "(GLenum source = %s, GLuint id = %u, GLsizei length = %d, const GLchar *message = "
899         "0x%016" PRIxPTR ")",
900         GLenumToString(GLenumGroup::DebugSource, source), id, length, (uintptr_t)message);
901 
902     Context *context = GetValidGlobalContext();
903     if (context)
904     {
905         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
906         bool isCallValid                              = (context->skipValidation() ||
907                             ValidatePushDebugGroup(context, source, id, length, message));
908         if (isCallValid)
909         {
910             context->pushDebugGroup(source, id, length, message);
911         }
912         ANGLE_CAPTURE(PushDebugGroup, isCallValid, context, source, id, length, message);
913     }
914 }
915 
ShaderStorageBlockBinding(GLuint program,GLuint storageBlockIndex,GLuint storageBlockBinding)916 void GL_APIENTRY ShaderStorageBlockBinding(GLuint program,
917                                            GLuint storageBlockIndex,
918                                            GLuint storageBlockBinding)
919 {
920     EVENT("(GLuint program = %u, GLuint storageBlockIndex = %u, GLuint storageBlockBinding = %u)",
921           program, storageBlockIndex, storageBlockBinding);
922 
923     Context *context = GetValidGlobalContext();
924     if (context)
925     {
926         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
927         bool isCallValid                              = (context->skipValidation() ||
928                             ValidateShaderStorageBlockBinding(context, program, storageBlockIndex,
929                                                               storageBlockBinding));
930         if (isCallValid)
931         {
932             context->shaderStorageBlockBinding(program, storageBlockIndex, storageBlockBinding);
933         }
934         ANGLE_CAPTURE(ShaderStorageBlockBinding, isCallValid, context, program, storageBlockIndex,
935                       storageBlockBinding);
936     }
937 }
938 
TexBufferRange(GLenum target,GLenum internalformat,GLuint buffer,GLintptr offset,GLsizeiptr size)939 void GL_APIENTRY TexBufferRange(GLenum target,
940                                 GLenum internalformat,
941                                 GLuint buffer,
942                                 GLintptr offset,
943                                 GLsizeiptr size)
944 {
945     EVENT(
946         "(GLenum target = %s, GLenum internalformat = %s, GLuint buffer = %u, GLintptr offset = "
947         "%llu, GLsizeiptr size = %llu)",
948         GLenumToString(GLenumGroup::TextureTarget, target),
949         GLenumToString(GLenumGroup::InternalFormat, internalformat), buffer,
950         static_cast<unsigned long long>(offset), static_cast<unsigned long long>(size));
951 
952     Context *context = GetValidGlobalContext();
953     if (context)
954     {
955         BufferID bufferPacked                         = FromGL<BufferID>(buffer);
956         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
957         bool isCallValid =
958             (context->skipValidation() ||
959              ValidateTexBufferRange(context, target, internalformat, bufferPacked, offset, size));
960         if (isCallValid)
961         {
962             context->texBufferRange(target, internalformat, bufferPacked, offset, size);
963         }
964         ANGLE_CAPTURE(TexBufferRange, isCallValid, context, target, internalformat, bufferPacked,
965                       offset, size);
966     }
967 }
968 
TexStorage2DMultisample(GLenum target,GLsizei samples,GLenum internalformat,GLsizei width,GLsizei height,GLboolean fixedsamplelocations)969 void GL_APIENTRY TexStorage2DMultisample(GLenum target,
970                                          GLsizei samples,
971                                          GLenum internalformat,
972                                          GLsizei width,
973                                          GLsizei height,
974                                          GLboolean fixedsamplelocations)
975 {
976     EVENT(
977         "(GLenum target = %s, GLsizei samples = %d, GLenum internalformat = %s, GLsizei width = "
978         "%d, GLsizei height = %d, GLboolean fixedsamplelocations = %s)",
979         GLenumToString(GLenumGroup::TextureTarget, target), samples,
980         GLenumToString(GLenumGroup::InternalFormat, internalformat), width, height,
981         GLbooleanToString(fixedsamplelocations));
982 
983     Context *context = GetValidGlobalContext();
984     if (context)
985     {
986         TextureType targetPacked                      = FromGL<TextureType>(target);
987         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
988         bool isCallValid =
989             (context->skipValidation() ||
990              ValidateTexStorage2DMultisample(context, targetPacked, samples, internalformat, width,
991                                              height, fixedsamplelocations));
992         if (isCallValid)
993         {
994             context->texStorage2DMultisample(targetPacked, samples, internalformat, width, height,
995                                              fixedsamplelocations);
996         }
997         ANGLE_CAPTURE(TexStorage2DMultisample, isCallValid, context, targetPacked, samples,
998                       internalformat, width, height, fixedsamplelocations);
999     }
1000 }
1001 
TexStorage3DMultisample(GLenum target,GLsizei samples,GLenum internalformat,GLsizei width,GLsizei height,GLsizei depth,GLboolean fixedsamplelocations)1002 void GL_APIENTRY TexStorage3DMultisample(GLenum target,
1003                                          GLsizei samples,
1004                                          GLenum internalformat,
1005                                          GLsizei width,
1006                                          GLsizei height,
1007                                          GLsizei depth,
1008                                          GLboolean fixedsamplelocations)
1009 {
1010     EVENT(
1011         "(GLenum target = %s, GLsizei samples = %d, GLenum internalformat = %s, GLsizei width = "
1012         "%d, GLsizei height = %d, GLsizei depth = %d, GLboolean fixedsamplelocations = %s)",
1013         GLenumToString(GLenumGroup::TextureTarget, target), samples,
1014         GLenumToString(GLenumGroup::InternalFormat, internalformat), width, height, depth,
1015         GLbooleanToString(fixedsamplelocations));
1016 
1017     Context *context = GetValidGlobalContext();
1018     if (context)
1019     {
1020         TextureType targetPacked                      = FromGL<TextureType>(target);
1021         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
1022         bool isCallValid =
1023             (context->skipValidation() ||
1024              ValidateTexStorage3DMultisample(context, targetPacked, samples, internalformat, width,
1025                                              height, depth, fixedsamplelocations));
1026         if (isCallValid)
1027         {
1028             context->texStorage3DMultisample(targetPacked, samples, internalformat, width, height,
1029                                              depth, fixedsamplelocations);
1030         }
1031         ANGLE_CAPTURE(TexStorage3DMultisample, isCallValid, context, targetPacked, samples,
1032                       internalformat, width, height, depth, fixedsamplelocations);
1033     }
1034 }
1035 
TextureView(GLuint texture,GLenum target,GLuint origtexture,GLenum internalformat,GLuint minlevel,GLuint numlevels,GLuint minlayer,GLuint numlayers)1036 void GL_APIENTRY TextureView(GLuint texture,
1037                              GLenum target,
1038                              GLuint origtexture,
1039                              GLenum internalformat,
1040                              GLuint minlevel,
1041                              GLuint numlevels,
1042                              GLuint minlayer,
1043                              GLuint numlayers)
1044 {
1045     EVENT(
1046         "(GLuint texture = %u, GLenum target = %s, GLuint origtexture = %u, GLenum internalformat "
1047         "= %s, GLuint minlevel = %u, GLuint numlevels = %u, GLuint minlayer = %u, GLuint numlayers "
1048         "= %u)",
1049         texture, GLenumToString(GLenumGroup::TextureTarget, target), origtexture,
1050         GLenumToString(GLenumGroup::InternalFormat, internalformat), minlevel, numlevels, minlayer,
1051         numlayers);
1052 
1053     Context *context = GetValidGlobalContext();
1054     if (context)
1055     {
1056         TextureID texturePacked                       = FromGL<TextureID>(texture);
1057         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
1058         bool isCallValid =
1059             (context->skipValidation() ||
1060              ValidateTextureView(context, texturePacked, target, origtexture, internalformat,
1061                                  minlevel, numlevels, minlayer, numlayers));
1062         if (isCallValid)
1063         {
1064             context->textureView(texturePacked, target, origtexture, internalformat, minlevel,
1065                                  numlevels, minlayer, numlayers);
1066         }
1067         ANGLE_CAPTURE(TextureView, isCallValid, context, texturePacked, target, origtexture,
1068                       internalformat, minlevel, numlevels, minlayer, numlayers);
1069     }
1070 }
1071 
VertexAttribBinding(GLuint attribindex,GLuint bindingindex)1072 void GL_APIENTRY VertexAttribBinding(GLuint attribindex, GLuint bindingindex)
1073 {
1074     EVENT("(GLuint attribindex = %u, GLuint bindingindex = %u)", attribindex, bindingindex);
1075 
1076     Context *context = GetValidGlobalContext();
1077     if (context)
1078     {
1079         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
1080         bool isCallValid                              = (context->skipValidation() ||
1081                             ValidateVertexAttribBinding(context, attribindex, bindingindex));
1082         if (isCallValid)
1083         {
1084             context->vertexAttribBinding(attribindex, bindingindex);
1085         }
1086         ANGLE_CAPTURE(VertexAttribBinding, isCallValid, context, attribindex, bindingindex);
1087     }
1088 }
1089 
VertexAttribFormat(GLuint attribindex,GLint size,GLenum type,GLboolean normalized,GLuint relativeoffset)1090 void GL_APIENTRY VertexAttribFormat(GLuint attribindex,
1091                                     GLint size,
1092                                     GLenum type,
1093                                     GLboolean normalized,
1094                                     GLuint relativeoffset)
1095 {
1096     EVENT(
1097         "(GLuint attribindex = %u, GLint size = %d, GLenum type = %s, GLboolean normalized = %s, "
1098         "GLuint relativeoffset = %u)",
1099         attribindex, size, GLenumToString(GLenumGroup::DefaultGroup, type),
1100         GLbooleanToString(normalized), relativeoffset);
1101 
1102     Context *context = GetValidGlobalContext();
1103     if (context)
1104     {
1105         VertexAttribType typePacked                   = FromGL<VertexAttribType>(type);
1106         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
1107         bool isCallValid                              = (context->skipValidation() ||
1108                             ValidateVertexAttribFormat(context, attribindex, size, typePacked,
1109                                                        normalized, relativeoffset));
1110         if (isCallValid)
1111         {
1112             context->vertexAttribFormat(attribindex, size, typePacked, normalized, relativeoffset);
1113         }
1114         ANGLE_CAPTURE(VertexAttribFormat, isCallValid, context, attribindex, size, typePacked,
1115                       normalized, relativeoffset);
1116     }
1117 }
1118 
VertexAttribIFormat(GLuint attribindex,GLint size,GLenum type,GLuint relativeoffset)1119 void GL_APIENTRY VertexAttribIFormat(GLuint attribindex,
1120                                      GLint size,
1121                                      GLenum type,
1122                                      GLuint relativeoffset)
1123 {
1124     EVENT(
1125         "(GLuint attribindex = %u, GLint size = %d, GLenum type = %s, GLuint relativeoffset = %u)",
1126         attribindex, size, GLenumToString(GLenumGroup::DefaultGroup, type), relativeoffset);
1127 
1128     Context *context = GetValidGlobalContext();
1129     if (context)
1130     {
1131         VertexAttribType typePacked                   = FromGL<VertexAttribType>(type);
1132         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
1133         bool isCallValid =
1134             (context->skipValidation() ||
1135              ValidateVertexAttribIFormat(context, attribindex, size, typePacked, relativeoffset));
1136         if (isCallValid)
1137         {
1138             context->vertexAttribIFormat(attribindex, size, typePacked, relativeoffset);
1139         }
1140         ANGLE_CAPTURE(VertexAttribIFormat, isCallValid, context, attribindex, size, typePacked,
1141                       relativeoffset);
1142     }
1143 }
1144 
VertexAttribLFormat(GLuint attribindex,GLint size,GLenum type,GLuint relativeoffset)1145 void GL_APIENTRY VertexAttribLFormat(GLuint attribindex,
1146                                      GLint size,
1147                                      GLenum type,
1148                                      GLuint relativeoffset)
1149 {
1150     EVENT(
1151         "(GLuint attribindex = %u, GLint size = %d, GLenum type = %s, GLuint relativeoffset = %u)",
1152         attribindex, size, GLenumToString(GLenumGroup::VertexAttribType, type), relativeoffset);
1153 
1154     Context *context = GetValidGlobalContext();
1155     if (context)
1156     {
1157         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
1158         bool isCallValid =
1159             (context->skipValidation() ||
1160              ValidateVertexAttribLFormat(context, attribindex, size, type, relativeoffset));
1161         if (isCallValid)
1162         {
1163             context->vertexAttribLFormat(attribindex, size, type, relativeoffset);
1164         }
1165         ANGLE_CAPTURE(VertexAttribLFormat, isCallValid, context, attribindex, size, type,
1166                       relativeoffset);
1167     }
1168 }
1169 
VertexBindingDivisor(GLuint bindingindex,GLuint divisor)1170 void GL_APIENTRY VertexBindingDivisor(GLuint bindingindex, GLuint divisor)
1171 {
1172     EVENT("(GLuint bindingindex = %u, GLuint divisor = %u)", bindingindex, divisor);
1173 
1174     Context *context = GetValidGlobalContext();
1175     if (context)
1176     {
1177         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
1178         bool isCallValid                              = (context->skipValidation() ||
1179                             ValidateVertexBindingDivisor(context, bindingindex, divisor));
1180         if (isCallValid)
1181         {
1182             context->vertexBindingDivisor(bindingindex, divisor);
1183         }
1184         ANGLE_CAPTURE(VertexBindingDivisor, isCallValid, context, bindingindex, divisor);
1185     }
1186 }
1187 }  // namespace gl
1188