~mmach/netext73/webkit2gtk

« back to all changes in this revision

Viewing changes to Source/ThirdParty/ANGLE/src/libGL/entry_points_gl_4_5_autogen.cpp

  • Committer: mmach
  • Date: 2023-06-16 17:21:37 UTC
  • Revision ID: netbit73@gmail.com-20230616172137-2rqx6yr96ga9g3kp
1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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_5_autogen.cpp:
 
9
//   Defines the GL 4.5 entry points.
 
10
 
 
11
#include "libGL/entry_points_gl_4_5_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/validationGL45_autogen.h"
 
26
#include "libGLESv2/global_state.h"
 
27
 
 
28
namespace gl
 
29
{
 
30
void GL_APIENTRY BindTextureUnit(GLuint unit, GLuint texture)
 
31
{
 
32
    Context *context = GetValidGlobalContext();
 
33
    EVENT("glBindTextureUnit", "context = %d, GLuint unit = %u, GLuint texture = %u", CID(context),
 
34
          unit, texture);
 
35
 
 
36
    if (context)
 
37
    {
 
38
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
39
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
40
        bool isCallValid =
 
41
            (context->skipValidation() || ValidateBindTextureUnit(context, unit, texturePacked));
 
42
        if (isCallValid)
 
43
        {
 
44
            context->bindTextureUnit(unit, texturePacked);
 
45
        }
 
46
        ANGLE_CAPTURE(BindTextureUnit, isCallValid, context, unit, texturePacked);
 
47
    }
 
48
}
 
49
 
 
50
void GL_APIENTRY BlitNamedFramebuffer(GLuint readFramebuffer,
 
51
                                      GLuint drawFramebuffer,
 
52
                                      GLint srcX0,
 
53
                                      GLint srcY0,
 
54
                                      GLint srcX1,
 
55
                                      GLint srcY1,
 
56
                                      GLint dstX0,
 
57
                                      GLint dstY0,
 
58
                                      GLint dstX1,
 
59
                                      GLint dstY1,
 
60
                                      GLbitfield mask,
 
61
                                      GLenum filter)
 
62
{
 
63
    Context *context = GetValidGlobalContext();
 
64
    EVENT("glBlitNamedFramebuffer",
 
65
          "context = %d, GLuint readFramebuffer = %u, GLuint drawFramebuffer = %u, GLint srcX0 = "
 
66
          "%d, GLint srcY0 = %d, GLint srcX1 = %d, GLint srcY1 = %d, GLint dstX0 = %d, GLint dstY0 "
 
67
          "= %d, GLint dstX1 = %d, GLint dstY1 = %d, GLbitfield mask = %s, GLenum filter = %s",
 
68
          CID(context), readFramebuffer, drawFramebuffer, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0,
 
69
          dstX1, dstY1, GLbitfieldToString(GLenumGroup::ClearBufferMask, mask).c_str(),
 
70
          GLenumToString(GLenumGroup::BlitFramebufferFilter, filter));
 
71
 
 
72
    if (context)
 
73
    {
 
74
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
75
        bool isCallValid =
 
76
            (context->skipValidation() ||
 
77
             ValidateBlitNamedFramebuffer(context, readFramebuffer, drawFramebuffer, srcX0, srcY0,
 
78
                                          srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
 
79
        if (isCallValid)
 
80
        {
 
81
            context->blitNamedFramebuffer(readFramebuffer, drawFramebuffer, srcX0, srcY0, srcX1,
 
82
                                          srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
 
83
        }
 
84
        ANGLE_CAPTURE(BlitNamedFramebuffer, isCallValid, context, readFramebuffer, drawFramebuffer,
 
85
                      srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
 
86
    }
 
87
}
 
88
 
 
89
GLenum GL_APIENTRY CheckNamedFramebufferStatus(GLuint framebuffer, GLenum target)
 
90
{
 
91
    Context *context = GetValidGlobalContext();
 
92
    EVENT("glCheckNamedFramebufferStatus",
 
93
          "context = %d, GLuint framebuffer = %u, GLenum target = %s", CID(context), framebuffer,
 
94
          GLenumToString(GLenumGroup::FramebufferTarget, target));
 
95
 
 
96
    GLenum returnValue;
 
97
    if (context)
 
98
    {
 
99
        FramebufferID framebufferPacked               = FromGL<FramebufferID>(framebuffer);
 
100
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
101
        bool isCallValid = (context->skipValidation() || ValidateCheckNamedFramebufferStatus(
 
102
                                                             context, framebufferPacked, target));
 
103
        if (isCallValid)
 
104
        {
 
105
            returnValue = context->checkNamedFramebufferStatus(framebufferPacked, target);
 
106
        }
 
107
        else
 
108
        {
 
109
            returnValue = GetDefaultReturnValue<EntryPoint::CheckNamedFramebufferStatus, GLenum>();
 
110
        }
 
111
        ANGLE_CAPTURE(CheckNamedFramebufferStatus, isCallValid, context, framebufferPacked, target,
 
112
                      returnValue);
 
113
    }
 
114
    else
 
115
    {
 
116
        returnValue = GetDefaultReturnValue<EntryPoint::CheckNamedFramebufferStatus, GLenum>();
 
117
    }
 
118
    return returnValue;
 
119
}
 
120
 
 
121
void GL_APIENTRY ClearNamedBufferData(GLuint buffer,
 
122
                                      GLenum internalformat,
 
123
                                      GLenum format,
 
124
                                      GLenum type,
 
125
                                      const void *data)
 
126
{
 
127
    Context *context = GetValidGlobalContext();
 
128
    EVENT("glClearNamedBufferData",
 
129
          "context = %d, GLuint buffer = %u, GLenum internalformat = %s, GLenum format = %s, "
 
130
          "GLenum type = %s, const void *data = 0x%016" PRIxPTR "",
 
131
          CID(context), buffer, GLenumToString(GLenumGroup::InternalFormat, internalformat),
 
132
          GLenumToString(GLenumGroup::PixelFormat, format),
 
133
          GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)data);
 
134
 
 
135
    if (context)
 
136
    {
 
137
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
138
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
139
        bool isCallValid                              = (context->skipValidation() ||
 
140
                            ValidateClearNamedBufferData(context, bufferPacked, internalformat,
 
141
                                                         format, type, data));
 
142
        if (isCallValid)
 
143
        {
 
144
            context->clearNamedBufferData(bufferPacked, internalformat, format, type, data);
 
145
        }
 
146
        ANGLE_CAPTURE(ClearNamedBufferData, isCallValid, context, bufferPacked, internalformat,
 
147
                      format, type, data);
 
148
    }
 
149
}
 
150
 
 
151
void GL_APIENTRY ClearNamedBufferSubData(GLuint buffer,
 
152
                                         GLenum internalformat,
 
153
                                         GLintptr offset,
 
154
                                         GLsizeiptr size,
 
155
                                         GLenum format,
 
156
                                         GLenum type,
 
157
                                         const void *data)
 
158
{
 
159
    Context *context = GetValidGlobalContext();
 
160
    EVENT("glClearNamedBufferSubData",
 
161
          "context = %d, GLuint buffer = %u, GLenum internalformat = %s, GLintptr offset = %llu, "
 
162
          "GLsizeiptr size = %llu, GLenum format = %s, GLenum type = %s, const void *data = "
 
163
          "0x%016" PRIxPTR "",
 
164
          CID(context), buffer, GLenumToString(GLenumGroup::InternalFormat, internalformat),
 
165
          static_cast<unsigned long long>(offset), static_cast<unsigned long long>(size),
 
166
          GLenumToString(GLenumGroup::PixelFormat, format),
 
167
          GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)data);
 
168
 
 
169
    if (context)
 
170
    {
 
171
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
172
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
173
        bool isCallValid                              = (context->skipValidation() ||
 
174
                            ValidateClearNamedBufferSubData(context, bufferPacked, internalformat,
 
175
                                                            offset, size, format, type, data));
 
176
        if (isCallValid)
 
177
        {
 
178
            context->clearNamedBufferSubData(bufferPacked, internalformat, offset, size, format,
 
179
                                             type, data);
 
180
        }
 
181
        ANGLE_CAPTURE(ClearNamedBufferSubData, isCallValid, context, bufferPacked, internalformat,
 
182
                      offset, size, format, type, data);
 
183
    }
 
184
}
 
185
 
 
186
void GL_APIENTRY ClearNamedFramebufferfi(GLuint framebuffer,
 
187
                                         GLenum buffer,
 
188
                                         GLint drawbuffer,
 
189
                                         GLfloat depth,
 
190
                                         GLint stencil)
 
191
{
 
192
    Context *context = GetValidGlobalContext();
 
193
    EVENT("glClearNamedFramebufferfi",
 
194
          "context = %d, GLuint framebuffer = %u, GLenum buffer = %s, GLint drawbuffer = %d, "
 
195
          "GLfloat depth = %f, GLint stencil = %d",
 
196
          CID(context), framebuffer, GLenumToString(GLenumGroup::Buffer, buffer), drawbuffer, depth,
 
197
          stencil);
 
198
 
 
199
    if (context)
 
200
    {
 
201
        FramebufferID framebufferPacked               = FromGL<FramebufferID>(framebuffer);
 
202
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
203
        bool isCallValid                              = (context->skipValidation() ||
 
204
                            ValidateClearNamedFramebufferfi(context, framebufferPacked, buffer,
 
205
                                                            drawbuffer, depth, stencil));
 
206
        if (isCallValid)
 
207
        {
 
208
            context->clearNamedFramebufferfi(framebufferPacked, buffer, drawbuffer, depth, stencil);
 
209
        }
 
210
        ANGLE_CAPTURE(ClearNamedFramebufferfi, isCallValid, context, framebufferPacked, buffer,
 
211
                      drawbuffer, depth, stencil);
 
212
    }
 
213
}
 
214
 
 
215
void GL_APIENTRY ClearNamedFramebufferfv(GLuint framebuffer,
 
216
                                         GLenum buffer,
 
217
                                         GLint drawbuffer,
 
218
                                         const GLfloat *value)
 
219
{
 
220
    Context *context = GetValidGlobalContext();
 
221
    EVENT("glClearNamedFramebufferfv",
 
222
          "context = %d, GLuint framebuffer = %u, GLenum buffer = %s, GLint drawbuffer = %d, const "
 
223
          "GLfloat *value = 0x%016" PRIxPTR "",
 
224
          CID(context), framebuffer, GLenumToString(GLenumGroup::Buffer, buffer), drawbuffer,
 
225
          (uintptr_t)value);
 
226
 
 
227
    if (context)
 
228
    {
 
229
        FramebufferID framebufferPacked               = FromGL<FramebufferID>(framebuffer);
 
230
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
231
        bool isCallValid                              = (context->skipValidation() ||
 
232
                            ValidateClearNamedFramebufferfv(context, framebufferPacked, buffer,
 
233
                                                            drawbuffer, value));
 
234
        if (isCallValid)
 
235
        {
 
236
            context->clearNamedFramebufferfv(framebufferPacked, buffer, drawbuffer, value);
 
237
        }
 
238
        ANGLE_CAPTURE(ClearNamedFramebufferfv, isCallValid, context, framebufferPacked, buffer,
 
239
                      drawbuffer, value);
 
240
    }
 
241
}
 
242
 
 
243
void GL_APIENTRY ClearNamedFramebufferiv(GLuint framebuffer,
 
244
                                         GLenum buffer,
 
245
                                         GLint drawbuffer,
 
246
                                         const GLint *value)
 
247
{
 
248
    Context *context = GetValidGlobalContext();
 
249
    EVENT("glClearNamedFramebufferiv",
 
250
          "context = %d, GLuint framebuffer = %u, GLenum buffer = %s, GLint drawbuffer = %d, const "
 
251
          "GLint *value = 0x%016" PRIxPTR "",
 
252
          CID(context), framebuffer, GLenumToString(GLenumGroup::Buffer, buffer), drawbuffer,
 
253
          (uintptr_t)value);
 
254
 
 
255
    if (context)
 
256
    {
 
257
        FramebufferID framebufferPacked               = FromGL<FramebufferID>(framebuffer);
 
258
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
259
        bool isCallValid                              = (context->skipValidation() ||
 
260
                            ValidateClearNamedFramebufferiv(context, framebufferPacked, buffer,
 
261
                                                            drawbuffer, value));
 
262
        if (isCallValid)
 
263
        {
 
264
            context->clearNamedFramebufferiv(framebufferPacked, buffer, drawbuffer, value);
 
265
        }
 
266
        ANGLE_CAPTURE(ClearNamedFramebufferiv, isCallValid, context, framebufferPacked, buffer,
 
267
                      drawbuffer, value);
 
268
    }
 
269
}
 
270
 
 
271
void GL_APIENTRY ClearNamedFramebufferuiv(GLuint framebuffer,
 
272
                                          GLenum buffer,
 
273
                                          GLint drawbuffer,
 
274
                                          const GLuint *value)
 
275
{
 
276
    Context *context = GetValidGlobalContext();
 
277
    EVENT("glClearNamedFramebufferuiv",
 
278
          "context = %d, GLuint framebuffer = %u, GLenum buffer = %s, GLint drawbuffer = %d, const "
 
279
          "GLuint *value = 0x%016" PRIxPTR "",
 
280
          CID(context), framebuffer, GLenumToString(GLenumGroup::Buffer, buffer), drawbuffer,
 
281
          (uintptr_t)value);
 
282
 
 
283
    if (context)
 
284
    {
 
285
        FramebufferID framebufferPacked               = FromGL<FramebufferID>(framebuffer);
 
286
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
287
        bool isCallValid                              = (context->skipValidation() ||
 
288
                            ValidateClearNamedFramebufferuiv(context, framebufferPacked, buffer,
 
289
                                                             drawbuffer, value));
 
290
        if (isCallValid)
 
291
        {
 
292
            context->clearNamedFramebufferuiv(framebufferPacked, buffer, drawbuffer, value);
 
293
        }
 
294
        ANGLE_CAPTURE(ClearNamedFramebufferuiv, isCallValid, context, framebufferPacked, buffer,
 
295
                      drawbuffer, value);
 
296
    }
 
297
}
 
298
 
 
299
void GL_APIENTRY ClipControl(GLenum origin, GLenum depth)
 
300
{
 
301
    Context *context = GetValidGlobalContext();
 
302
    EVENT("glClipControl", "context = %d, GLenum origin = %s, GLenum depth = %s", CID(context),
 
303
          GLenumToString(GLenumGroup::ClipControlOrigin, origin),
 
304
          GLenumToString(GLenumGroup::ClipControlDepth, depth));
 
305
 
 
306
    if (context)
 
307
    {
 
308
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
309
        bool isCallValid =
 
310
            (context->skipValidation() || ValidateClipControl(context, origin, depth));
 
311
        if (isCallValid)
 
312
        {
 
313
            context->clipControl(origin, depth);
 
314
        }
 
315
        ANGLE_CAPTURE(ClipControl, isCallValid, context, origin, depth);
 
316
    }
 
317
}
 
318
 
 
319
void GL_APIENTRY CompressedTextureSubImage1D(GLuint texture,
 
320
                                             GLint level,
 
321
                                             GLint xoffset,
 
322
                                             GLsizei width,
 
323
                                             GLenum format,
 
324
                                             GLsizei imageSize,
 
325
                                             const void *data)
 
326
{
 
327
    Context *context = GetValidGlobalContext();
 
328
    EVENT("glCompressedTextureSubImage1D",
 
329
          "context = %d, GLuint texture = %u, GLint level = %d, GLint xoffset = %d, GLsizei width "
 
330
          "= %d, GLenum format = %s, GLsizei imageSize = %d, const void *data = 0x%016" PRIxPTR "",
 
331
          CID(context), texture, level, xoffset, width,
 
332
          GLenumToString(GLenumGroup::PixelFormat, format), imageSize, (uintptr_t)data);
 
333
 
 
334
    if (context)
 
335
    {
 
336
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
337
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
338
        bool isCallValid = (context->skipValidation() || ValidateCompressedTextureSubImage1D(
 
339
                                                             context, texturePacked, level, xoffset,
 
340
                                                             width, format, imageSize, data));
 
341
        if (isCallValid)
 
342
        {
 
343
            context->compressedTextureSubImage1D(texturePacked, level, xoffset, width, format,
 
344
                                                 imageSize, data);
 
345
        }
 
346
        ANGLE_CAPTURE(CompressedTextureSubImage1D, isCallValid, context, texturePacked, level,
 
347
                      xoffset, width, format, imageSize, data);
 
348
    }
 
349
}
 
350
 
 
351
void GL_APIENTRY CompressedTextureSubImage2D(GLuint texture,
 
352
                                             GLint level,
 
353
                                             GLint xoffset,
 
354
                                             GLint yoffset,
 
355
                                             GLsizei width,
 
356
                                             GLsizei height,
 
357
                                             GLenum format,
 
358
                                             GLsizei imageSize,
 
359
                                             const void *data)
 
360
{
 
361
    Context *context = GetValidGlobalContext();
 
362
    EVENT("glCompressedTextureSubImage2D",
 
363
          "context = %d, GLuint texture = %u, GLint level = %d, GLint xoffset = %d, GLint yoffset "
 
364
          "= %d, GLsizei width = %d, GLsizei height = %d, GLenum format = %s, GLsizei imageSize = "
 
365
          "%d, const void *data = 0x%016" PRIxPTR "",
 
366
          CID(context), texture, level, xoffset, yoffset, width, height,
 
367
          GLenumToString(GLenumGroup::PixelFormat, format), imageSize, (uintptr_t)data);
 
368
 
 
369
    if (context)
 
370
    {
 
371
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
372
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
373
        bool isCallValid =
 
374
            (context->skipValidation() ||
 
375
             ValidateCompressedTextureSubImage2D(context, texturePacked, level, xoffset, yoffset,
 
376
                                                 width, height, format, imageSize, data));
 
377
        if (isCallValid)
 
378
        {
 
379
            context->compressedTextureSubImage2D(texturePacked, level, xoffset, yoffset, width,
 
380
                                                 height, format, imageSize, data);
 
381
        }
 
382
        ANGLE_CAPTURE(CompressedTextureSubImage2D, isCallValid, context, texturePacked, level,
 
383
                      xoffset, yoffset, width, height, format, imageSize, data);
 
384
    }
 
385
}
 
386
 
 
387
void GL_APIENTRY CompressedTextureSubImage3D(GLuint texture,
 
388
                                             GLint level,
 
389
                                             GLint xoffset,
 
390
                                             GLint yoffset,
 
391
                                             GLint zoffset,
 
392
                                             GLsizei width,
 
393
                                             GLsizei height,
 
394
                                             GLsizei depth,
 
395
                                             GLenum format,
 
396
                                             GLsizei imageSize,
 
397
                                             const void *data)
 
398
{
 
399
    Context *context = GetValidGlobalContext();
 
400
    EVENT("glCompressedTextureSubImage3D",
 
401
          "context = %d, GLuint texture = %u, GLint level = %d, GLint xoffset = %d, GLint yoffset "
 
402
          "= %d, GLint zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, "
 
403
          "GLenum format = %s, GLsizei imageSize = %d, const void *data = 0x%016" PRIxPTR "",
 
404
          CID(context), texture, level, xoffset, yoffset, zoffset, width, height, depth,
 
405
          GLenumToString(GLenumGroup::PixelFormat, format), imageSize, (uintptr_t)data);
 
406
 
 
407
    if (context)
 
408
    {
 
409
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
410
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
411
        bool isCallValid                              = (context->skipValidation() ||
 
412
                            ValidateCompressedTextureSubImage3D(
 
413
                                context, texturePacked, level, xoffset, yoffset, zoffset, width,
 
414
                                height, depth, format, imageSize, data));
 
415
        if (isCallValid)
 
416
        {
 
417
            context->compressedTextureSubImage3D(texturePacked, level, xoffset, yoffset, zoffset,
 
418
                                                 width, height, depth, format, imageSize, data);
 
419
        }
 
420
        ANGLE_CAPTURE(CompressedTextureSubImage3D, isCallValid, context, texturePacked, level,
 
421
                      xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
 
422
    }
 
423
}
 
424
 
 
425
void GL_APIENTRY CopyNamedBufferSubData(GLuint readBuffer,
 
426
                                        GLuint writeBuffer,
 
427
                                        GLintptr readOffset,
 
428
                                        GLintptr writeOffset,
 
429
                                        GLsizeiptr size)
 
430
{
 
431
    Context *context = GetValidGlobalContext();
 
432
    EVENT("glCopyNamedBufferSubData",
 
433
          "context = %d, GLuint readBuffer = %u, GLuint writeBuffer = %u, GLintptr readOffset = "
 
434
          "%llu, GLintptr writeOffset = %llu, GLsizeiptr size = %llu",
 
435
          CID(context), readBuffer, writeBuffer, static_cast<unsigned long long>(readOffset),
 
436
          static_cast<unsigned long long>(writeOffset), static_cast<unsigned long long>(size));
 
437
 
 
438
    if (context)
 
439
    {
 
440
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
441
        bool isCallValid                              = (context->skipValidation() ||
 
442
                            ValidateCopyNamedBufferSubData(context, readBuffer, writeBuffer,
 
443
                                                           readOffset, writeOffset, size));
 
444
        if (isCallValid)
 
445
        {
 
446
            context->copyNamedBufferSubData(readBuffer, writeBuffer, readOffset, writeOffset, size);
 
447
        }
 
448
        ANGLE_CAPTURE(CopyNamedBufferSubData, isCallValid, context, readBuffer, writeBuffer,
 
449
                      readOffset, writeOffset, size);
 
450
    }
 
451
}
 
452
 
 
453
void GL_APIENTRY
 
454
CopyTextureSubImage1D(GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
 
455
{
 
456
    Context *context = GetValidGlobalContext();
 
457
    EVENT("glCopyTextureSubImage1D",
 
458
          "context = %d, GLuint texture = %u, GLint level = %d, GLint xoffset = %d, GLint x = %d, "
 
459
          "GLint y = %d, GLsizei width = %d",
 
460
          CID(context), texture, level, xoffset, x, y, width);
 
461
 
 
462
    if (context)
 
463
    {
 
464
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
465
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
466
        bool isCallValid =
 
467
            (context->skipValidation() ||
 
468
             ValidateCopyTextureSubImage1D(context, texturePacked, level, xoffset, x, y, width));
 
469
        if (isCallValid)
 
470
        {
 
471
            context->copyTextureSubImage1D(texturePacked, level, xoffset, x, y, width);
 
472
        }
 
473
        ANGLE_CAPTURE(CopyTextureSubImage1D, isCallValid, context, texturePacked, level, xoffset, x,
 
474
                      y, width);
 
475
    }
 
476
}
 
477
 
 
478
void GL_APIENTRY CopyTextureSubImage2D(GLuint texture,
 
479
                                       GLint level,
 
480
                                       GLint xoffset,
 
481
                                       GLint yoffset,
 
482
                                       GLint x,
 
483
                                       GLint y,
 
484
                                       GLsizei width,
 
485
                                       GLsizei height)
 
486
{
 
487
    Context *context = GetValidGlobalContext();
 
488
    EVENT("glCopyTextureSubImage2D",
 
489
          "context = %d, GLuint texture = %u, GLint level = %d, GLint xoffset = %d, GLint yoffset "
 
490
          "= %d, GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d",
 
491
          CID(context), texture, level, xoffset, yoffset, x, y, width, height);
 
492
 
 
493
    if (context)
 
494
    {
 
495
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
496
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
497
        bool isCallValid                              = (context->skipValidation() ||
 
498
                            ValidateCopyTextureSubImage2D(context, texturePacked, level, xoffset,
 
499
                                                          yoffset, x, y, width, height));
 
500
        if (isCallValid)
 
501
        {
 
502
            context->copyTextureSubImage2D(texturePacked, level, xoffset, yoffset, x, y, width,
 
503
                                           height);
 
504
        }
 
505
        ANGLE_CAPTURE(CopyTextureSubImage2D, isCallValid, context, texturePacked, level, xoffset,
 
506
                      yoffset, x, y, width, height);
 
507
    }
 
508
}
 
509
 
 
510
void GL_APIENTRY CopyTextureSubImage3D(GLuint texture,
 
511
                                       GLint level,
 
512
                                       GLint xoffset,
 
513
                                       GLint yoffset,
 
514
                                       GLint zoffset,
 
515
                                       GLint x,
 
516
                                       GLint y,
 
517
                                       GLsizei width,
 
518
                                       GLsizei height)
 
519
{
 
520
    Context *context = GetValidGlobalContext();
 
521
    EVENT("glCopyTextureSubImage3D",
 
522
          "context = %d, GLuint texture = %u, GLint level = %d, GLint xoffset = %d, GLint yoffset "
 
523
          "= %d, GLint zoffset = %d, GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei "
 
524
          "height = %d",
 
525
          CID(context), texture, level, xoffset, yoffset, zoffset, x, y, width, height);
 
526
 
 
527
    if (context)
 
528
    {
 
529
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
530
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
531
        bool isCallValid                              = (context->skipValidation() ||
 
532
                            ValidateCopyTextureSubImage3D(context, texturePacked, level, xoffset,
 
533
                                                          yoffset, zoffset, x, y, width, height));
 
534
        if (isCallValid)
 
535
        {
 
536
            context->copyTextureSubImage3D(texturePacked, level, xoffset, yoffset, zoffset, x, y,
 
537
                                           width, height);
 
538
        }
 
539
        ANGLE_CAPTURE(CopyTextureSubImage3D, isCallValid, context, texturePacked, level, xoffset,
 
540
                      yoffset, zoffset, x, y, width, height);
 
541
    }
 
542
}
 
543
 
 
544
void GL_APIENTRY CreateBuffers(GLsizei n, GLuint *buffers)
 
545
{
 
546
    Context *context = GetValidGlobalContext();
 
547
    EVENT("glCreateBuffers", "context = %d, GLsizei n = %d, GLuint *buffers = 0x%016" PRIxPTR "",
 
548
          CID(context), n, (uintptr_t)buffers);
 
549
 
 
550
    if (context)
 
551
    {
 
552
        BufferID *buffersPacked                       = FromGL<BufferID *>(buffers);
 
553
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
554
        bool isCallValid =
 
555
            (context->skipValidation() || ValidateCreateBuffers(context, n, buffersPacked));
 
556
        if (isCallValid)
 
557
        {
 
558
            context->createBuffers(n, buffersPacked);
 
559
        }
 
560
        ANGLE_CAPTURE(CreateBuffers, isCallValid, context, n, buffersPacked);
 
561
    }
 
562
}
 
563
 
 
564
void GL_APIENTRY CreateFramebuffers(GLsizei n, GLuint *framebuffers)
 
565
{
 
566
    Context *context = GetValidGlobalContext();
 
567
    EVENT("glCreateFramebuffers",
 
568
          "context = %d, GLsizei n = %d, GLuint *framebuffers = 0x%016" PRIxPTR "", CID(context), n,
 
569
          (uintptr_t)framebuffers);
 
570
 
 
571
    if (context)
 
572
    {
 
573
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
574
        bool isCallValid =
 
575
            (context->skipValidation() || ValidateCreateFramebuffers(context, n, framebuffers));
 
576
        if (isCallValid)
 
577
        {
 
578
            context->createFramebuffers(n, framebuffers);
 
579
        }
 
580
        ANGLE_CAPTURE(CreateFramebuffers, isCallValid, context, n, framebuffers);
 
581
    }
 
582
}
 
583
 
 
584
void GL_APIENTRY CreateProgramPipelines(GLsizei n, GLuint *pipelines)
 
585
{
 
586
    Context *context = GetValidGlobalContext();
 
587
    EVENT("glCreateProgramPipelines",
 
588
          "context = %d, GLsizei n = %d, GLuint *pipelines = 0x%016" PRIxPTR "", CID(context), n,
 
589
          (uintptr_t)pipelines);
 
590
 
 
591
    if (context)
 
592
    {
 
593
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
594
        bool isCallValid =
 
595
            (context->skipValidation() || ValidateCreateProgramPipelines(context, n, pipelines));
 
596
        if (isCallValid)
 
597
        {
 
598
            context->createProgramPipelines(n, pipelines);
 
599
        }
 
600
        ANGLE_CAPTURE(CreateProgramPipelines, isCallValid, context, n, pipelines);
 
601
    }
 
602
}
 
603
 
 
604
void GL_APIENTRY CreateQueries(GLenum target, GLsizei n, GLuint *ids)
 
605
{
 
606
    Context *context = GetValidGlobalContext();
 
607
    EVENT("glCreateQueries",
 
608
          "context = %d, GLenum target = %s, GLsizei n = %d, GLuint *ids = 0x%016" PRIxPTR "",
 
609
          CID(context), GLenumToString(GLenumGroup::QueryTarget, target), n, (uintptr_t)ids);
 
610
 
 
611
    if (context)
 
612
    {
 
613
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
614
        bool isCallValid =
 
615
            (context->skipValidation() || ValidateCreateQueries(context, target, n, ids));
 
616
        if (isCallValid)
 
617
        {
 
618
            context->createQueries(target, n, ids);
 
619
        }
 
620
        ANGLE_CAPTURE(CreateQueries, isCallValid, context, target, n, ids);
 
621
    }
 
622
}
 
623
 
 
624
void GL_APIENTRY CreateRenderbuffers(GLsizei n, GLuint *renderbuffers)
 
625
{
 
626
    Context *context = GetValidGlobalContext();
 
627
    EVENT("glCreateRenderbuffers",
 
628
          "context = %d, GLsizei n = %d, GLuint *renderbuffers = 0x%016" PRIxPTR "", CID(context),
 
629
          n, (uintptr_t)renderbuffers);
 
630
 
 
631
    if (context)
 
632
    {
 
633
        RenderbufferID *renderbuffersPacked           = FromGL<RenderbufferID *>(renderbuffers);
 
634
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
635
        bool isCallValid                              = (context->skipValidation() ||
 
636
                            ValidateCreateRenderbuffers(context, n, renderbuffersPacked));
 
637
        if (isCallValid)
 
638
        {
 
639
            context->createRenderbuffers(n, renderbuffersPacked);
 
640
        }
 
641
        ANGLE_CAPTURE(CreateRenderbuffers, isCallValid, context, n, renderbuffersPacked);
 
642
    }
 
643
}
 
644
 
 
645
void GL_APIENTRY CreateSamplers(GLsizei n, GLuint *samplers)
 
646
{
 
647
    Context *context = GetValidGlobalContext();
 
648
    EVENT("glCreateSamplers", "context = %d, GLsizei n = %d, GLuint *samplers = 0x%016" PRIxPTR "",
 
649
          CID(context), n, (uintptr_t)samplers);
 
650
 
 
651
    if (context)
 
652
    {
 
653
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
654
        bool isCallValid =
 
655
            (context->skipValidation() || ValidateCreateSamplers(context, n, samplers));
 
656
        if (isCallValid)
 
657
        {
 
658
            context->createSamplers(n, samplers);
 
659
        }
 
660
        ANGLE_CAPTURE(CreateSamplers, isCallValid, context, n, samplers);
 
661
    }
 
662
}
 
663
 
 
664
void GL_APIENTRY CreateTextures(GLenum target, GLsizei n, GLuint *textures)
 
665
{
 
666
    Context *context = GetValidGlobalContext();
 
667
    EVENT("glCreateTextures",
 
668
          "context = %d, GLenum target = %s, GLsizei n = %d, GLuint *textures = 0x%016" PRIxPTR "",
 
669
          CID(context), GLenumToString(GLenumGroup::TextureTarget, target), n, (uintptr_t)textures);
 
670
 
 
671
    if (context)
 
672
    {
 
673
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
674
        bool isCallValid =
 
675
            (context->skipValidation() || ValidateCreateTextures(context, target, n, textures));
 
676
        if (isCallValid)
 
677
        {
 
678
            context->createTextures(target, n, textures);
 
679
        }
 
680
        ANGLE_CAPTURE(CreateTextures, isCallValid, context, target, n, textures);
 
681
    }
 
682
}
 
683
 
 
684
void GL_APIENTRY CreateTransformFeedbacks(GLsizei n, GLuint *ids)
 
685
{
 
686
    Context *context = GetValidGlobalContext();
 
687
    EVENT("glCreateTransformFeedbacks",
 
688
          "context = %d, GLsizei n = %d, GLuint *ids = 0x%016" PRIxPTR "", CID(context), n,
 
689
          (uintptr_t)ids);
 
690
 
 
691
    if (context)
 
692
    {
 
693
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
694
        bool isCallValid =
 
695
            (context->skipValidation() || ValidateCreateTransformFeedbacks(context, n, ids));
 
696
        if (isCallValid)
 
697
        {
 
698
            context->createTransformFeedbacks(n, ids);
 
699
        }
 
700
        ANGLE_CAPTURE(CreateTransformFeedbacks, isCallValid, context, n, ids);
 
701
    }
 
702
}
 
703
 
 
704
void GL_APIENTRY CreateVertexArrays(GLsizei n, GLuint *arrays)
 
705
{
 
706
    Context *context = GetValidGlobalContext();
 
707
    EVENT("glCreateVertexArrays",
 
708
          "context = %d, GLsizei n = %d, GLuint *arrays = 0x%016" PRIxPTR "", CID(context), n,
 
709
          (uintptr_t)arrays);
 
710
 
 
711
    if (context)
 
712
    {
 
713
        VertexArrayID *arraysPacked                   = FromGL<VertexArrayID *>(arrays);
 
714
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
715
        bool isCallValid =
 
716
            (context->skipValidation() || ValidateCreateVertexArrays(context, n, arraysPacked));
 
717
        if (isCallValid)
 
718
        {
 
719
            context->createVertexArrays(n, arraysPacked);
 
720
        }
 
721
        ANGLE_CAPTURE(CreateVertexArrays, isCallValid, context, n, arraysPacked);
 
722
    }
 
723
}
 
724
 
 
725
void GL_APIENTRY DisableVertexArrayAttrib(GLuint vaobj, GLuint index)
 
726
{
 
727
    Context *context = GetValidGlobalContext();
 
728
    EVENT("glDisableVertexArrayAttrib", "context = %d, GLuint vaobj = %u, GLuint index = %u",
 
729
          CID(context), vaobj, index);
 
730
 
 
731
    if (context)
 
732
    {
 
733
        VertexArrayID vaobjPacked                     = FromGL<VertexArrayID>(vaobj);
 
734
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
735
        bool isCallValid                              = (context->skipValidation() ||
 
736
                            ValidateDisableVertexArrayAttrib(context, vaobjPacked, index));
 
737
        if (isCallValid)
 
738
        {
 
739
            context->disableVertexArrayAttrib(vaobjPacked, index);
 
740
        }
 
741
        ANGLE_CAPTURE(DisableVertexArrayAttrib, isCallValid, context, vaobjPacked, index);
 
742
    }
 
743
}
 
744
 
 
745
void GL_APIENTRY EnableVertexArrayAttrib(GLuint vaobj, GLuint index)
 
746
{
 
747
    Context *context = GetValidGlobalContext();
 
748
    EVENT("glEnableVertexArrayAttrib", "context = %d, GLuint vaobj = %u, GLuint index = %u",
 
749
          CID(context), vaobj, index);
 
750
 
 
751
    if (context)
 
752
    {
 
753
        VertexArrayID vaobjPacked                     = FromGL<VertexArrayID>(vaobj);
 
754
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
755
        bool isCallValid                              = (context->skipValidation() ||
 
756
                            ValidateEnableVertexArrayAttrib(context, vaobjPacked, index));
 
757
        if (isCallValid)
 
758
        {
 
759
            context->enableVertexArrayAttrib(vaobjPacked, index);
 
760
        }
 
761
        ANGLE_CAPTURE(EnableVertexArrayAttrib, isCallValid, context, vaobjPacked, index);
 
762
    }
 
763
}
 
764
 
 
765
void GL_APIENTRY FlushMappedNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length)
 
766
{
 
767
    Context *context = GetValidGlobalContext();
 
768
    EVENT("glFlushMappedNamedBufferRange",
 
769
          "context = %d, GLuint buffer = %u, GLintptr offset = %llu, GLsizeiptr length = %llu",
 
770
          CID(context), buffer, static_cast<unsigned long long>(offset),
 
771
          static_cast<unsigned long long>(length));
 
772
 
 
773
    if (context)
 
774
    {
 
775
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
776
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
777
        bool isCallValid =
 
778
            (context->skipValidation() ||
 
779
             ValidateFlushMappedNamedBufferRange(context, bufferPacked, offset, length));
 
780
        if (isCallValid)
 
781
        {
 
782
            context->flushMappedNamedBufferRange(bufferPacked, offset, length);
 
783
        }
 
784
        ANGLE_CAPTURE(FlushMappedNamedBufferRange, isCallValid, context, bufferPacked, offset,
 
785
                      length);
 
786
    }
 
787
}
 
788
 
 
789
void GL_APIENTRY GenerateTextureMipmap(GLuint texture)
 
790
{
 
791
    Context *context = GetValidGlobalContext();
 
792
    EVENT("glGenerateTextureMipmap", "context = %d, GLuint texture = %u", CID(context), texture);
 
793
 
 
794
    if (context)
 
795
    {
 
796
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
797
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
798
        bool isCallValid =
 
799
            (context->skipValidation() || ValidateGenerateTextureMipmap(context, texturePacked));
 
800
        if (isCallValid)
 
801
        {
 
802
            context->generateTextureMipmap(texturePacked);
 
803
        }
 
804
        ANGLE_CAPTURE(GenerateTextureMipmap, isCallValid, context, texturePacked);
 
805
    }
 
806
}
 
807
 
 
808
void GL_APIENTRY GetCompressedTextureImage(GLuint texture,
 
809
                                           GLint level,
 
810
                                           GLsizei bufSize,
 
811
                                           void *pixels)
 
812
{
 
813
    Context *context = GetValidGlobalContext();
 
814
    EVENT("glGetCompressedTextureImage",
 
815
          "context = %d, GLuint texture = %u, GLint level = %d, GLsizei bufSize = %d, void *pixels "
 
816
          "= 0x%016" PRIxPTR "",
 
817
          CID(context), texture, level, bufSize, (uintptr_t)pixels);
 
818
 
 
819
    if (context)
 
820
    {
 
821
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
822
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
823
        bool isCallValid =
 
824
            (context->skipValidation() ||
 
825
             ValidateGetCompressedTextureImage(context, texturePacked, level, bufSize, pixels));
 
826
        if (isCallValid)
 
827
        {
 
828
            context->getCompressedTextureImage(texturePacked, level, bufSize, pixels);
 
829
        }
 
830
        ANGLE_CAPTURE(GetCompressedTextureImage, isCallValid, context, texturePacked, level,
 
831
                      bufSize, pixels);
 
832
    }
 
833
}
 
834
 
 
835
void GL_APIENTRY GetCompressedTextureSubImage(GLuint texture,
 
836
                                              GLint level,
 
837
                                              GLint xoffset,
 
838
                                              GLint yoffset,
 
839
                                              GLint zoffset,
 
840
                                              GLsizei width,
 
841
                                              GLsizei height,
 
842
                                              GLsizei depth,
 
843
                                              GLsizei bufSize,
 
844
                                              void *pixels)
 
845
{
 
846
    Context *context = GetValidGlobalContext();
 
847
    EVENT("glGetCompressedTextureSubImage",
 
848
          "context = %d, GLuint texture = %u, GLint level = %d, GLint xoffset = %d, GLint yoffset "
 
849
          "= %d, GLint zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, "
 
850
          "GLsizei bufSize = %d, void *pixels = 0x%016" PRIxPTR "",
 
851
          CID(context), texture, level, xoffset, yoffset, zoffset, width, height, depth, bufSize,
 
852
          (uintptr_t)pixels);
 
853
 
 
854
    if (context)
 
855
    {
 
856
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
857
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
858
        bool isCallValid =
 
859
            (context->skipValidation() ||
 
860
             ValidateGetCompressedTextureSubImage(context, texturePacked, level, xoffset, yoffset,
 
861
                                                  zoffset, width, height, depth, bufSize, pixels));
 
862
        if (isCallValid)
 
863
        {
 
864
            context->getCompressedTextureSubImage(texturePacked, level, xoffset, yoffset, zoffset,
 
865
                                                  width, height, depth, bufSize, pixels);
 
866
        }
 
867
        ANGLE_CAPTURE(GetCompressedTextureSubImage, isCallValid, context, texturePacked, level,
 
868
                      xoffset, yoffset, zoffset, width, height, depth, bufSize, pixels);
 
869
    }
 
870
}
 
871
 
 
872
GLenum GL_APIENTRY GetGraphicsResetStatus()
 
873
{
 
874
    Context *context = GetGlobalContext();
 
875
    EVENT("glGetGraphicsResetStatus", "context = %d", CID(context));
 
876
 
 
877
    GLenum returnValue;
 
878
    if (context)
 
879
    {
 
880
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
881
        bool isCallValid = (context->skipValidation() || ValidateGetGraphicsResetStatus(context));
 
882
        if (isCallValid)
 
883
        {
 
884
            returnValue = context->getGraphicsResetStatus();
 
885
        }
 
886
        else
 
887
        {
 
888
            returnValue = GetDefaultReturnValue<EntryPoint::GetGraphicsResetStatus, GLenum>();
 
889
        }
 
890
        ANGLE_CAPTURE(GetGraphicsResetStatus, isCallValid, context, returnValue);
 
891
    }
 
892
    else
 
893
    {
 
894
        returnValue = GetDefaultReturnValue<EntryPoint::GetGraphicsResetStatus, GLenum>();
 
895
    }
 
896
    return returnValue;
 
897
}
 
898
 
 
899
void GL_APIENTRY GetNamedBufferParameteri64v(GLuint buffer, GLenum pname, GLint64 *params)
 
900
{
 
901
    Context *context = GetValidGlobalContext();
 
902
    EVENT("glGetNamedBufferParameteri64v",
 
903
          "context = %d, GLuint buffer = %u, GLenum pname = %s, GLint64 *params = 0x%016" PRIxPTR
 
904
          "",
 
905
          CID(context), buffer, GLenumToString(GLenumGroup::VertexBufferObjectParameter, pname),
 
906
          (uintptr_t)params);
 
907
 
 
908
    if (context)
 
909
    {
 
910
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
911
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
912
        bool isCallValid = (context->skipValidation() || ValidateGetNamedBufferParameteri64v(
 
913
                                                             context, bufferPacked, pname, params));
 
914
        if (isCallValid)
 
915
        {
 
916
            context->getNamedBufferParameteri64v(bufferPacked, pname, params);
 
917
        }
 
918
        ANGLE_CAPTURE(GetNamedBufferParameteri64v, isCallValid, context, bufferPacked, pname,
 
919
                      params);
 
920
    }
 
921
}
 
922
 
 
923
void GL_APIENTRY GetNamedBufferParameteriv(GLuint buffer, GLenum pname, GLint *params)
 
924
{
 
925
    Context *context = GetValidGlobalContext();
 
926
    EVENT("glGetNamedBufferParameteriv",
 
927
          "context = %d, GLuint buffer = %u, GLenum pname = %s, GLint *params = 0x%016" PRIxPTR "",
 
928
          CID(context), buffer, GLenumToString(GLenumGroup::VertexBufferObjectParameter, pname),
 
929
          (uintptr_t)params);
 
930
 
 
931
    if (context)
 
932
    {
 
933
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
934
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
935
        bool isCallValid = (context->skipValidation() || ValidateGetNamedBufferParameteriv(
 
936
                                                             context, bufferPacked, pname, params));
 
937
        if (isCallValid)
 
938
        {
 
939
            context->getNamedBufferParameteriv(bufferPacked, pname, params);
 
940
        }
 
941
        ANGLE_CAPTURE(GetNamedBufferParameteriv, isCallValid, context, bufferPacked, pname, params);
 
942
    }
 
943
}
 
944
 
 
945
void GL_APIENTRY GetNamedBufferPointerv(GLuint buffer, GLenum pname, void **params)
 
946
{
 
947
    Context *context = GetValidGlobalContext();
 
948
    EVENT("glGetNamedBufferPointerv",
 
949
          "context = %d, GLuint buffer = %u, GLenum pname = %s, void **params = 0x%016" PRIxPTR "",
 
950
          CID(context), buffer, GLenumToString(GLenumGroup::VertexBufferObjectParameter, pname),
 
951
          (uintptr_t)params);
 
952
 
 
953
    if (context)
 
954
    {
 
955
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
956
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
957
        bool isCallValid                              = (context->skipValidation() ||
 
958
                            ValidateGetNamedBufferPointerv(context, bufferPacked, pname, params));
 
959
        if (isCallValid)
 
960
        {
 
961
            context->getNamedBufferPointerv(bufferPacked, pname, params);
 
962
        }
 
963
        ANGLE_CAPTURE(GetNamedBufferPointerv, isCallValid, context, bufferPacked, pname, params);
 
964
    }
 
965
}
 
966
 
 
967
void GL_APIENTRY GetNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, void *data)
 
968
{
 
969
    Context *context = GetValidGlobalContext();
 
970
    EVENT("glGetNamedBufferSubData",
 
971
          "context = %d, GLuint buffer = %u, GLintptr offset = %llu, GLsizeiptr size = %llu, void "
 
972
          "*data = 0x%016" PRIxPTR "",
 
973
          CID(context), buffer, static_cast<unsigned long long>(offset),
 
974
          static_cast<unsigned long long>(size), (uintptr_t)data);
 
975
 
 
976
    if (context)
 
977
    {
 
978
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
979
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
980
        bool isCallValid =
 
981
            (context->skipValidation() ||
 
982
             ValidateGetNamedBufferSubData(context, bufferPacked, offset, size, data));
 
983
        if (isCallValid)
 
984
        {
 
985
            context->getNamedBufferSubData(bufferPacked, offset, size, data);
 
986
        }
 
987
        ANGLE_CAPTURE(GetNamedBufferSubData, isCallValid, context, bufferPacked, offset, size,
 
988
                      data);
 
989
    }
 
990
}
 
991
 
 
992
void GL_APIENTRY GetNamedFramebufferAttachmentParameteriv(GLuint framebuffer,
 
993
                                                          GLenum attachment,
 
994
                                                          GLenum pname,
 
995
                                                          GLint *params)
 
996
{
 
997
    Context *context = GetValidGlobalContext();
 
998
    EVENT("glGetNamedFramebufferAttachmentParameteriv",
 
999
          "context = %d, GLuint framebuffer = %u, GLenum attachment = %s, GLenum pname = %s, GLint "
 
1000
          "*params = 0x%016" PRIxPTR "",
 
1001
          CID(context), framebuffer, GLenumToString(GLenumGroup::FramebufferAttachment, attachment),
 
1002
          GLenumToString(GLenumGroup::FramebufferAttachmentParameterName, pname),
 
1003
          (uintptr_t)params);
 
1004
 
 
1005
    if (context)
 
1006
    {
 
1007
        FramebufferID framebufferPacked               = FromGL<FramebufferID>(framebuffer);
 
1008
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1009
        bool isCallValid                              = (context->skipValidation() ||
 
1010
                            ValidateGetNamedFramebufferAttachmentParameteriv(
 
1011
                                context, framebufferPacked, attachment, pname, params));
 
1012
        if (isCallValid)
 
1013
        {
 
1014
            context->getNamedFramebufferAttachmentParameteriv(framebufferPacked, attachment, pname,
 
1015
                                                              params);
 
1016
        }
 
1017
        ANGLE_CAPTURE(GetNamedFramebufferAttachmentParameteriv, isCallValid, context,
 
1018
                      framebufferPacked, attachment, pname, params);
 
1019
    }
 
1020
}
 
1021
 
 
1022
void GL_APIENTRY GetNamedFramebufferParameteriv(GLuint framebuffer, GLenum pname, GLint *param)
 
1023
{
 
1024
    Context *context = GetValidGlobalContext();
 
1025
    EVENT("glGetNamedFramebufferParameteriv",
 
1026
          "context = %d, GLuint framebuffer = %u, GLenum pname = %s, GLint *param = 0x%016" PRIxPTR
 
1027
          "",
 
1028
          CID(context), framebuffer, GLenumToString(GLenumGroup::GetFramebufferParameter, pname),
 
1029
          (uintptr_t)param);
 
1030
 
 
1031
    if (context)
 
1032
    {
 
1033
        FramebufferID framebufferPacked               = FromGL<FramebufferID>(framebuffer);
 
1034
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1035
        bool isCallValid =
 
1036
            (context->skipValidation() ||
 
1037
             ValidateGetNamedFramebufferParameteriv(context, framebufferPacked, pname, param));
 
1038
        if (isCallValid)
 
1039
        {
 
1040
            context->getNamedFramebufferParameteriv(framebufferPacked, pname, param);
 
1041
        }
 
1042
        ANGLE_CAPTURE(GetNamedFramebufferParameteriv, isCallValid, context, framebufferPacked,
 
1043
                      pname, param);
 
1044
    }
 
1045
}
 
1046
 
 
1047
void GL_APIENTRY GetNamedRenderbufferParameteriv(GLuint renderbuffer, GLenum pname, GLint *params)
 
1048
{
 
1049
    Context *context = GetValidGlobalContext();
 
1050
    EVENT(
 
1051
        "glGetNamedRenderbufferParameteriv",
 
1052
        "context = %d, GLuint renderbuffer = %u, GLenum pname = %s, GLint *params = 0x%016" PRIxPTR
 
1053
        "",
 
1054
        CID(context), renderbuffer, GLenumToString(GLenumGroup::RenderbufferParameterName, pname),
 
1055
        (uintptr_t)params);
 
1056
 
 
1057
    if (context)
 
1058
    {
 
1059
        RenderbufferID renderbufferPacked             = FromGL<RenderbufferID>(renderbuffer);
 
1060
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1061
        bool isCallValid =
 
1062
            (context->skipValidation() ||
 
1063
             ValidateGetNamedRenderbufferParameteriv(context, renderbufferPacked, pname, params));
 
1064
        if (isCallValid)
 
1065
        {
 
1066
            context->getNamedRenderbufferParameteriv(renderbufferPacked, pname, params);
 
1067
        }
 
1068
        ANGLE_CAPTURE(GetNamedRenderbufferParameteriv, isCallValid, context, renderbufferPacked,
 
1069
                      pname, params);
 
1070
    }
 
1071
}
 
1072
 
 
1073
void GL_APIENTRY GetQueryBufferObjecti64v(GLuint id, GLuint buffer, GLenum pname, GLintptr offset)
 
1074
{
 
1075
    Context *context = GetValidGlobalContext();
 
1076
    EVENT("glGetQueryBufferObjecti64v",
 
1077
          "context = %d, GLuint id = %u, GLuint buffer = %u, GLenum pname = %s, GLintptr offset = "
 
1078
          "%llu",
 
1079
          CID(context), id, buffer, GLenumToString(GLenumGroup::QueryObjectParameterName, pname),
 
1080
          static_cast<unsigned long long>(offset));
 
1081
 
 
1082
    if (context)
 
1083
    {
 
1084
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
1085
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1086
        bool isCallValid =
 
1087
            (context->skipValidation() ||
 
1088
             ValidateGetQueryBufferObjecti64v(context, id, bufferPacked, pname, offset));
 
1089
        if (isCallValid)
 
1090
        {
 
1091
            context->getQueryBufferObjecti64v(id, bufferPacked, pname, offset);
 
1092
        }
 
1093
        ANGLE_CAPTURE(GetQueryBufferObjecti64v, isCallValid, context, id, bufferPacked, pname,
 
1094
                      offset);
 
1095
    }
 
1096
}
 
1097
 
 
1098
void GL_APIENTRY GetQueryBufferObjectiv(GLuint id, GLuint buffer, GLenum pname, GLintptr offset)
 
1099
{
 
1100
    Context *context = GetValidGlobalContext();
 
1101
    EVENT("glGetQueryBufferObjectiv",
 
1102
          "context = %d, GLuint id = %u, GLuint buffer = %u, GLenum pname = %s, GLintptr offset = "
 
1103
          "%llu",
 
1104
          CID(context), id, buffer, GLenumToString(GLenumGroup::QueryObjectParameterName, pname),
 
1105
          static_cast<unsigned long long>(offset));
 
1106
 
 
1107
    if (context)
 
1108
    {
 
1109
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
1110
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1111
        bool isCallValid =
 
1112
            (context->skipValidation() ||
 
1113
             ValidateGetQueryBufferObjectiv(context, id, bufferPacked, pname, offset));
 
1114
        if (isCallValid)
 
1115
        {
 
1116
            context->getQueryBufferObjectiv(id, bufferPacked, pname, offset);
 
1117
        }
 
1118
        ANGLE_CAPTURE(GetQueryBufferObjectiv, isCallValid, context, id, bufferPacked, pname,
 
1119
                      offset);
 
1120
    }
 
1121
}
 
1122
 
 
1123
void GL_APIENTRY GetQueryBufferObjectui64v(GLuint id, GLuint buffer, GLenum pname, GLintptr offset)
 
1124
{
 
1125
    Context *context = GetValidGlobalContext();
 
1126
    EVENT("glGetQueryBufferObjectui64v",
 
1127
          "context = %d, GLuint id = %u, GLuint buffer = %u, GLenum pname = %s, GLintptr offset = "
 
1128
          "%llu",
 
1129
          CID(context), id, buffer, GLenumToString(GLenumGroup::QueryObjectParameterName, pname),
 
1130
          static_cast<unsigned long long>(offset));
 
1131
 
 
1132
    if (context)
 
1133
    {
 
1134
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
1135
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1136
        bool isCallValid =
 
1137
            (context->skipValidation() ||
 
1138
             ValidateGetQueryBufferObjectui64v(context, id, bufferPacked, pname, offset));
 
1139
        if (isCallValid)
 
1140
        {
 
1141
            context->getQueryBufferObjectui64v(id, bufferPacked, pname, offset);
 
1142
        }
 
1143
        ANGLE_CAPTURE(GetQueryBufferObjectui64v, isCallValid, context, id, bufferPacked, pname,
 
1144
                      offset);
 
1145
    }
 
1146
}
 
1147
 
 
1148
void GL_APIENTRY GetQueryBufferObjectuiv(GLuint id, GLuint buffer, GLenum pname, GLintptr offset)
 
1149
{
 
1150
    Context *context = GetValidGlobalContext();
 
1151
    EVENT("glGetQueryBufferObjectuiv",
 
1152
          "context = %d, GLuint id = %u, GLuint buffer = %u, GLenum pname = %s, GLintptr offset = "
 
1153
          "%llu",
 
1154
          CID(context), id, buffer, GLenumToString(GLenumGroup::QueryObjectParameterName, pname),
 
1155
          static_cast<unsigned long long>(offset));
 
1156
 
 
1157
    if (context)
 
1158
    {
 
1159
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
1160
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1161
        bool isCallValid =
 
1162
            (context->skipValidation() ||
 
1163
             ValidateGetQueryBufferObjectuiv(context, id, bufferPacked, pname, offset));
 
1164
        if (isCallValid)
 
1165
        {
 
1166
            context->getQueryBufferObjectuiv(id, bufferPacked, pname, offset);
 
1167
        }
 
1168
        ANGLE_CAPTURE(GetQueryBufferObjectuiv, isCallValid, context, id, bufferPacked, pname,
 
1169
                      offset);
 
1170
    }
 
1171
}
 
1172
 
 
1173
void GL_APIENTRY GetTextureImage(GLuint texture,
 
1174
                                 GLint level,
 
1175
                                 GLenum format,
 
1176
                                 GLenum type,
 
1177
                                 GLsizei bufSize,
 
1178
                                 void *pixels)
 
1179
{
 
1180
    Context *context = GetValidGlobalContext();
 
1181
    EVENT("glGetTextureImage",
 
1182
          "context = %d, GLuint texture = %u, GLint level = %d, GLenum format = %s, GLenum type = "
 
1183
          "%s, GLsizei bufSize = %d, void *pixels = 0x%016" PRIxPTR "",
 
1184
          CID(context), texture, level, GLenumToString(GLenumGroup::PixelFormat, format),
 
1185
          GLenumToString(GLenumGroup::PixelType, type), bufSize, (uintptr_t)pixels);
 
1186
 
 
1187
    if (context)
 
1188
    {
 
1189
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
1190
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1191
        bool isCallValid =
 
1192
            (context->skipValidation() ||
 
1193
             ValidateGetTextureImage(context, texturePacked, level, format, type, bufSize, pixels));
 
1194
        if (isCallValid)
 
1195
        {
 
1196
            context->getTextureImage(texturePacked, level, format, type, bufSize, pixels);
 
1197
        }
 
1198
        ANGLE_CAPTURE(GetTextureImage, isCallValid, context, texturePacked, level, format, type,
 
1199
                      bufSize, pixels);
 
1200
    }
 
1201
}
 
1202
 
 
1203
void GL_APIENTRY GetTextureLevelParameterfv(GLuint texture,
 
1204
                                            GLint level,
 
1205
                                            GLenum pname,
 
1206
                                            GLfloat *params)
 
1207
{
 
1208
    Context *context = GetValidGlobalContext();
 
1209
    EVENT("glGetTextureLevelParameterfv",
 
1210
          "context = %d, GLuint texture = %u, GLint level = %d, GLenum pname = %s, GLfloat *params "
 
1211
          "= 0x%016" PRIxPTR "",
 
1212
          CID(context), texture, level, GLenumToString(GLenumGroup::GetTextureParameter, pname),
 
1213
          (uintptr_t)params);
 
1214
 
 
1215
    if (context)
 
1216
    {
 
1217
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
1218
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1219
        bool isCallValid =
 
1220
            (context->skipValidation() ||
 
1221
             ValidateGetTextureLevelParameterfv(context, texturePacked, level, pname, params));
 
1222
        if (isCallValid)
 
1223
        {
 
1224
            context->getTextureLevelParameterfv(texturePacked, level, pname, params);
 
1225
        }
 
1226
        ANGLE_CAPTURE(GetTextureLevelParameterfv, isCallValid, context, texturePacked, level, pname,
 
1227
                      params);
 
1228
    }
 
1229
}
 
1230
 
 
1231
void GL_APIENTRY GetTextureLevelParameteriv(GLuint texture,
 
1232
                                            GLint level,
 
1233
                                            GLenum pname,
 
1234
                                            GLint *params)
 
1235
{
 
1236
    Context *context = GetValidGlobalContext();
 
1237
    EVENT("glGetTextureLevelParameteriv",
 
1238
          "context = %d, GLuint texture = %u, GLint level = %d, GLenum pname = %s, GLint *params = "
 
1239
          "0x%016" PRIxPTR "",
 
1240
          CID(context), texture, level, GLenumToString(GLenumGroup::GetTextureParameter, pname),
 
1241
          (uintptr_t)params);
 
1242
 
 
1243
    if (context)
 
1244
    {
 
1245
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
1246
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1247
        bool isCallValid =
 
1248
            (context->skipValidation() ||
 
1249
             ValidateGetTextureLevelParameteriv(context, texturePacked, level, pname, params));
 
1250
        if (isCallValid)
 
1251
        {
 
1252
            context->getTextureLevelParameteriv(texturePacked, level, pname, params);
 
1253
        }
 
1254
        ANGLE_CAPTURE(GetTextureLevelParameteriv, isCallValid, context, texturePacked, level, pname,
 
1255
                      params);
 
1256
    }
 
1257
}
 
1258
 
 
1259
void GL_APIENTRY GetTextureParameterIiv(GLuint texture, GLenum pname, GLint *params)
 
1260
{
 
1261
    Context *context = GetValidGlobalContext();
 
1262
    EVENT("glGetTextureParameterIiv",
 
1263
          "context = %d, GLuint texture = %u, GLenum pname = %s, GLint *params = 0x%016" PRIxPTR "",
 
1264
          CID(context), texture, GLenumToString(GLenumGroup::GetTextureParameter, pname),
 
1265
          (uintptr_t)params);
 
1266
 
 
1267
    if (context)
 
1268
    {
 
1269
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
1270
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1271
        bool isCallValid                              = (context->skipValidation() ||
 
1272
                            ValidateGetTextureParameterIiv(context, texturePacked, pname, params));
 
1273
        if (isCallValid)
 
1274
        {
 
1275
            context->getTextureParameterIiv(texturePacked, pname, params);
 
1276
        }
 
1277
        ANGLE_CAPTURE(GetTextureParameterIiv, isCallValid, context, texturePacked, pname, params);
 
1278
    }
 
1279
}
 
1280
 
 
1281
void GL_APIENTRY GetTextureParameterIuiv(GLuint texture, GLenum pname, GLuint *params)
 
1282
{
 
1283
    Context *context = GetValidGlobalContext();
 
1284
    EVENT("glGetTextureParameterIuiv",
 
1285
          "context = %d, GLuint texture = %u, GLenum pname = %s, GLuint *params = 0x%016" PRIxPTR
 
1286
          "",
 
1287
          CID(context), texture, GLenumToString(GLenumGroup::GetTextureParameter, pname),
 
1288
          (uintptr_t)params);
 
1289
 
 
1290
    if (context)
 
1291
    {
 
1292
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
1293
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1294
        bool isCallValid                              = (context->skipValidation() ||
 
1295
                            ValidateGetTextureParameterIuiv(context, texturePacked, pname, params));
 
1296
        if (isCallValid)
 
1297
        {
 
1298
            context->getTextureParameterIuiv(texturePacked, pname, params);
 
1299
        }
 
1300
        ANGLE_CAPTURE(GetTextureParameterIuiv, isCallValid, context, texturePacked, pname, params);
 
1301
    }
 
1302
}
 
1303
 
 
1304
void GL_APIENTRY GetTextureParameterfv(GLuint texture, GLenum pname, GLfloat *params)
 
1305
{
 
1306
    Context *context = GetValidGlobalContext();
 
1307
    EVENT("glGetTextureParameterfv",
 
1308
          "context = %d, GLuint texture = %u, GLenum pname = %s, GLfloat *params = 0x%016" PRIxPTR
 
1309
          "",
 
1310
          CID(context), texture, GLenumToString(GLenumGroup::GetTextureParameter, pname),
 
1311
          (uintptr_t)params);
 
1312
 
 
1313
    if (context)
 
1314
    {
 
1315
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
1316
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1317
        bool isCallValid                              = (context->skipValidation() ||
 
1318
                            ValidateGetTextureParameterfv(context, texturePacked, pname, params));
 
1319
        if (isCallValid)
 
1320
        {
 
1321
            context->getTextureParameterfv(texturePacked, pname, params);
 
1322
        }
 
1323
        ANGLE_CAPTURE(GetTextureParameterfv, isCallValid, context, texturePacked, pname, params);
 
1324
    }
 
1325
}
 
1326
 
 
1327
void GL_APIENTRY GetTextureParameteriv(GLuint texture, GLenum pname, GLint *params)
 
1328
{
 
1329
    Context *context = GetValidGlobalContext();
 
1330
    EVENT("glGetTextureParameteriv",
 
1331
          "context = %d, GLuint texture = %u, GLenum pname = %s, GLint *params = 0x%016" PRIxPTR "",
 
1332
          CID(context), texture, GLenumToString(GLenumGroup::GetTextureParameter, pname),
 
1333
          (uintptr_t)params);
 
1334
 
 
1335
    if (context)
 
1336
    {
 
1337
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
1338
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1339
        bool isCallValid                              = (context->skipValidation() ||
 
1340
                            ValidateGetTextureParameteriv(context, texturePacked, pname, params));
 
1341
        if (isCallValid)
 
1342
        {
 
1343
            context->getTextureParameteriv(texturePacked, pname, params);
 
1344
        }
 
1345
        ANGLE_CAPTURE(GetTextureParameteriv, isCallValid, context, texturePacked, pname, params);
 
1346
    }
 
1347
}
 
1348
 
 
1349
void GL_APIENTRY GetTextureSubImage(GLuint texture,
 
1350
                                    GLint level,
 
1351
                                    GLint xoffset,
 
1352
                                    GLint yoffset,
 
1353
                                    GLint zoffset,
 
1354
                                    GLsizei width,
 
1355
                                    GLsizei height,
 
1356
                                    GLsizei depth,
 
1357
                                    GLenum format,
 
1358
                                    GLenum type,
 
1359
                                    GLsizei bufSize,
 
1360
                                    void *pixels)
 
1361
{
 
1362
    Context *context = GetValidGlobalContext();
 
1363
    EVENT(
 
1364
        "glGetTextureSubImage",
 
1365
        "context = %d, GLuint texture = %u, GLint level = %d, GLint xoffset = %d, GLint yoffset = "
 
1366
        "%d, GLint zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, "
 
1367
        "GLenum format = %s, GLenum type = %s, GLsizei bufSize = %d, void *pixels = 0x%016" PRIxPTR
 
1368
        "",
 
1369
        CID(context), texture, level, xoffset, yoffset, zoffset, width, height, depth,
 
1370
        GLenumToString(GLenumGroup::PixelFormat, format),
 
1371
        GLenumToString(GLenumGroup::PixelType, type), bufSize, (uintptr_t)pixels);
 
1372
 
 
1373
    if (context)
 
1374
    {
 
1375
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
1376
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1377
        bool isCallValid =
 
1378
            (context->skipValidation() ||
 
1379
             ValidateGetTextureSubImage(context, texturePacked, level, xoffset, yoffset, zoffset,
 
1380
                                        width, height, depth, format, type, bufSize, pixels));
 
1381
        if (isCallValid)
 
1382
        {
 
1383
            context->getTextureSubImage(texturePacked, level, xoffset, yoffset, zoffset, width,
 
1384
                                        height, depth, format, type, bufSize, pixels);
 
1385
        }
 
1386
        ANGLE_CAPTURE(GetTextureSubImage, isCallValid, context, texturePacked, level, xoffset,
 
1387
                      yoffset, zoffset, width, height, depth, format, type, bufSize, pixels);
 
1388
    }
 
1389
}
 
1390
 
 
1391
void GL_APIENTRY GetTransformFeedbacki64_v(GLuint xfb, GLenum pname, GLuint index, GLint64 *param)
 
1392
{
 
1393
    Context *context = GetValidGlobalContext();
 
1394
    EVENT("glGetTransformFeedbacki64_v",
 
1395
          "context = %d, GLuint xfb = %u, GLenum pname = %s, GLuint index = %u, GLint64 *param = "
 
1396
          "0x%016" PRIxPTR "",
 
1397
          CID(context), xfb, GLenumToString(GLenumGroup::TransformFeedbackPName, pname), index,
 
1398
          (uintptr_t)param);
 
1399
 
 
1400
    if (context)
 
1401
    {
 
1402
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1403
        bool isCallValid                              = (context->skipValidation() ||
 
1404
                            ValidateGetTransformFeedbacki64_v(context, xfb, pname, index, param));
 
1405
        if (isCallValid)
 
1406
        {
 
1407
            context->getTransformFeedbacki64_v(xfb, pname, index, param);
 
1408
        }
 
1409
        ANGLE_CAPTURE(GetTransformFeedbacki64_v, isCallValid, context, xfb, pname, index, param);
 
1410
    }
 
1411
}
 
1412
 
 
1413
void GL_APIENTRY GetTransformFeedbacki_v(GLuint xfb, GLenum pname, GLuint index, GLint *param)
 
1414
{
 
1415
    Context *context = GetValidGlobalContext();
 
1416
    EVENT("glGetTransformFeedbacki_v",
 
1417
          "context = %d, GLuint xfb = %u, GLenum pname = %s, GLuint index = %u, GLint *param = "
 
1418
          "0x%016" PRIxPTR "",
 
1419
          CID(context), xfb, GLenumToString(GLenumGroup::TransformFeedbackPName, pname), index,
 
1420
          (uintptr_t)param);
 
1421
 
 
1422
    if (context)
 
1423
    {
 
1424
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1425
        bool isCallValid                              = (context->skipValidation() ||
 
1426
                            ValidateGetTransformFeedbacki_v(context, xfb, pname, index, param));
 
1427
        if (isCallValid)
 
1428
        {
 
1429
            context->getTransformFeedbacki_v(xfb, pname, index, param);
 
1430
        }
 
1431
        ANGLE_CAPTURE(GetTransformFeedbacki_v, isCallValid, context, xfb, pname, index, param);
 
1432
    }
 
1433
}
 
1434
 
 
1435
void GL_APIENTRY GetTransformFeedbackiv(GLuint xfb, GLenum pname, GLint *param)
 
1436
{
 
1437
    Context *context = GetValidGlobalContext();
 
1438
    EVENT("glGetTransformFeedbackiv",
 
1439
          "context = %d, GLuint xfb = %u, GLenum pname = %s, GLint *param = 0x%016" PRIxPTR "",
 
1440
          CID(context), xfb, GLenumToString(GLenumGroup::TransformFeedbackPName, pname),
 
1441
          (uintptr_t)param);
 
1442
 
 
1443
    if (context)
 
1444
    {
 
1445
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1446
        bool isCallValid                              = (context->skipValidation() ||
 
1447
                            ValidateGetTransformFeedbackiv(context, xfb, pname, param));
 
1448
        if (isCallValid)
 
1449
        {
 
1450
            context->getTransformFeedbackiv(xfb, pname, param);
 
1451
        }
 
1452
        ANGLE_CAPTURE(GetTransformFeedbackiv, isCallValid, context, xfb, pname, param);
 
1453
    }
 
1454
}
 
1455
 
 
1456
void GL_APIENTRY GetVertexArrayIndexed64iv(GLuint vaobj, GLuint index, GLenum pname, GLint64 *param)
 
1457
{
 
1458
    Context *context = GetValidGlobalContext();
 
1459
    EVENT("glGetVertexArrayIndexed64iv",
 
1460
          "context = %d, GLuint vaobj = %u, GLuint index = %u, GLenum pname = %s, GLint64 *param = "
 
1461
          "0x%016" PRIxPTR "",
 
1462
          CID(context), vaobj, index, GLenumToString(GLenumGroup::VertexArrayPName, pname),
 
1463
          (uintptr_t)param);
 
1464
 
 
1465
    if (context)
 
1466
    {
 
1467
        VertexArrayID vaobjPacked                     = FromGL<VertexArrayID>(vaobj);
 
1468
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1469
        bool isCallValid =
 
1470
            (context->skipValidation() ||
 
1471
             ValidateGetVertexArrayIndexed64iv(context, vaobjPacked, index, pname, param));
 
1472
        if (isCallValid)
 
1473
        {
 
1474
            context->getVertexArrayIndexed64iv(vaobjPacked, index, pname, param);
 
1475
        }
 
1476
        ANGLE_CAPTURE(GetVertexArrayIndexed64iv, isCallValid, context, vaobjPacked, index, pname,
 
1477
                      param);
 
1478
    }
 
1479
}
 
1480
 
 
1481
void GL_APIENTRY GetVertexArrayIndexediv(GLuint vaobj, GLuint index, GLenum pname, GLint *param)
 
1482
{
 
1483
    Context *context = GetValidGlobalContext();
 
1484
    EVENT("glGetVertexArrayIndexediv",
 
1485
          "context = %d, GLuint vaobj = %u, GLuint index = %u, GLenum pname = %s, GLint *param = "
 
1486
          "0x%016" PRIxPTR "",
 
1487
          CID(context), vaobj, index, GLenumToString(GLenumGroup::VertexArrayPName, pname),
 
1488
          (uintptr_t)param);
 
1489
 
 
1490
    if (context)
 
1491
    {
 
1492
        VertexArrayID vaobjPacked                     = FromGL<VertexArrayID>(vaobj);
 
1493
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1494
        bool isCallValid =
 
1495
            (context->skipValidation() ||
 
1496
             ValidateGetVertexArrayIndexediv(context, vaobjPacked, index, pname, param));
 
1497
        if (isCallValid)
 
1498
        {
 
1499
            context->getVertexArrayIndexediv(vaobjPacked, index, pname, param);
 
1500
        }
 
1501
        ANGLE_CAPTURE(GetVertexArrayIndexediv, isCallValid, context, vaobjPacked, index, pname,
 
1502
                      param);
 
1503
    }
 
1504
}
 
1505
 
 
1506
void GL_APIENTRY GetVertexArrayiv(GLuint vaobj, GLenum pname, GLint *param)
 
1507
{
 
1508
    Context *context = GetValidGlobalContext();
 
1509
    EVENT("glGetVertexArrayiv",
 
1510
          "context = %d, GLuint vaobj = %u, GLenum pname = %s, GLint *param = 0x%016" PRIxPTR "",
 
1511
          CID(context), vaobj, GLenumToString(GLenumGroup::VertexArrayPName, pname),
 
1512
          (uintptr_t)param);
 
1513
 
 
1514
    if (context)
 
1515
    {
 
1516
        VertexArrayID vaobjPacked                     = FromGL<VertexArrayID>(vaobj);
 
1517
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1518
        bool isCallValid                              = (context->skipValidation() ||
 
1519
                            ValidateGetVertexArrayiv(context, vaobjPacked, pname, param));
 
1520
        if (isCallValid)
 
1521
        {
 
1522
            context->getVertexArrayiv(vaobjPacked, pname, param);
 
1523
        }
 
1524
        ANGLE_CAPTURE(GetVertexArrayiv, isCallValid, context, vaobjPacked, pname, param);
 
1525
    }
 
1526
}
 
1527
 
 
1528
void GL_APIENTRY
 
1529
GetnColorTable(GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table)
 
1530
{
 
1531
    Context *context = GetValidGlobalContext();
 
1532
    EVENT("glGetnColorTable",
 
1533
          "context = %d, GLenum target = %s, GLenum format = %s, GLenum type = %s, GLsizei bufSize "
 
1534
          "= %d, void *table = 0x%016" PRIxPTR "",
 
1535
          CID(context), GLenumToString(GLenumGroup::ColorTableTarget, target),
 
1536
          GLenumToString(GLenumGroup::PixelFormat, format),
 
1537
          GLenumToString(GLenumGroup::PixelType, type), bufSize, (uintptr_t)table);
 
1538
 
 
1539
    if (context)
 
1540
    {
 
1541
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1542
        bool isCallValid                              = (context->skipValidation() ||
 
1543
                            ValidateGetnColorTable(context, target, format, type, bufSize, table));
 
1544
        if (isCallValid)
 
1545
        {
 
1546
            context->getnColorTable(target, format, type, bufSize, table);
 
1547
        }
 
1548
        ANGLE_CAPTURE(GetnColorTable, isCallValid, context, target, format, type, bufSize, table);
 
1549
    }
 
1550
}
 
1551
 
 
1552
void GL_APIENTRY GetnCompressedTexImage(GLenum target, GLint lod, GLsizei bufSize, void *pixels)
 
1553
{
 
1554
    Context *context = GetValidGlobalContext();
 
1555
    EVENT("glGetnCompressedTexImage",
 
1556
          "context = %d, GLenum target = %s, GLint lod = %d, GLsizei bufSize = %d, void *pixels = "
 
1557
          "0x%016" PRIxPTR "",
 
1558
          CID(context), GLenumToString(GLenumGroup::TextureTarget, target), lod, bufSize,
 
1559
          (uintptr_t)pixels);
 
1560
 
 
1561
    if (context)
 
1562
    {
 
1563
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1564
        bool isCallValid                              = (context->skipValidation() ||
 
1565
                            ValidateGetnCompressedTexImage(context, target, lod, bufSize, pixels));
 
1566
        if (isCallValid)
 
1567
        {
 
1568
            context->getnCompressedTexImage(target, lod, bufSize, pixels);
 
1569
        }
 
1570
        ANGLE_CAPTURE(GetnCompressedTexImage, isCallValid, context, target, lod, bufSize, pixels);
 
1571
    }
 
1572
}
 
1573
 
 
1574
void GL_APIENTRY
 
1575
GetnConvolutionFilter(GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image)
 
1576
{
 
1577
    Context *context = GetValidGlobalContext();
 
1578
    EVENT("glGetnConvolutionFilter",
 
1579
          "context = %d, GLenum target = %s, GLenum format = %s, GLenum type = %s, GLsizei bufSize "
 
1580
          "= %d, void *image = 0x%016" PRIxPTR "",
 
1581
          CID(context), GLenumToString(GLenumGroup::ConvolutionTarget, target),
 
1582
          GLenumToString(GLenumGroup::PixelFormat, format),
 
1583
          GLenumToString(GLenumGroup::PixelType, type), bufSize, (uintptr_t)image);
 
1584
 
 
1585
    if (context)
 
1586
    {
 
1587
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1588
        bool isCallValid =
 
1589
            (context->skipValidation() ||
 
1590
             ValidateGetnConvolutionFilter(context, target, format, type, bufSize, image));
 
1591
        if (isCallValid)
 
1592
        {
 
1593
            context->getnConvolutionFilter(target, format, type, bufSize, image);
 
1594
        }
 
1595
        ANGLE_CAPTURE(GetnConvolutionFilter, isCallValid, context, target, format, type, bufSize,
 
1596
                      image);
 
1597
    }
 
1598
}
 
1599
 
 
1600
void GL_APIENTRY GetnHistogram(GLenum target,
 
1601
                               GLboolean reset,
 
1602
                               GLenum format,
 
1603
                               GLenum type,
 
1604
                               GLsizei bufSize,
 
1605
                               void *values)
 
1606
{
 
1607
    Context *context = GetValidGlobalContext();
 
1608
    EVENT("glGetnHistogram",
 
1609
          "context = %d, GLenum target = %s, GLboolean reset = %s, GLenum format = %s, GLenum type "
 
1610
          "= %s, GLsizei bufSize = %d, void *values = 0x%016" PRIxPTR "",
 
1611
          CID(context), GLenumToString(GLenumGroup::HistogramTargetEXT, target),
 
1612
          GLbooleanToString(reset), GLenumToString(GLenumGroup::PixelFormat, format),
 
1613
          GLenumToString(GLenumGroup::PixelType, type), bufSize, (uintptr_t)values);
 
1614
 
 
1615
    if (context)
 
1616
    {
 
1617
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1618
        bool isCallValid =
 
1619
            (context->skipValidation() ||
 
1620
             ValidateGetnHistogram(context, target, reset, format, type, bufSize, values));
 
1621
        if (isCallValid)
 
1622
        {
 
1623
            context->getnHistogram(target, reset, format, type, bufSize, values);
 
1624
        }
 
1625
        ANGLE_CAPTURE(GetnHistogram, isCallValid, context, target, reset, format, type, bufSize,
 
1626
                      values);
 
1627
    }
 
1628
}
 
1629
 
 
1630
void GL_APIENTRY GetnMapdv(GLenum target, GLenum query, GLsizei bufSize, GLdouble *v)
 
1631
{
 
1632
    Context *context = GetValidGlobalContext();
 
1633
    EVENT("glGetnMapdv",
 
1634
          "context = %d, GLenum target = %s, GLenum query = %s, GLsizei bufSize = %d, GLdouble *v "
 
1635
          "= 0x%016" PRIxPTR "",
 
1636
          CID(context), GLenumToString(GLenumGroup::MapTarget, target),
 
1637
          GLenumToString(GLenumGroup::MapQuery, query), bufSize, (uintptr_t)v);
 
1638
 
 
1639
    if (context)
 
1640
    {
 
1641
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1642
        bool isCallValid =
 
1643
            (context->skipValidation() || ValidateGetnMapdv(context, target, query, bufSize, v));
 
1644
        if (isCallValid)
 
1645
        {
 
1646
            context->getnMapdv(target, query, bufSize, v);
 
1647
        }
 
1648
        ANGLE_CAPTURE(GetnMapdv, isCallValid, context, target, query, bufSize, v);
 
1649
    }
 
1650
}
 
1651
 
 
1652
void GL_APIENTRY GetnMapfv(GLenum target, GLenum query, GLsizei bufSize, GLfloat *v)
 
1653
{
 
1654
    Context *context = GetValidGlobalContext();
 
1655
    EVENT("glGetnMapfv",
 
1656
          "context = %d, GLenum target = %s, GLenum query = %s, GLsizei bufSize = %d, GLfloat *v = "
 
1657
          "0x%016" PRIxPTR "",
 
1658
          CID(context), GLenumToString(GLenumGroup::MapTarget, target),
 
1659
          GLenumToString(GLenumGroup::MapQuery, query), bufSize, (uintptr_t)v);
 
1660
 
 
1661
    if (context)
 
1662
    {
 
1663
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1664
        bool isCallValid =
 
1665
            (context->skipValidation() || ValidateGetnMapfv(context, target, query, bufSize, v));
 
1666
        if (isCallValid)
 
1667
        {
 
1668
            context->getnMapfv(target, query, bufSize, v);
 
1669
        }
 
1670
        ANGLE_CAPTURE(GetnMapfv, isCallValid, context, target, query, bufSize, v);
 
1671
    }
 
1672
}
 
1673
 
 
1674
void GL_APIENTRY GetnMapiv(GLenum target, GLenum query, GLsizei bufSize, GLint *v)
 
1675
{
 
1676
    Context *context = GetValidGlobalContext();
 
1677
    EVENT("glGetnMapiv",
 
1678
          "context = %d, GLenum target = %s, GLenum query = %s, GLsizei bufSize = %d, GLint *v = "
 
1679
          "0x%016" PRIxPTR "",
 
1680
          CID(context), GLenumToString(GLenumGroup::MapTarget, target),
 
1681
          GLenumToString(GLenumGroup::MapQuery, query), bufSize, (uintptr_t)v);
 
1682
 
 
1683
    if (context)
 
1684
    {
 
1685
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1686
        bool isCallValid =
 
1687
            (context->skipValidation() || ValidateGetnMapiv(context, target, query, bufSize, v));
 
1688
        if (isCallValid)
 
1689
        {
 
1690
            context->getnMapiv(target, query, bufSize, v);
 
1691
        }
 
1692
        ANGLE_CAPTURE(GetnMapiv, isCallValid, context, target, query, bufSize, v);
 
1693
    }
 
1694
}
 
1695
 
 
1696
void GL_APIENTRY GetnMinmax(GLenum target,
 
1697
                            GLboolean reset,
 
1698
                            GLenum format,
 
1699
                            GLenum type,
 
1700
                            GLsizei bufSize,
 
1701
                            void *values)
 
1702
{
 
1703
    Context *context = GetValidGlobalContext();
 
1704
    EVENT("glGetnMinmax",
 
1705
          "context = %d, GLenum target = %s, GLboolean reset = %s, GLenum format = %s, GLenum type "
 
1706
          "= %s, GLsizei bufSize = %d, void *values = 0x%016" PRIxPTR "",
 
1707
          CID(context), GLenumToString(GLenumGroup::MinmaxTargetEXT, target),
 
1708
          GLbooleanToString(reset), GLenumToString(GLenumGroup::PixelFormat, format),
 
1709
          GLenumToString(GLenumGroup::PixelType, type), bufSize, (uintptr_t)values);
 
1710
 
 
1711
    if (context)
 
1712
    {
 
1713
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1714
        bool isCallValid =
 
1715
            (context->skipValidation() ||
 
1716
             ValidateGetnMinmax(context, target, reset, format, type, bufSize, values));
 
1717
        if (isCallValid)
 
1718
        {
 
1719
            context->getnMinmax(target, reset, format, type, bufSize, values);
 
1720
        }
 
1721
        ANGLE_CAPTURE(GetnMinmax, isCallValid, context, target, reset, format, type, bufSize,
 
1722
                      values);
 
1723
    }
 
1724
}
 
1725
 
 
1726
void GL_APIENTRY GetnPixelMapfv(GLenum map, GLsizei bufSize, GLfloat *values)
 
1727
{
 
1728
    Context *context = GetValidGlobalContext();
 
1729
    EVENT("glGetnPixelMapfv",
 
1730
          "context = %d, GLenum map = %s, GLsizei bufSize = %d, GLfloat *values = 0x%016" PRIxPTR
 
1731
          "",
 
1732
          CID(context), GLenumToString(GLenumGroup::PixelMap, map), bufSize, (uintptr_t)values);
 
1733
 
 
1734
    if (context)
 
1735
    {
 
1736
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1737
        bool isCallValid =
 
1738
            (context->skipValidation() || ValidateGetnPixelMapfv(context, map, bufSize, values));
 
1739
        if (isCallValid)
 
1740
        {
 
1741
            context->getnPixelMapfv(map, bufSize, values);
 
1742
        }
 
1743
        ANGLE_CAPTURE(GetnPixelMapfv, isCallValid, context, map, bufSize, values);
 
1744
    }
 
1745
}
 
1746
 
 
1747
void GL_APIENTRY GetnPixelMapuiv(GLenum map, GLsizei bufSize, GLuint *values)
 
1748
{
 
1749
    Context *context = GetValidGlobalContext();
 
1750
    EVENT("glGetnPixelMapuiv",
 
1751
          "context = %d, GLenum map = %s, GLsizei bufSize = %d, GLuint *values = 0x%016" PRIxPTR "",
 
1752
          CID(context), GLenumToString(GLenumGroup::PixelMap, map), bufSize, (uintptr_t)values);
 
1753
 
 
1754
    if (context)
 
1755
    {
 
1756
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1757
        bool isCallValid =
 
1758
            (context->skipValidation() || ValidateGetnPixelMapuiv(context, map, bufSize, values));
 
1759
        if (isCallValid)
 
1760
        {
 
1761
            context->getnPixelMapuiv(map, bufSize, values);
 
1762
        }
 
1763
        ANGLE_CAPTURE(GetnPixelMapuiv, isCallValid, context, map, bufSize, values);
 
1764
    }
 
1765
}
 
1766
 
 
1767
void GL_APIENTRY GetnPixelMapusv(GLenum map, GLsizei bufSize, GLushort *values)
 
1768
{
 
1769
    Context *context = GetValidGlobalContext();
 
1770
    EVENT("glGetnPixelMapusv",
 
1771
          "context = %d, GLenum map = %s, GLsizei bufSize = %d, GLushort *values = 0x%016" PRIxPTR
 
1772
          "",
 
1773
          CID(context), GLenumToString(GLenumGroup::PixelMap, map), bufSize, (uintptr_t)values);
 
1774
 
 
1775
    if (context)
 
1776
    {
 
1777
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1778
        bool isCallValid =
 
1779
            (context->skipValidation() || ValidateGetnPixelMapusv(context, map, bufSize, values));
 
1780
        if (isCallValid)
 
1781
        {
 
1782
            context->getnPixelMapusv(map, bufSize, values);
 
1783
        }
 
1784
        ANGLE_CAPTURE(GetnPixelMapusv, isCallValid, context, map, bufSize, values);
 
1785
    }
 
1786
}
 
1787
 
 
1788
void GL_APIENTRY GetnPolygonStipple(GLsizei bufSize, GLubyte *pattern)
 
1789
{
 
1790
    Context *context = GetValidGlobalContext();
 
1791
    EVENT("glGetnPolygonStipple",
 
1792
          "context = %d, GLsizei bufSize = %d, GLubyte *pattern = 0x%016" PRIxPTR "", CID(context),
 
1793
          bufSize, (uintptr_t)pattern);
 
1794
 
 
1795
    if (context)
 
1796
    {
 
1797
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1798
        bool isCallValid =
 
1799
            (context->skipValidation() || ValidateGetnPolygonStipple(context, bufSize, pattern));
 
1800
        if (isCallValid)
 
1801
        {
 
1802
            context->getnPolygonStipple(bufSize, pattern);
 
1803
        }
 
1804
        ANGLE_CAPTURE(GetnPolygonStipple, isCallValid, context, bufSize, pattern);
 
1805
    }
 
1806
}
 
1807
 
 
1808
void GL_APIENTRY GetnSeparableFilter(GLenum target,
 
1809
                                     GLenum format,
 
1810
                                     GLenum type,
 
1811
                                     GLsizei rowBufSize,
 
1812
                                     void *row,
 
1813
                                     GLsizei columnBufSize,
 
1814
                                     void *column,
 
1815
                                     void *span)
 
1816
{
 
1817
    Context *context = GetValidGlobalContext();
 
1818
    EVENT("glGetnSeparableFilter",
 
1819
          "context = %d, GLenum target = %s, GLenum format = %s, GLenum type = %s, GLsizei "
 
1820
          "rowBufSize = %d, void *row = 0x%016" PRIxPTR
 
1821
          ", GLsizei columnBufSize = %d, void *column = 0x%016" PRIxPTR
 
1822
          ", void *span = 0x%016" PRIxPTR "",
 
1823
          CID(context), GLenumToString(GLenumGroup::SeparableTargetEXT, target),
 
1824
          GLenumToString(GLenumGroup::PixelFormat, format),
 
1825
          GLenumToString(GLenumGroup::PixelType, type), rowBufSize, (uintptr_t)row, columnBufSize,
 
1826
          (uintptr_t)column, (uintptr_t)span);
 
1827
 
 
1828
    if (context)
 
1829
    {
 
1830
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1831
        bool isCallValid                              = (context->skipValidation() ||
 
1832
                            ValidateGetnSeparableFilter(context, target, format, type, rowBufSize,
 
1833
                                                        row, columnBufSize, column, span));
 
1834
        if (isCallValid)
 
1835
        {
 
1836
            context->getnSeparableFilter(target, format, type, rowBufSize, row, columnBufSize,
 
1837
                                         column, span);
 
1838
        }
 
1839
        ANGLE_CAPTURE(GetnSeparableFilter, isCallValid, context, target, format, type, rowBufSize,
 
1840
                      row, columnBufSize, column, span);
 
1841
    }
 
1842
}
 
1843
 
 
1844
void GL_APIENTRY
 
1845
GetnTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels)
 
1846
{
 
1847
    Context *context = GetValidGlobalContext();
 
1848
    EVENT("glGetnTexImage",
 
1849
          "context = %d, GLenum target = %s, GLint level = %d, GLenum format = %s, GLenum type = "
 
1850
          "%s, GLsizei bufSize = %d, void *pixels = 0x%016" PRIxPTR "",
 
1851
          CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level,
 
1852
          GLenumToString(GLenumGroup::PixelFormat, format),
 
1853
          GLenumToString(GLenumGroup::PixelType, type), bufSize, (uintptr_t)pixels);
 
1854
 
 
1855
    if (context)
 
1856
    {
 
1857
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1858
        bool isCallValid =
 
1859
            (context->skipValidation() ||
 
1860
             ValidateGetnTexImage(context, target, level, format, type, bufSize, pixels));
 
1861
        if (isCallValid)
 
1862
        {
 
1863
            context->getnTexImage(target, level, format, type, bufSize, pixels);
 
1864
        }
 
1865
        ANGLE_CAPTURE(GetnTexImage, isCallValid, context, target, level, format, type, bufSize,
 
1866
                      pixels);
 
1867
    }
 
1868
}
 
1869
 
 
1870
void GL_APIENTRY GetnUniformdv(GLuint program, GLint location, GLsizei bufSize, GLdouble *params)
 
1871
{
 
1872
    Context *context = GetValidGlobalContext();
 
1873
    EVENT("glGetnUniformdv",
 
1874
          "context = %d, GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLdouble "
 
1875
          "*params = 0x%016" PRIxPTR "",
 
1876
          CID(context), program, location, bufSize, (uintptr_t)params);
 
1877
 
 
1878
    if (context)
 
1879
    {
 
1880
        ShaderProgramID programPacked                 = FromGL<ShaderProgramID>(program);
 
1881
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1882
        bool isCallValid =
 
1883
            (context->skipValidation() ||
 
1884
             ValidateGetnUniformdv(context, programPacked, location, bufSize, params));
 
1885
        if (isCallValid)
 
1886
        {
 
1887
            context->getnUniformdv(programPacked, location, bufSize, params);
 
1888
        }
 
1889
        ANGLE_CAPTURE(GetnUniformdv, isCallValid, context, programPacked, location, bufSize,
 
1890
                      params);
 
1891
    }
 
1892
}
 
1893
 
 
1894
void GL_APIENTRY GetnUniformfv(GLuint program, GLint location, GLsizei bufSize, GLfloat *params)
 
1895
{
 
1896
    Context *context = GetValidGlobalContext();
 
1897
    EVENT("glGetnUniformfv",
 
1898
          "context = %d, GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLfloat "
 
1899
          "*params = 0x%016" PRIxPTR "",
 
1900
          CID(context), program, location, bufSize, (uintptr_t)params);
 
1901
 
 
1902
    if (context)
 
1903
    {
 
1904
        ShaderProgramID programPacked                 = FromGL<ShaderProgramID>(program);
 
1905
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1906
        bool isCallValid =
 
1907
            (context->skipValidation() ||
 
1908
             ValidateGetnUniformfv(context, programPacked, location, bufSize, params));
 
1909
        if (isCallValid)
 
1910
        {
 
1911
            context->getnUniformfv(programPacked, location, bufSize, params);
 
1912
        }
 
1913
        ANGLE_CAPTURE(GetnUniformfv, isCallValid, context, programPacked, location, bufSize,
 
1914
                      params);
 
1915
    }
 
1916
}
 
1917
 
 
1918
void GL_APIENTRY GetnUniformiv(GLuint program, GLint location, GLsizei bufSize, GLint *params)
 
1919
{
 
1920
    Context *context = GetValidGlobalContext();
 
1921
    EVENT("glGetnUniformiv",
 
1922
          "context = %d, GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLint "
 
1923
          "*params = 0x%016" PRIxPTR "",
 
1924
          CID(context), program, location, bufSize, (uintptr_t)params);
 
1925
 
 
1926
    if (context)
 
1927
    {
 
1928
        ShaderProgramID programPacked                 = FromGL<ShaderProgramID>(program);
 
1929
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1930
        bool isCallValid =
 
1931
            (context->skipValidation() ||
 
1932
             ValidateGetnUniformiv(context, programPacked, location, bufSize, params));
 
1933
        if (isCallValid)
 
1934
        {
 
1935
            context->getnUniformiv(programPacked, location, bufSize, params);
 
1936
        }
 
1937
        ANGLE_CAPTURE(GetnUniformiv, isCallValid, context, programPacked, location, bufSize,
 
1938
                      params);
 
1939
    }
 
1940
}
 
1941
 
 
1942
void GL_APIENTRY GetnUniformuiv(GLuint program, GLint location, GLsizei bufSize, GLuint *params)
 
1943
{
 
1944
    Context *context = GetValidGlobalContext();
 
1945
    EVENT("glGetnUniformuiv",
 
1946
          "context = %d, GLuint program = %u, GLint location = %d, GLsizei bufSize = %d, GLuint "
 
1947
          "*params = 0x%016" PRIxPTR "",
 
1948
          CID(context), program, location, bufSize, (uintptr_t)params);
 
1949
 
 
1950
    if (context)
 
1951
    {
 
1952
        ShaderProgramID programPacked                 = FromGL<ShaderProgramID>(program);
 
1953
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1954
        bool isCallValid =
 
1955
            (context->skipValidation() ||
 
1956
             ValidateGetnUniformuiv(context, programPacked, location, bufSize, params));
 
1957
        if (isCallValid)
 
1958
        {
 
1959
            context->getnUniformuiv(programPacked, location, bufSize, params);
 
1960
        }
 
1961
        ANGLE_CAPTURE(GetnUniformuiv, isCallValid, context, programPacked, location, bufSize,
 
1962
                      params);
 
1963
    }
 
1964
}
 
1965
 
 
1966
void GL_APIENTRY InvalidateNamedFramebufferData(GLuint framebuffer,
 
1967
                                                GLsizei numAttachments,
 
1968
                                                const GLenum *attachments)
 
1969
{
 
1970
    Context *context = GetValidGlobalContext();
 
1971
    EVENT("glInvalidateNamedFramebufferData",
 
1972
          "context = %d, GLuint framebuffer = %u, GLsizei numAttachments = %d, const GLenum "
 
1973
          "*attachments = 0x%016" PRIxPTR "",
 
1974
          CID(context), framebuffer, numAttachments, (uintptr_t)attachments);
 
1975
 
 
1976
    if (context)
 
1977
    {
 
1978
        FramebufferID framebufferPacked               = FromGL<FramebufferID>(framebuffer);
 
1979
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
1980
        bool isCallValid                              = (context->skipValidation() ||
 
1981
                            ValidateInvalidateNamedFramebufferData(context, framebufferPacked,
 
1982
                                                                   numAttachments, attachments));
 
1983
        if (isCallValid)
 
1984
        {
 
1985
            context->invalidateNamedFramebufferData(framebufferPacked, numAttachments, attachments);
 
1986
        }
 
1987
        ANGLE_CAPTURE(InvalidateNamedFramebufferData, isCallValid, context, framebufferPacked,
 
1988
                      numAttachments, attachments);
 
1989
    }
 
1990
}
 
1991
 
 
1992
void GL_APIENTRY InvalidateNamedFramebufferSubData(GLuint framebuffer,
 
1993
                                                   GLsizei numAttachments,
 
1994
                                                   const GLenum *attachments,
 
1995
                                                   GLint x,
 
1996
                                                   GLint y,
 
1997
                                                   GLsizei width,
 
1998
                                                   GLsizei height)
 
1999
{
 
2000
    Context *context = GetValidGlobalContext();
 
2001
    EVENT("glInvalidateNamedFramebufferSubData",
 
2002
          "context = %d, GLuint framebuffer = %u, GLsizei numAttachments = %d, const GLenum "
 
2003
          "*attachments = 0x%016" PRIxPTR
 
2004
          ", GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d",
 
2005
          CID(context), framebuffer, numAttachments, (uintptr_t)attachments, x, y, width, height);
 
2006
 
 
2007
    if (context)
 
2008
    {
 
2009
        FramebufferID framebufferPacked               = FromGL<FramebufferID>(framebuffer);
 
2010
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2011
        bool isCallValid =
 
2012
            (context->skipValidation() ||
 
2013
             ValidateInvalidateNamedFramebufferSubData(context, framebufferPacked, numAttachments,
 
2014
                                                       attachments, x, y, width, height));
 
2015
        if (isCallValid)
 
2016
        {
 
2017
            context->invalidateNamedFramebufferSubData(framebufferPacked, numAttachments,
 
2018
                                                       attachments, x, y, width, height);
 
2019
        }
 
2020
        ANGLE_CAPTURE(InvalidateNamedFramebufferSubData, isCallValid, context, framebufferPacked,
 
2021
                      numAttachments, attachments, x, y, width, height);
 
2022
    }
 
2023
}
 
2024
 
 
2025
void *GL_APIENTRY MapNamedBuffer(GLuint buffer, GLenum access)
 
2026
{
 
2027
    Context *context = GetValidGlobalContext();
 
2028
    EVENT("glMapNamedBuffer", "context = %d, GLuint buffer = %u, GLenum access = %s", CID(context),
 
2029
          buffer, GLenumToString(GLenumGroup::BufferAccessARB, access));
 
2030
 
 
2031
    void *returnValue;
 
2032
    if (context)
 
2033
    {
 
2034
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
2035
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2036
        bool isCallValid =
 
2037
            (context->skipValidation() || ValidateMapNamedBuffer(context, bufferPacked, access));
 
2038
        if (isCallValid)
 
2039
        {
 
2040
            returnValue = context->mapNamedBuffer(bufferPacked, access);
 
2041
        }
 
2042
        else
 
2043
        {
 
2044
            returnValue = GetDefaultReturnValue<EntryPoint::MapNamedBuffer, void *>();
 
2045
        }
 
2046
        ANGLE_CAPTURE(MapNamedBuffer, isCallValid, context, bufferPacked, access, returnValue);
 
2047
    }
 
2048
    else
 
2049
    {
 
2050
        returnValue = GetDefaultReturnValue<EntryPoint::MapNamedBuffer, void *>();
 
2051
    }
 
2052
    return returnValue;
 
2053
}
 
2054
 
 
2055
void *GL_APIENTRY MapNamedBufferRange(GLuint buffer,
 
2056
                                      GLintptr offset,
 
2057
                                      GLsizeiptr length,
 
2058
                                      GLbitfield access)
 
2059
{
 
2060
    Context *context = GetValidGlobalContext();
 
2061
    EVENT("glMapNamedBufferRange",
 
2062
          "context = %d, GLuint buffer = %u, GLintptr offset = %llu, GLsizeiptr length = %llu, "
 
2063
          "GLbitfield access = %s",
 
2064
          CID(context), buffer, static_cast<unsigned long long>(offset),
 
2065
          static_cast<unsigned long long>(length),
 
2066
          GLbitfieldToString(GLenumGroup::BufferAccessMask, access).c_str());
 
2067
 
 
2068
    void *returnValue;
 
2069
    if (context)
 
2070
    {
 
2071
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
2072
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2073
        bool isCallValid =
 
2074
            (context->skipValidation() ||
 
2075
             ValidateMapNamedBufferRange(context, bufferPacked, offset, length, access));
 
2076
        if (isCallValid)
 
2077
        {
 
2078
            returnValue = context->mapNamedBufferRange(bufferPacked, offset, length, access);
 
2079
        }
 
2080
        else
 
2081
        {
 
2082
            returnValue = GetDefaultReturnValue<EntryPoint::MapNamedBufferRange, void *>();
 
2083
        }
 
2084
        ANGLE_CAPTURE(MapNamedBufferRange, isCallValid, context, bufferPacked, offset, length,
 
2085
                      access, returnValue);
 
2086
    }
 
2087
    else
 
2088
    {
 
2089
        returnValue = GetDefaultReturnValue<EntryPoint::MapNamedBufferRange, void *>();
 
2090
    }
 
2091
    return returnValue;
 
2092
}
 
2093
 
 
2094
void GL_APIENTRY MemoryBarrierByRegion(GLbitfield barriers)
 
2095
{
 
2096
    Context *context = GetValidGlobalContext();
 
2097
    EVENT("glMemoryBarrierByRegion", "context = %d, GLbitfield barriers = %s", CID(context),
 
2098
          GLbitfieldToString(GLenumGroup::MemoryBarrierMask, barriers).c_str());
 
2099
 
 
2100
    if (context)
 
2101
    {
 
2102
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2103
        bool isCallValid =
 
2104
            (context->skipValidation() || ValidateMemoryBarrierByRegion(context, barriers));
 
2105
        if (isCallValid)
 
2106
        {
 
2107
            context->memoryBarrierByRegion(barriers);
 
2108
        }
 
2109
        ANGLE_CAPTURE(MemoryBarrierByRegion, isCallValid, context, barriers);
 
2110
    }
 
2111
}
 
2112
 
 
2113
void GL_APIENTRY NamedBufferData(GLuint buffer, GLsizeiptr size, const void *data, GLenum usage)
 
2114
{
 
2115
    Context *context = GetValidGlobalContext();
 
2116
    EVENT("glNamedBufferData",
 
2117
          "context = %d, GLuint buffer = %u, GLsizeiptr size = %llu, const void *data = "
 
2118
          "0x%016" PRIxPTR ", GLenum usage = %s",
 
2119
          CID(context), buffer, static_cast<unsigned long long>(size), (uintptr_t)data,
 
2120
          GLenumToString(GLenumGroup::VertexBufferObjectUsage, usage));
 
2121
 
 
2122
    if (context)
 
2123
    {
 
2124
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
2125
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2126
        bool isCallValid                              = (context->skipValidation() ||
 
2127
                            ValidateNamedBufferData(context, bufferPacked, size, data, usage));
 
2128
        if (isCallValid)
 
2129
        {
 
2130
            context->namedBufferData(bufferPacked, size, data, usage);
 
2131
        }
 
2132
        ANGLE_CAPTURE(NamedBufferData, isCallValid, context, bufferPacked, size, data, usage);
 
2133
    }
 
2134
}
 
2135
 
 
2136
void GL_APIENTRY NamedBufferStorage(GLuint buffer,
 
2137
                                    GLsizeiptr size,
 
2138
                                    const void *data,
 
2139
                                    GLbitfield flags)
 
2140
{
 
2141
    Context *context = GetValidGlobalContext();
 
2142
    EVENT("glNamedBufferStorage",
 
2143
          "context = %d, GLuint buffer = %u, GLsizeiptr size = %llu, const void *data = "
 
2144
          "0x%016" PRIxPTR ", GLbitfield flags = %s",
 
2145
          CID(context), buffer, static_cast<unsigned long long>(size), (uintptr_t)data,
 
2146
          GLbitfieldToString(GLenumGroup::MapBufferUsageMask, flags).c_str());
 
2147
 
 
2148
    if (context)
 
2149
    {
 
2150
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
2151
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2152
        bool isCallValid                              = (context->skipValidation() ||
 
2153
                            ValidateNamedBufferStorage(context, bufferPacked, size, data, flags));
 
2154
        if (isCallValid)
 
2155
        {
 
2156
            context->namedBufferStorage(bufferPacked, size, data, flags);
 
2157
        }
 
2158
        ANGLE_CAPTURE(NamedBufferStorage, isCallValid, context, bufferPacked, size, data, flags);
 
2159
    }
 
2160
}
 
2161
 
 
2162
void GL_APIENTRY NamedBufferSubData(GLuint buffer,
 
2163
                                    GLintptr offset,
 
2164
                                    GLsizeiptr size,
 
2165
                                    const void *data)
 
2166
{
 
2167
    Context *context = GetValidGlobalContext();
 
2168
    EVENT("glNamedBufferSubData",
 
2169
          "context = %d, GLuint buffer = %u, GLintptr offset = %llu, GLsizeiptr size = %llu, const "
 
2170
          "void *data = 0x%016" PRIxPTR "",
 
2171
          CID(context), buffer, static_cast<unsigned long long>(offset),
 
2172
          static_cast<unsigned long long>(size), (uintptr_t)data);
 
2173
 
 
2174
    if (context)
 
2175
    {
 
2176
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
2177
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2178
        bool isCallValid                              = (context->skipValidation() ||
 
2179
                            ValidateNamedBufferSubData(context, bufferPacked, offset, size, data));
 
2180
        if (isCallValid)
 
2181
        {
 
2182
            context->namedBufferSubData(bufferPacked, offset, size, data);
 
2183
        }
 
2184
        ANGLE_CAPTURE(NamedBufferSubData, isCallValid, context, bufferPacked, offset, size, data);
 
2185
    }
 
2186
}
 
2187
 
 
2188
void GL_APIENTRY NamedFramebufferDrawBuffer(GLuint framebuffer, GLenum buf)
 
2189
{
 
2190
    Context *context = GetValidGlobalContext();
 
2191
    EVENT("glNamedFramebufferDrawBuffer", "context = %d, GLuint framebuffer = %u, GLenum buf = %s",
 
2192
          CID(context), framebuffer, GLenumToString(GLenumGroup::ColorBuffer, buf));
 
2193
 
 
2194
    if (context)
 
2195
    {
 
2196
        FramebufferID framebufferPacked               = FromGL<FramebufferID>(framebuffer);
 
2197
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2198
        bool isCallValid                              = (context->skipValidation() ||
 
2199
                            ValidateNamedFramebufferDrawBuffer(context, framebufferPacked, buf));
 
2200
        if (isCallValid)
 
2201
        {
 
2202
            context->namedFramebufferDrawBuffer(framebufferPacked, buf);
 
2203
        }
 
2204
        ANGLE_CAPTURE(NamedFramebufferDrawBuffer, isCallValid, context, framebufferPacked, buf);
 
2205
    }
 
2206
}
 
2207
 
 
2208
void GL_APIENTRY NamedFramebufferDrawBuffers(GLuint framebuffer, GLsizei n, const GLenum *bufs)
 
2209
{
 
2210
    Context *context = GetValidGlobalContext();
 
2211
    EVENT(
 
2212
        "glNamedFramebufferDrawBuffers",
 
2213
        "context = %d, GLuint framebuffer = %u, GLsizei n = %d, const GLenum *bufs = 0x%016" PRIxPTR
 
2214
        "",
 
2215
        CID(context), framebuffer, n, (uintptr_t)bufs);
 
2216
 
 
2217
    if (context)
 
2218
    {
 
2219
        FramebufferID framebufferPacked               = FromGL<FramebufferID>(framebuffer);
 
2220
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2221
        bool isCallValid = (context->skipValidation() || ValidateNamedFramebufferDrawBuffers(
 
2222
                                                             context, framebufferPacked, n, bufs));
 
2223
        if (isCallValid)
 
2224
        {
 
2225
            context->namedFramebufferDrawBuffers(framebufferPacked, n, bufs);
 
2226
        }
 
2227
        ANGLE_CAPTURE(NamedFramebufferDrawBuffers, isCallValid, context, framebufferPacked, n,
 
2228
                      bufs);
 
2229
    }
 
2230
}
 
2231
 
 
2232
void GL_APIENTRY NamedFramebufferParameteri(GLuint framebuffer, GLenum pname, GLint param)
 
2233
{
 
2234
    Context *context = GetValidGlobalContext();
 
2235
    EVENT("glNamedFramebufferParameteri",
 
2236
          "context = %d, GLuint framebuffer = %u, GLenum pname = %s, GLint param = %d",
 
2237
          CID(context), framebuffer, GLenumToString(GLenumGroup::FramebufferParameterName, pname),
 
2238
          param);
 
2239
 
 
2240
    if (context)
 
2241
    {
 
2242
        FramebufferID framebufferPacked               = FromGL<FramebufferID>(framebuffer);
 
2243
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2244
        bool isCallValid =
 
2245
            (context->skipValidation() ||
 
2246
             ValidateNamedFramebufferParameteri(context, framebufferPacked, pname, param));
 
2247
        if (isCallValid)
 
2248
        {
 
2249
            context->namedFramebufferParameteri(framebufferPacked, pname, param);
 
2250
        }
 
2251
        ANGLE_CAPTURE(NamedFramebufferParameteri, isCallValid, context, framebufferPacked, pname,
 
2252
                      param);
 
2253
    }
 
2254
}
 
2255
 
 
2256
void GL_APIENTRY NamedFramebufferReadBuffer(GLuint framebuffer, GLenum src)
 
2257
{
 
2258
    Context *context = GetValidGlobalContext();
 
2259
    EVENT("glNamedFramebufferReadBuffer", "context = %d, GLuint framebuffer = %u, GLenum src = %s",
 
2260
          CID(context), framebuffer, GLenumToString(GLenumGroup::ColorBuffer, src));
 
2261
 
 
2262
    if (context)
 
2263
    {
 
2264
        FramebufferID framebufferPacked               = FromGL<FramebufferID>(framebuffer);
 
2265
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2266
        bool isCallValid                              = (context->skipValidation() ||
 
2267
                            ValidateNamedFramebufferReadBuffer(context, framebufferPacked, src));
 
2268
        if (isCallValid)
 
2269
        {
 
2270
            context->namedFramebufferReadBuffer(framebufferPacked, src);
 
2271
        }
 
2272
        ANGLE_CAPTURE(NamedFramebufferReadBuffer, isCallValid, context, framebufferPacked, src);
 
2273
    }
 
2274
}
 
2275
 
 
2276
void GL_APIENTRY NamedFramebufferRenderbuffer(GLuint framebuffer,
 
2277
                                              GLenum attachment,
 
2278
                                              GLenum renderbuffertarget,
 
2279
                                              GLuint renderbuffer)
 
2280
{
 
2281
    Context *context = GetValidGlobalContext();
 
2282
    EVENT("glNamedFramebufferRenderbuffer",
 
2283
          "context = %d, GLuint framebuffer = %u, GLenum attachment = %s, GLenum "
 
2284
          "renderbuffertarget = %s, GLuint renderbuffer = %u",
 
2285
          CID(context), framebuffer, GLenumToString(GLenumGroup::FramebufferAttachment, attachment),
 
2286
          GLenumToString(GLenumGroup::RenderbufferTarget, renderbuffertarget), renderbuffer);
 
2287
 
 
2288
    if (context)
 
2289
    {
 
2290
        FramebufferID framebufferPacked               = FromGL<FramebufferID>(framebuffer);
 
2291
        RenderbufferID renderbufferPacked             = FromGL<RenderbufferID>(renderbuffer);
 
2292
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2293
        bool isCallValid =
 
2294
            (context->skipValidation() ||
 
2295
             ValidateNamedFramebufferRenderbuffer(context, framebufferPacked, attachment,
 
2296
                                                  renderbuffertarget, renderbufferPacked));
 
2297
        if (isCallValid)
 
2298
        {
 
2299
            context->namedFramebufferRenderbuffer(framebufferPacked, attachment, renderbuffertarget,
 
2300
                                                  renderbufferPacked);
 
2301
        }
 
2302
        ANGLE_CAPTURE(NamedFramebufferRenderbuffer, isCallValid, context, framebufferPacked,
 
2303
                      attachment, renderbuffertarget, renderbufferPacked);
 
2304
    }
 
2305
}
 
2306
 
 
2307
void GL_APIENTRY NamedFramebufferTexture(GLuint framebuffer,
 
2308
                                         GLenum attachment,
 
2309
                                         GLuint texture,
 
2310
                                         GLint level)
 
2311
{
 
2312
    Context *context = GetValidGlobalContext();
 
2313
    EVENT("glNamedFramebufferTexture",
 
2314
          "context = %d, GLuint framebuffer = %u, GLenum attachment = %s, GLuint texture = %u, "
 
2315
          "GLint level = %d",
 
2316
          CID(context), framebuffer, GLenumToString(GLenumGroup::FramebufferAttachment, attachment),
 
2317
          texture, level);
 
2318
 
 
2319
    if (context)
 
2320
    {
 
2321
        FramebufferID framebufferPacked               = FromGL<FramebufferID>(framebuffer);
 
2322
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
2323
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2324
        bool isCallValid                              = (context->skipValidation() ||
 
2325
                            ValidateNamedFramebufferTexture(context, framebufferPacked, attachment,
 
2326
                                                            texturePacked, level));
 
2327
        if (isCallValid)
 
2328
        {
 
2329
            context->namedFramebufferTexture(framebufferPacked, attachment, texturePacked, level);
 
2330
        }
 
2331
        ANGLE_CAPTURE(NamedFramebufferTexture, isCallValid, context, framebufferPacked, attachment,
 
2332
                      texturePacked, level);
 
2333
    }
 
2334
}
 
2335
 
 
2336
void GL_APIENTRY NamedFramebufferTextureLayer(GLuint framebuffer,
 
2337
                                              GLenum attachment,
 
2338
                                              GLuint texture,
 
2339
                                              GLint level,
 
2340
                                              GLint layer)
 
2341
{
 
2342
    Context *context = GetValidGlobalContext();
 
2343
    EVENT("glNamedFramebufferTextureLayer",
 
2344
          "context = %d, GLuint framebuffer = %u, GLenum attachment = %s, GLuint texture = %u, "
 
2345
          "GLint level = %d, GLint layer = %d",
 
2346
          CID(context), framebuffer, GLenumToString(GLenumGroup::FramebufferAttachment, attachment),
 
2347
          texture, level, layer);
 
2348
 
 
2349
    if (context)
 
2350
    {
 
2351
        FramebufferID framebufferPacked               = FromGL<FramebufferID>(framebuffer);
 
2352
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
2353
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2354
        bool isCallValid = (context->skipValidation() || ValidateNamedFramebufferTextureLayer(
 
2355
                                                             context, framebufferPacked, attachment,
 
2356
                                                             texturePacked, level, layer));
 
2357
        if (isCallValid)
 
2358
        {
 
2359
            context->namedFramebufferTextureLayer(framebufferPacked, attachment, texturePacked,
 
2360
                                                  level, layer);
 
2361
        }
 
2362
        ANGLE_CAPTURE(NamedFramebufferTextureLayer, isCallValid, context, framebufferPacked,
 
2363
                      attachment, texturePacked, level, layer);
 
2364
    }
 
2365
}
 
2366
 
 
2367
void GL_APIENTRY NamedRenderbufferStorage(GLuint renderbuffer,
 
2368
                                          GLenum internalformat,
 
2369
                                          GLsizei width,
 
2370
                                          GLsizei height)
 
2371
{
 
2372
    Context *context = GetValidGlobalContext();
 
2373
    EVENT("glNamedRenderbufferStorage",
 
2374
          "context = %d, GLuint renderbuffer = %u, GLenum internalformat = %s, GLsizei width = %d, "
 
2375
          "GLsizei height = %d",
 
2376
          CID(context), renderbuffer, GLenumToString(GLenumGroup::InternalFormat, internalformat),
 
2377
          width, height);
 
2378
 
 
2379
    if (context)
 
2380
    {
 
2381
        RenderbufferID renderbufferPacked             = FromGL<RenderbufferID>(renderbuffer);
 
2382
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2383
        bool isCallValid                              = (context->skipValidation() ||
 
2384
                            ValidateNamedRenderbufferStorage(context, renderbufferPacked,
 
2385
                                                             internalformat, width, height));
 
2386
        if (isCallValid)
 
2387
        {
 
2388
            context->namedRenderbufferStorage(renderbufferPacked, internalformat, width, height);
 
2389
        }
 
2390
        ANGLE_CAPTURE(NamedRenderbufferStorage, isCallValid, context, renderbufferPacked,
 
2391
                      internalformat, width, height);
 
2392
    }
 
2393
}
 
2394
 
 
2395
void GL_APIENTRY NamedRenderbufferStorageMultisample(GLuint renderbuffer,
 
2396
                                                     GLsizei samples,
 
2397
                                                     GLenum internalformat,
 
2398
                                                     GLsizei width,
 
2399
                                                     GLsizei height)
 
2400
{
 
2401
    Context *context = GetValidGlobalContext();
 
2402
    EVENT("glNamedRenderbufferStorageMultisample",
 
2403
          "context = %d, GLuint renderbuffer = %u, GLsizei samples = %d, GLenum internalformat = "
 
2404
          "%s, GLsizei width = %d, GLsizei height = %d",
 
2405
          CID(context), renderbuffer, samples,
 
2406
          GLenumToString(GLenumGroup::InternalFormat, internalformat), width, height);
 
2407
 
 
2408
    if (context)
 
2409
    {
 
2410
        RenderbufferID renderbufferPacked             = FromGL<RenderbufferID>(renderbuffer);
 
2411
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2412
        bool isCallValid =
 
2413
            (context->skipValidation() ||
 
2414
             ValidateNamedRenderbufferStorageMultisample(context, renderbufferPacked, samples,
 
2415
                                                         internalformat, width, height));
 
2416
        if (isCallValid)
 
2417
        {
 
2418
            context->namedRenderbufferStorageMultisample(renderbufferPacked, samples,
 
2419
                                                         internalformat, width, height);
 
2420
        }
 
2421
        ANGLE_CAPTURE(NamedRenderbufferStorageMultisample, isCallValid, context, renderbufferPacked,
 
2422
                      samples, internalformat, width, height);
 
2423
    }
 
2424
}
 
2425
 
 
2426
void GL_APIENTRY ReadnPixels(GLint x,
 
2427
                             GLint y,
 
2428
                             GLsizei width,
 
2429
                             GLsizei height,
 
2430
                             GLenum format,
 
2431
                             GLenum type,
 
2432
                             GLsizei bufSize,
 
2433
                             void *data)
 
2434
{
 
2435
    Context *context = GetValidGlobalContext();
 
2436
    EVENT("glReadnPixels",
 
2437
          "context = %d, GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d, "
 
2438
          "GLenum format = %s, GLenum type = %s, GLsizei bufSize = %d, void *data = 0x%016" PRIxPTR
 
2439
          "",
 
2440
          CID(context), x, y, width, height, GLenumToString(GLenumGroup::PixelFormat, format),
 
2441
          GLenumToString(GLenumGroup::PixelType, type), bufSize, (uintptr_t)data);
 
2442
 
 
2443
    if (context)
 
2444
    {
 
2445
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2446
        bool isCallValid =
 
2447
            (context->skipValidation() ||
 
2448
             ValidateReadnPixels(context, x, y, width, height, format, type, bufSize, data));
 
2449
        if (isCallValid)
 
2450
        {
 
2451
            context->readnPixels(x, y, width, height, format, type, bufSize, data);
 
2452
        }
 
2453
        ANGLE_CAPTURE(ReadnPixels, isCallValid, context, x, y, width, height, format, type, bufSize,
 
2454
                      data);
 
2455
    }
 
2456
}
 
2457
 
 
2458
void GL_APIENTRY TextureBarrier()
 
2459
{
 
2460
    Context *context = GetValidGlobalContext();
 
2461
    EVENT("glTextureBarrier", "context = %d", CID(context));
 
2462
 
 
2463
    if (context)
 
2464
    {
 
2465
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2466
        bool isCallValid = (context->skipValidation() || ValidateTextureBarrier(context));
 
2467
        if (isCallValid)
 
2468
        {
 
2469
            context->textureBarrier();
 
2470
        }
 
2471
        ANGLE_CAPTURE(TextureBarrier, isCallValid, context);
 
2472
    }
 
2473
}
 
2474
 
 
2475
void GL_APIENTRY TextureBuffer(GLuint texture, GLenum internalformat, GLuint buffer)
 
2476
{
 
2477
    Context *context = GetValidGlobalContext();
 
2478
    EVENT("glTextureBuffer",
 
2479
          "context = %d, GLuint texture = %u, GLenum internalformat = %s, GLuint buffer = %u",
 
2480
          CID(context), texture, GLenumToString(GLenumGroup::InternalFormat, internalformat),
 
2481
          buffer);
 
2482
 
 
2483
    if (context)
 
2484
    {
 
2485
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
2486
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
2487
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2488
        bool isCallValid =
 
2489
            (context->skipValidation() ||
 
2490
             ValidateTextureBuffer(context, texturePacked, internalformat, bufferPacked));
 
2491
        if (isCallValid)
 
2492
        {
 
2493
            context->textureBuffer(texturePacked, internalformat, bufferPacked);
 
2494
        }
 
2495
        ANGLE_CAPTURE(TextureBuffer, isCallValid, context, texturePacked, internalformat,
 
2496
                      bufferPacked);
 
2497
    }
 
2498
}
 
2499
 
 
2500
void GL_APIENTRY TextureBufferRange(GLuint texture,
 
2501
                                    GLenum internalformat,
 
2502
                                    GLuint buffer,
 
2503
                                    GLintptr offset,
 
2504
                                    GLsizeiptr size)
 
2505
{
 
2506
    Context *context = GetValidGlobalContext();
 
2507
    EVENT("glTextureBufferRange",
 
2508
          "context = %d, GLuint texture = %u, GLenum internalformat = %s, GLuint buffer = %u, "
 
2509
          "GLintptr offset = %llu, GLsizeiptr size = %llu",
 
2510
          CID(context), texture, GLenumToString(GLenumGroup::InternalFormat, internalformat),
 
2511
          buffer, static_cast<unsigned long long>(offset), static_cast<unsigned long long>(size));
 
2512
 
 
2513
    if (context)
 
2514
    {
 
2515
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
2516
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
2517
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2518
        bool isCallValid                              = (context->skipValidation() ||
 
2519
                            ValidateTextureBufferRange(context, texturePacked, internalformat,
 
2520
                                                       bufferPacked, offset, size));
 
2521
        if (isCallValid)
 
2522
        {
 
2523
            context->textureBufferRange(texturePacked, internalformat, bufferPacked, offset, size);
 
2524
        }
 
2525
        ANGLE_CAPTURE(TextureBufferRange, isCallValid, context, texturePacked, internalformat,
 
2526
                      bufferPacked, offset, size);
 
2527
    }
 
2528
}
 
2529
 
 
2530
void GL_APIENTRY TextureParameterIiv(GLuint texture, GLenum pname, const GLint *params)
 
2531
{
 
2532
    Context *context = GetValidGlobalContext();
 
2533
    EVENT(
 
2534
        "glTextureParameterIiv",
 
2535
        "context = %d, GLuint texture = %u, GLenum pname = %s, const GLint *params = 0x%016" PRIxPTR
 
2536
        "",
 
2537
        CID(context), texture, GLenumToString(GLenumGroup::TextureParameterName, pname),
 
2538
        (uintptr_t)params);
 
2539
 
 
2540
    if (context)
 
2541
    {
 
2542
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
2543
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2544
        bool isCallValid                              = (context->skipValidation() ||
 
2545
                            ValidateTextureParameterIiv(context, texturePacked, pname, params));
 
2546
        if (isCallValid)
 
2547
        {
 
2548
            context->textureParameterIiv(texturePacked, pname, params);
 
2549
        }
 
2550
        ANGLE_CAPTURE(TextureParameterIiv, isCallValid, context, texturePacked, pname, params);
 
2551
    }
 
2552
}
 
2553
 
 
2554
void GL_APIENTRY TextureParameterIuiv(GLuint texture, GLenum pname, const GLuint *params)
 
2555
{
 
2556
    Context *context = GetValidGlobalContext();
 
2557
    EVENT("glTextureParameterIuiv",
 
2558
          "context = %d, GLuint texture = %u, GLenum pname = %s, const GLuint *params = "
 
2559
          "0x%016" PRIxPTR "",
 
2560
          CID(context), texture, GLenumToString(GLenumGroup::TextureParameterName, pname),
 
2561
          (uintptr_t)params);
 
2562
 
 
2563
    if (context)
 
2564
    {
 
2565
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
2566
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2567
        bool isCallValid                              = (context->skipValidation() ||
 
2568
                            ValidateTextureParameterIuiv(context, texturePacked, pname, params));
 
2569
        if (isCallValid)
 
2570
        {
 
2571
            context->textureParameterIuiv(texturePacked, pname, params);
 
2572
        }
 
2573
        ANGLE_CAPTURE(TextureParameterIuiv, isCallValid, context, texturePacked, pname, params);
 
2574
    }
 
2575
}
 
2576
 
 
2577
void GL_APIENTRY TextureParameterf(GLuint texture, GLenum pname, GLfloat param)
 
2578
{
 
2579
    Context *context = GetValidGlobalContext();
 
2580
    EVENT("glTextureParameterf",
 
2581
          "context = %d, GLuint texture = %u, GLenum pname = %s, GLfloat param = %f", CID(context),
 
2582
          texture, GLenumToString(GLenumGroup::TextureParameterName, pname), param);
 
2583
 
 
2584
    if (context)
 
2585
    {
 
2586
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
2587
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2588
        bool isCallValid                              = (context->skipValidation() ||
 
2589
                            ValidateTextureParameterf(context, texturePacked, pname, param));
 
2590
        if (isCallValid)
 
2591
        {
 
2592
            context->textureParameterf(texturePacked, pname, param);
 
2593
        }
 
2594
        ANGLE_CAPTURE(TextureParameterf, isCallValid, context, texturePacked, pname, param);
 
2595
    }
 
2596
}
 
2597
 
 
2598
void GL_APIENTRY TextureParameterfv(GLuint texture, GLenum pname, const GLfloat *param)
 
2599
{
 
2600
    Context *context = GetValidGlobalContext();
 
2601
    EVENT("glTextureParameterfv",
 
2602
          "context = %d, GLuint texture = %u, GLenum pname = %s, const GLfloat *param = "
 
2603
          "0x%016" PRIxPTR "",
 
2604
          CID(context), texture, GLenumToString(GLenumGroup::TextureParameterName, pname),
 
2605
          (uintptr_t)param);
 
2606
 
 
2607
    if (context)
 
2608
    {
 
2609
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
2610
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2611
        bool isCallValid                              = (context->skipValidation() ||
 
2612
                            ValidateTextureParameterfv(context, texturePacked, pname, param));
 
2613
        if (isCallValid)
 
2614
        {
 
2615
            context->textureParameterfv(texturePacked, pname, param);
 
2616
        }
 
2617
        ANGLE_CAPTURE(TextureParameterfv, isCallValid, context, texturePacked, pname, param);
 
2618
    }
 
2619
}
 
2620
 
 
2621
void GL_APIENTRY TextureParameteri(GLuint texture, GLenum pname, GLint param)
 
2622
{
 
2623
    Context *context = GetValidGlobalContext();
 
2624
    EVENT("glTextureParameteri",
 
2625
          "context = %d, GLuint texture = %u, GLenum pname = %s, GLint param = %d", CID(context),
 
2626
          texture, GLenumToString(GLenumGroup::TextureParameterName, pname), param);
 
2627
 
 
2628
    if (context)
 
2629
    {
 
2630
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
2631
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2632
        bool isCallValid                              = (context->skipValidation() ||
 
2633
                            ValidateTextureParameteri(context, texturePacked, pname, param));
 
2634
        if (isCallValid)
 
2635
        {
 
2636
            context->textureParameteri(texturePacked, pname, param);
 
2637
        }
 
2638
        ANGLE_CAPTURE(TextureParameteri, isCallValid, context, texturePacked, pname, param);
 
2639
    }
 
2640
}
 
2641
 
 
2642
void GL_APIENTRY TextureParameteriv(GLuint texture, GLenum pname, const GLint *param)
 
2643
{
 
2644
    Context *context = GetValidGlobalContext();
 
2645
    EVENT(
 
2646
        "glTextureParameteriv",
 
2647
        "context = %d, GLuint texture = %u, GLenum pname = %s, const GLint *param = 0x%016" PRIxPTR
 
2648
        "",
 
2649
        CID(context), texture, GLenumToString(GLenumGroup::TextureParameterName, pname),
 
2650
        (uintptr_t)param);
 
2651
 
 
2652
    if (context)
 
2653
    {
 
2654
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
2655
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2656
        bool isCallValid                              = (context->skipValidation() ||
 
2657
                            ValidateTextureParameteriv(context, texturePacked, pname, param));
 
2658
        if (isCallValid)
 
2659
        {
 
2660
            context->textureParameteriv(texturePacked, pname, param);
 
2661
        }
 
2662
        ANGLE_CAPTURE(TextureParameteriv, isCallValid, context, texturePacked, pname, param);
 
2663
    }
 
2664
}
 
2665
 
 
2666
void GL_APIENTRY TextureStorage1D(GLuint texture,
 
2667
                                  GLsizei levels,
 
2668
                                  GLenum internalformat,
 
2669
                                  GLsizei width)
 
2670
{
 
2671
    Context *context = GetValidGlobalContext();
 
2672
    EVENT("glTextureStorage1D",
 
2673
          "context = %d, GLuint texture = %u, GLsizei levels = %d, GLenum internalformat = %s, "
 
2674
          "GLsizei width = %d",
 
2675
          CID(context), texture, levels,
 
2676
          GLenumToString(GLenumGroup::InternalFormat, internalformat), width);
 
2677
 
 
2678
    if (context)
 
2679
    {
 
2680
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
2681
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2682
        bool isCallValid =
 
2683
            (context->skipValidation() ||
 
2684
             ValidateTextureStorage1D(context, texturePacked, levels, internalformat, width));
 
2685
        if (isCallValid)
 
2686
        {
 
2687
            context->textureStorage1D(texturePacked, levels, internalformat, width);
 
2688
        }
 
2689
        ANGLE_CAPTURE(TextureStorage1D, isCallValid, context, texturePacked, levels, internalformat,
 
2690
                      width);
 
2691
    }
 
2692
}
 
2693
 
 
2694
void GL_APIENTRY TextureStorage2D(GLuint texture,
 
2695
                                  GLsizei levels,
 
2696
                                  GLenum internalformat,
 
2697
                                  GLsizei width,
 
2698
                                  GLsizei height)
 
2699
{
 
2700
    Context *context = GetValidGlobalContext();
 
2701
    EVENT("glTextureStorage2D",
 
2702
          "context = %d, GLuint texture = %u, GLsizei levels = %d, GLenum internalformat = %s, "
 
2703
          "GLsizei width = %d, GLsizei height = %d",
 
2704
          CID(context), texture, levels,
 
2705
          GLenumToString(GLenumGroup::InternalFormat, internalformat), width, height);
 
2706
 
 
2707
    if (context)
 
2708
    {
 
2709
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
2710
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2711
        bool isCallValid =
 
2712
            (context->skipValidation() || ValidateTextureStorage2D(context, texturePacked, levels,
 
2713
                                                                   internalformat, width, height));
 
2714
        if (isCallValid)
 
2715
        {
 
2716
            context->textureStorage2D(texturePacked, levels, internalformat, width, height);
 
2717
        }
 
2718
        ANGLE_CAPTURE(TextureStorage2D, isCallValid, context, texturePacked, levels, internalformat,
 
2719
                      width, height);
 
2720
    }
 
2721
}
 
2722
 
 
2723
void GL_APIENTRY TextureStorage2DMultisample(GLuint texture,
 
2724
                                             GLsizei samples,
 
2725
                                             GLenum internalformat,
 
2726
                                             GLsizei width,
 
2727
                                             GLsizei height,
 
2728
                                             GLboolean fixedsamplelocations)
 
2729
{
 
2730
    Context *context = GetValidGlobalContext();
 
2731
    EVENT("glTextureStorage2DMultisample",
 
2732
          "context = %d, GLuint texture = %u, GLsizei samples = %d, GLenum internalformat = %s, "
 
2733
          "GLsizei width = %d, GLsizei height = %d, GLboolean fixedsamplelocations = %s",
 
2734
          CID(context), texture, samples,
 
2735
          GLenumToString(GLenumGroup::InternalFormat, internalformat), width, height,
 
2736
          GLbooleanToString(fixedsamplelocations));
 
2737
 
 
2738
    if (context)
 
2739
    {
 
2740
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
2741
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2742
        bool isCallValid =
 
2743
            (context->skipValidation() ||
 
2744
             ValidateTextureStorage2DMultisample(context, texturePacked, samples, internalformat,
 
2745
                                                 width, height, fixedsamplelocations));
 
2746
        if (isCallValid)
 
2747
        {
 
2748
            context->textureStorage2DMultisample(texturePacked, samples, internalformat, width,
 
2749
                                                 height, fixedsamplelocations);
 
2750
        }
 
2751
        ANGLE_CAPTURE(TextureStorage2DMultisample, isCallValid, context, texturePacked, samples,
 
2752
                      internalformat, width, height, fixedsamplelocations);
 
2753
    }
 
2754
}
 
2755
 
 
2756
void GL_APIENTRY TextureStorage3D(GLuint texture,
 
2757
                                  GLsizei levels,
 
2758
                                  GLenum internalformat,
 
2759
                                  GLsizei width,
 
2760
                                  GLsizei height,
 
2761
                                  GLsizei depth)
 
2762
{
 
2763
    Context *context = GetValidGlobalContext();
 
2764
    EVENT("glTextureStorage3D",
 
2765
          "context = %d, GLuint texture = %u, GLsizei levels = %d, GLenum internalformat = %s, "
 
2766
          "GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d",
 
2767
          CID(context), texture, levels,
 
2768
          GLenumToString(GLenumGroup::InternalFormat, internalformat), width, height, depth);
 
2769
 
 
2770
    if (context)
 
2771
    {
 
2772
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
2773
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2774
        bool isCallValid                              = (context->skipValidation() ||
 
2775
                            ValidateTextureStorage3D(context, texturePacked, levels, internalformat,
 
2776
                                                     width, height, depth));
 
2777
        if (isCallValid)
 
2778
        {
 
2779
            context->textureStorage3D(texturePacked, levels, internalformat, width, height, depth);
 
2780
        }
 
2781
        ANGLE_CAPTURE(TextureStorage3D, isCallValid, context, texturePacked, levels, internalformat,
 
2782
                      width, height, depth);
 
2783
    }
 
2784
}
 
2785
 
 
2786
void GL_APIENTRY TextureStorage3DMultisample(GLuint texture,
 
2787
                                             GLsizei samples,
 
2788
                                             GLenum internalformat,
 
2789
                                             GLsizei width,
 
2790
                                             GLsizei height,
 
2791
                                             GLsizei depth,
 
2792
                                             GLboolean fixedsamplelocations)
 
2793
{
 
2794
    Context *context = GetValidGlobalContext();
 
2795
    EVENT("glTextureStorage3DMultisample",
 
2796
          "context = %d, GLuint texture = %u, GLsizei samples = %d, GLenum internalformat = %s, "
 
2797
          "GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, GLboolean "
 
2798
          "fixedsamplelocations = %s",
 
2799
          CID(context), texture, samples,
 
2800
          GLenumToString(GLenumGroup::InternalFormat, internalformat), width, height, depth,
 
2801
          GLbooleanToString(fixedsamplelocations));
 
2802
 
 
2803
    if (context)
 
2804
    {
 
2805
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
2806
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2807
        bool isCallValid =
 
2808
            (context->skipValidation() ||
 
2809
             ValidateTextureStorage3DMultisample(context, texturePacked, samples, internalformat,
 
2810
                                                 width, height, depth, fixedsamplelocations));
 
2811
        if (isCallValid)
 
2812
        {
 
2813
            context->textureStorage3DMultisample(texturePacked, samples, internalformat, width,
 
2814
                                                 height, depth, fixedsamplelocations);
 
2815
        }
 
2816
        ANGLE_CAPTURE(TextureStorage3DMultisample, isCallValid, context, texturePacked, samples,
 
2817
                      internalformat, width, height, depth, fixedsamplelocations);
 
2818
    }
 
2819
}
 
2820
 
 
2821
void GL_APIENTRY TextureSubImage1D(GLuint texture,
 
2822
                                   GLint level,
 
2823
                                   GLint xoffset,
 
2824
                                   GLsizei width,
 
2825
                                   GLenum format,
 
2826
                                   GLenum type,
 
2827
                                   const void *pixels)
 
2828
{
 
2829
    Context *context = GetValidGlobalContext();
 
2830
    EVENT("glTextureSubImage1D",
 
2831
          "context = %d, GLuint texture = %u, GLint level = %d, GLint xoffset = %d, GLsizei width "
 
2832
          "= %d, GLenum format = %s, GLenum type = %s, const void *pixels = 0x%016" PRIxPTR "",
 
2833
          CID(context), texture, level, xoffset, width,
 
2834
          GLenumToString(GLenumGroup::PixelFormat, format),
 
2835
          GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)pixels);
 
2836
 
 
2837
    if (context)
 
2838
    {
 
2839
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
2840
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2841
        bool isCallValid                              = (context->skipValidation() ||
 
2842
                            ValidateTextureSubImage1D(context, texturePacked, level, xoffset, width,
 
2843
                                                      format, type, pixels));
 
2844
        if (isCallValid)
 
2845
        {
 
2846
            context->textureSubImage1D(texturePacked, level, xoffset, width, format, type, pixels);
 
2847
        }
 
2848
        ANGLE_CAPTURE(TextureSubImage1D, isCallValid, context, texturePacked, level, xoffset, width,
 
2849
                      format, type, pixels);
 
2850
    }
 
2851
}
 
2852
 
 
2853
void GL_APIENTRY TextureSubImage2D(GLuint texture,
 
2854
                                   GLint level,
 
2855
                                   GLint xoffset,
 
2856
                                   GLint yoffset,
 
2857
                                   GLsizei width,
 
2858
                                   GLsizei height,
 
2859
                                   GLenum format,
 
2860
                                   GLenum type,
 
2861
                                   const void *pixels)
 
2862
{
 
2863
    Context *context = GetValidGlobalContext();
 
2864
    EVENT("glTextureSubImage2D",
 
2865
          "context = %d, GLuint texture = %u, GLint level = %d, GLint xoffset = %d, GLint yoffset "
 
2866
          "= %d, GLsizei width = %d, GLsizei height = %d, GLenum format = %s, GLenum type = %s, "
 
2867
          "const void *pixels = 0x%016" PRIxPTR "",
 
2868
          CID(context), texture, level, xoffset, yoffset, width, height,
 
2869
          GLenumToString(GLenumGroup::PixelFormat, format),
 
2870
          GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)pixels);
 
2871
 
 
2872
    if (context)
 
2873
    {
 
2874
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
2875
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2876
        bool isCallValid =
 
2877
            (context->skipValidation() ||
 
2878
             ValidateTextureSubImage2D(context, texturePacked, level, xoffset, yoffset, width,
 
2879
                                       height, format, type, pixels));
 
2880
        if (isCallValid)
 
2881
        {
 
2882
            context->textureSubImage2D(texturePacked, level, xoffset, yoffset, width, height,
 
2883
                                       format, type, pixels);
 
2884
        }
 
2885
        ANGLE_CAPTURE(TextureSubImage2D, isCallValid, context, texturePacked, level, xoffset,
 
2886
                      yoffset, width, height, format, type, pixels);
 
2887
    }
 
2888
}
 
