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