2889
 
 
2890
void GL_APIENTRY TextureSubImage3D(GLuint texture,
 
2891
                                   GLint level,
 
2892
                                   GLint xoffset,
 
2893
                                   GLint yoffset,
 
2894
                                   GLint zoffset,
 
2895
                                   GLsizei width,
 
2896
                                   GLsizei height,
 
2897
                                   GLsizei depth,
 
2898
                                   GLenum format,
 
2899
                                   GLenum type,
 
2900
                                   const void *pixels)
 
2901
{
 
2902
    Context *context = GetValidGlobalContext();
 
2903
    EVENT("glTextureSubImage3D",
 
2904
          "context = %d, GLuint texture = %u, GLint level = %d, GLint xoffset = %d, GLint yoffset "
 
2905
          "= %d, GLint zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, "
 
2906
          "GLenum format = %s, GLenum type = %s, const void *pixels = 0x%016" PRIxPTR "",
 
2907
          CID(context), texture, level, xoffset, yoffset, zoffset, width, height, depth,
 
2908
          GLenumToString(GLenumGroup::PixelFormat, format),
 
2909
          GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)pixels);
 
2910
 
 
2911
    if (context)
 
2912
    {
 
2913
        TextureID texturePacked                       = FromGL<TextureID>(texture);
 
2914
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2915
        bool isCallValid =
 
2916
            (context->skipValidation() ||
 
2917
             ValidateTextureSubImage3D(context, texturePacked, level, xoffset, yoffset, zoffset,
 
2918
                                       width, height, depth, format, type, pixels));
 
2919
        if (isCallValid)
 
2920
        {
 
2921
            context->textureSubImage3D(texturePacked, level, xoffset, yoffset, zoffset, width,
 
2922
                                       height, depth, format, type, pixels);
 
2923
        }
 
2924
        ANGLE_CAPTURE(TextureSubImage3D, isCallValid, context, texturePacked, level, xoffset,
 
2925
                      yoffset, zoffset, width, height, depth, format, type, pixels);
 
2926
    }
 
2927
}
 
2928
 
 
2929
void GL_APIENTRY TransformFeedbackBufferBase(GLuint xfb, GLuint index, GLuint buffer)
 
2930
{
 
2931
    Context *context = GetValidGlobalContext();
 
2932
    EVENT("glTransformFeedbackBufferBase",
 
2933
          "context = %d, GLuint xfb = %u, GLuint index = %u, GLuint buffer = %u", CID(context), xfb,
 
2934
          index, buffer);
 
2935
 
 
2936
    if (context)
 
2937
    {
 
2938
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
2939
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2940
        bool isCallValid                              = (context->skipValidation() ||
 
2941
                            ValidateTransformFeedbackBufferBase(context, xfb, index, bufferPacked));
 
2942
        if (isCallValid)
 
2943
        {
 
2944
            context->transformFeedbackBufferBase(xfb, index, bufferPacked);
 
2945
        }
 
2946
        ANGLE_CAPTURE(TransformFeedbackBufferBase, isCallValid, context, xfb, index, bufferPacked);
 
2947
    }
 
2948
}
 
2949
 
 
2950
void GL_APIENTRY TransformFeedbackBufferRange(GLuint xfb,
 
2951
                                              GLuint index,
 
2952
                                              GLuint buffer,
 
2953
                                              GLintptr offset,
 
2954
                                              GLsizeiptr size)
 
2955
{
 
2956
    Context *context = GetValidGlobalContext();
 
2957
    EVENT("glTransformFeedbackBufferRange",
 
2958
          "context = %d, GLuint xfb = %u, GLuint index = %u, GLuint buffer = %u, GLintptr offset = "
 
2959
          "%llu, GLsizeiptr size = %llu",
 
2960
          CID(context), xfb, index, buffer, static_cast<unsigned long long>(offset),
 
2961
          static_cast<unsigned long long>(size));
 
2962
 
 
2963
    if (context)
 
2964
    {
 
2965
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
2966
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2967
        bool isCallValid =
 
2968
            (context->skipValidation() ||
 
2969
             ValidateTransformFeedbackBufferRange(context, xfb, index, bufferPacked, offset, size));
 
2970
        if (isCallValid)
 
2971
        {
 
2972
            context->transformFeedbackBufferRange(xfb, index, bufferPacked, offset, size);
 
2973
        }
 
2974
        ANGLE_CAPTURE(TransformFeedbackBufferRange, isCallValid, context, xfb, index, bufferPacked,
 
2975
                      offset, size);
 
2976
    }
 
2977
}
 
2978
 
 
2979
GLboolean GL_APIENTRY UnmapNamedBuffer(GLuint buffer)
 
2980
{
 
2981
    Context *context = GetValidGlobalContext();
 
2982
    EVENT("glUnmapNamedBuffer", "context = %d, GLuint buffer = %u", CID(context), buffer);
 
2983
 
 
2984
    GLboolean returnValue;
 
2985
    if (context)
 
2986
    {
 
2987
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
2988
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
2989
        bool isCallValid =
 
2990
            (context->skipValidation() || ValidateUnmapNamedBuffer(context, bufferPacked));
 
2991
        if (isCallValid)
 
2992
        {
 
2993
            returnValue = context->unmapNamedBuffer(bufferPacked);
 
2994
        }
 
2995
        else
 
2996
        {
 
2997
            returnValue = GetDefaultReturnValue<EntryPoint::UnmapNamedBuffer, GLboolean>();
 
2998
        }
 
2999
        ANGLE_CAPTURE(UnmapNamedBuffer, isCallValid, context, bufferPacked, returnValue);
 
3000
    }
 
3001
    else
 
3002
    {
 
3003
        returnValue = GetDefaultReturnValue<EntryPoint::UnmapNamedBuffer, GLboolean>();
 
3004
    }
 
3005
    return returnValue;
 
3006
}
 
3007
 
 
3008
void GL_APIENTRY VertexArrayAttribBinding(GLuint vaobj, GLuint attribindex, GLuint bindingindex)
 
3009
{
 
3010
    Context *context = GetValidGlobalContext();
 
3011
    EVENT("glVertexArrayAttribBinding",
 
3012
          "context = %d, GLuint vaobj = %u, GLuint attribindex = %u, GLuint bindingindex = %u",
 
3013
          CID(context), vaobj, attribindex, bindingindex);
 
3014
 
 
3015
    if (context)
 
3016
    {
 
3017
        VertexArrayID vaobjPacked                     = FromGL<VertexArrayID>(vaobj);
 
3018
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
3019
        bool isCallValid =
 
3020
            (context->skipValidation() ||
 
3021
             ValidateVertexArrayAttribBinding(context, vaobjPacked, attribindex, bindingindex));
 
3022
        if (isCallValid)
 
3023
        {
 
3024
            context->vertexArrayAttribBinding(vaobjPacked, attribindex, bindingindex);
 
3025
        }
 
3026
        ANGLE_CAPTURE(VertexArrayAttribBinding, isCallValid, context, vaobjPacked, attribindex,
 
3027
                      bindingindex);
 
3028
    }
 
3029
}
 
3030
 
 
3031
void GL_APIENTRY VertexArrayAttribFormat(GLuint vaobj,
 
3032
                                         GLuint attribindex,
 
3033
                                         GLint size,
 
3034
                                         GLenum type,
 
3035
                                         GLboolean normalized,
 
3036
                                         GLuint relativeoffset)
 
3037
{
 
3038
    Context *context = GetValidGlobalContext();
 
3039
    EVENT("glVertexArrayAttribFormat",
 
3040
          "context = %d, GLuint vaobj = %u, GLuint attribindex = %u, GLint size = %d, GLenum type "
 
3041
          "= %s, GLboolean normalized = %s, GLuint relativeoffset = %u",
 
3042
          CID(context), vaobj, attribindex, size,
 
3043
          GLenumToString(GLenumGroup::VertexAttribType, type), GLbooleanToString(normalized),
 
3044
          relativeoffset);
 
3045
 
 
3046
    if (context)
 
3047
    {
 
3048
        VertexArrayID vaobjPacked                     = FromGL<VertexArrayID>(vaobj);
 
3049
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
3050
        bool isCallValid                              = (context->skipValidation() ||
 
3051
                            ValidateVertexArrayAttribFormat(context, vaobjPacked, attribindex, size,
 
3052
                                                            type, normalized, relativeoffset));
 
3053
        if (isCallValid)
 
3054
        {
 
3055
            context->vertexArrayAttribFormat(vaobjPacked, attribindex, size, type, normalized,
 
3056
                                             relativeoffset);
 
3057
        }
 
3058
        ANGLE_CAPTURE(VertexArrayAttribFormat, isCallValid, context, vaobjPacked, attribindex, size,
 
3059
                      type, normalized, relativeoffset);
 
3060
    }
 
3061
}
 
3062
 
 
3063
void GL_APIENTRY VertexArrayAttribIFormat(GLuint vaobj,
 
3064
                                          GLuint attribindex,
 
3065
                                          GLint size,
 
3066
                                          GLenum type,
 
3067
                                          GLuint relativeoffset)
 
3068
{
 
3069
    Context *context = GetValidGlobalContext();
 
3070
    EVENT("glVertexArrayAttribIFormat",
 
3071
          "context = %d, GLuint vaobj = %u, GLuint attribindex = %u, GLint size = %d, GLenum type "
 
3072
          "= %s, GLuint relativeoffset = %u",
 
3073
          CID(context), vaobj, attribindex, size,
 
3074
          GLenumToString(GLenumGroup::VertexAttribType, type), relativeoffset);
 
3075
 
 
3076
    if (context)
 
3077
    {
 
3078
        VertexArrayID vaobjPacked                     = FromGL<VertexArrayID>(vaobj);
 
3079
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
3080
        bool isCallValid                              = (context->skipValidation() ||
 
3081
                            ValidateVertexArrayAttribIFormat(context, vaobjPacked, attribindex,
 
3082
                                                             size, type, relativeoffset));
 
3083
        if (isCallValid)
 
3084
        {
 
3085
            context->vertexArrayAttribIFormat(vaobjPacked, attribindex, size, type, relativeoffset);
 
3086
        }
 
3087
        ANGLE_CAPTURE(VertexArrayAttribIFormat, isCallValid, context, vaobjPacked, attribindex,
 
3088
                      size, type, relativeoffset);
 
3089
    }
 
3090
}
 
3091
 
 
3092
void GL_APIENTRY VertexArrayAttribLFormat(GLuint vaobj,
 
3093
                                          GLuint attribindex,
 
3094
                                          GLint size,
 
3095
                                          GLenum type,
 
3096
                                          GLuint relativeoffset)
 
3097
{
 
3098
    Context *context = GetValidGlobalContext();
 
3099
    EVENT("glVertexArrayAttribLFormat",
 
3100
          "context = %d, GLuint vaobj = %u, GLuint attribindex = %u, GLint size = %d, GLenum type "
 
3101
          "= %s, GLuint relativeoffset = %u",
 
3102
          CID(context), vaobj, attribindex, size,
 
3103
          GLenumToString(GLenumGroup::VertexAttribType, type), relativeoffset);
 
3104
 
 
3105
    if (context)
 
3106
    {
 
3107
        VertexArrayID vaobjPacked                     = FromGL<VertexArrayID>(vaobj);
 
3108
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
3109
        bool isCallValid                              = (context->skipValidation() ||
 
3110
                            ValidateVertexArrayAttribLFormat(context, vaobjPacked, attribindex,
 
3111
                                                             size, type, relativeoffset));
 
3112
        if (isCallValid)
 
3113
        {
 
3114
            context->vertexArrayAttribLFormat(vaobjPacked, attribindex, size, type, relativeoffset);
 
3115
        }
 
3116
        ANGLE_CAPTURE(VertexArrayAttribLFormat, isCallValid, context, vaobjPacked, attribindex,
 
3117
                      size, type, relativeoffset);
 
3118
    }
 
3119
}
 
3120
 
 
3121
void GL_APIENTRY VertexArrayBindingDivisor(GLuint vaobj, GLuint bindingindex, GLuint divisor)
 
3122
{
 
3123
    Context *context = GetValidGlobalContext();
 
3124
    EVENT("glVertexArrayBindingDivisor",
 
3125
          "context = %d, GLuint vaobj = %u, GLuint bindingindex = %u, GLuint divisor = %u",
 
3126
          CID(context), vaobj, bindingindex, divisor);
 
3127
 
 
3128
    if (context)
 
3129
    {
 
3130
        VertexArrayID vaobjPacked                     = FromGL<VertexArrayID>(vaobj);
 
3131
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
3132
        bool isCallValid =
 
3133
            (context->skipValidation() ||
 
3134
             ValidateVertexArrayBindingDivisor(context, vaobjPacked, bindingindex, divisor));
 
3135
        if (isCallValid)
 
3136
        {
 
3137
            context->vertexArrayBindingDivisor(vaobjPacked, bindingindex, divisor);
 
3138
        }
 
3139
        ANGLE_CAPTURE(VertexArrayBindingDivisor, isCallValid, context, vaobjPacked, bindingindex,
 
3140
                      divisor);
 
3141
    }
 
3142
}
 
3143
 
 
3144
void GL_APIENTRY VertexArrayElementBuffer(GLuint vaobj, GLuint buffer)
 
3145
{
 
3146
    Context *context = GetValidGlobalContext();
 
3147
    EVENT("glVertexArrayElementBuffer", "context = %d, GLuint vaobj = %u, GLuint buffer = %u",
 
3148
          CID(context), vaobj, buffer);
 
3149
 
 
3150
    if (context)
 
3151
    {
 
3152
        VertexArrayID vaobjPacked                     = FromGL<VertexArrayID>(vaobj);
 
3153
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
3154
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
3155
        bool isCallValid                              = (context->skipValidation() ||
 
3156
                            ValidateVertexArrayElementBuffer(context, vaobjPacked, bufferPacked));
 
3157
        if (isCallValid)
 
3158
        {
 
3159
            context->vertexArrayElementBuffer(vaobjPacked, bufferPacked);
 
3160
        }
 
3161
        ANGLE_CAPTURE(VertexArrayElementBuffer, isCallValid, context, vaobjPacked, bufferPacked);
 
3162
    }
 
3163
}
 
3164
 
 
3165
void GL_APIENTRY VertexArrayVertexBuffer(GLuint vaobj,
 
3166
                                         GLuint bindingindex,
 
3167
                                         GLuint buffer,
 
3168
                                         GLintptr offset,
 
3169
                                         GLsizei stride)
 
3170
{
 
3171
    Context *context = GetValidGlobalContext();
 
3172
    EVENT("glVertexArrayVertexBuffer",
 
3173
          "context = %d, GLuint vaobj = %u, GLuint bindingindex = %u, GLuint buffer = %u, GLintptr "
 
3174
          "offset = %llu, GLsizei stride = %d",
 
3175
          CID(context), vaobj, bindingindex, buffer, static_cast<unsigned long long>(offset),
 
3176
          stride);
 
3177
 
 
3178
    if (context)
 
3179
    {
 
3180
        VertexArrayID vaobjPacked                     = FromGL<VertexArrayID>(vaobj);
 
3181
        BufferID bufferPacked                         = FromGL<BufferID>(buffer);
 
3182
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
3183
        bool isCallValid                              = (context->skipValidation() ||
 
3184
                            ValidateVertexArrayVertexBuffer(context, vaobjPacked, bindingindex,
 
3185
                                                            bufferPacked, offset, stride));
 
3186
        if (isCallValid)
 
3187
        {
 
3188
            context->vertexArrayVertexBuffer(vaobjPacked, bindingindex, bufferPacked, offset,
 
3189
                                             stride);
 
3190
        }
 
3191
        ANGLE_CAPTURE(VertexArrayVertexBuffer, isCallValid, context, vaobjPacked, bindingindex,
 
3192
                      bufferPacked, offset, stride);
 
3193
    }
 
3194
}
 
3195
 
 
3196
void GL_APIENTRY VertexArrayVertexBuffers(GLuint vaobj,
 
3197
                                          GLuint first,
 
3198
                                          GLsizei count,
 
3199
                                          const GLuint *buffers,
 
3200
                                          const GLintptr *offsets,
 
3201
                                          const GLsizei *strides)
 
3202
{
 
3203
    Context *context = GetValidGlobalContext();
 
3204
    EVENT("glVertexArrayVertexBuffers",
 
3205
          "context = %d, GLuint vaobj = %u, GLuint first = %u, GLsizei count = %d, const GLuint "
 
3206
          "*buffers = 0x%016" PRIxPTR ", const GLintptr *offsets = 0x%016" PRIxPTR
 
3207
          ", const GLsizei *strides = 0x%016" PRIxPTR "",
 
3208
          CID(context), vaobj, first, count, (uintptr_t)buffers, (uintptr_t)offsets,
 
3209
          (uintptr_t)strides);
 
3210
 
 
3211
    if (context)
 
3212
    {
 
3213
        VertexArrayID vaobjPacked                     = FromGL<VertexArrayID>(vaobj);
 
3214
        const BufferID *buffersPacked                 = FromGL<const BufferID *>(buffers);
 
3215
        std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
 
3216
        bool isCallValid                              = (context->skipValidation() ||
 
3217
                            ValidateVertexArrayVertexBuffers(context, vaobjPacked, first, count,
 
3218
                                                             buffersPacked, offsets, strides));
 
3219
        if (isCallValid)
 
3220
        {
 
3221
            context->vertexArrayVertexBuffers(vaobjPacked, first, count, buffersPacked, offsets,
 
3222
                                              strides);
 
3223
        }
 
3224
        ANGLE_CAPTURE(VertexArrayVertexBuffers, isCallValid, context, vaobjPacked, first, count,
 
3225
                      buffersPacked, offsets, strides);
 
3226
    }
 
3227
}
 
3228
}  // namespace gl