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_1_autogen.cpp:
9 // Defines the Desktop GL 1.x entry points.
10
11 #include "libGL/entry_points_gl_1_autogen.h"
12
13 #include "libANGLE/Context.h"
14 #include "libANGLE/Context.inl.h"
15 #include "libANGLE/capture/gl_enum_utils.h"
16 #include "libANGLE/entry_points_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/validationGL1_autogen.h"
26 #include "libGLESv2/global_state.h"
27
28 using namespace gl;
29
30 extern "C" {
31
32 // GL 1.0
GL_Accum(GLenum op,GLfloat value)33 void GL_APIENTRY GL_Accum(GLenum op, GLfloat value)
34 {
35 Context *context = GetValidGlobalContext();
36 EVENT(context, GLAccum, "context = %d, op = %s, value = %f", CID(context),
37 GLenumToString(GLenumGroup::AccumOp, op), value);
38
39 if (context)
40 {
41 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
42 bool isCallValid = (context->skipValidation() || ValidateAccum(context, op, value));
43 if (isCallValid)
44 {
45 context->accum(op, value);
46 }
47 ANGLE_CAPTURE(Accum, isCallValid, context, op, value);
48 }
49 else
50 {
51 GenerateContextLostErrorOnCurrentGlobalContext();
52 }
53 }
54
GL_AlphaFunc(GLenum func,GLfloat ref)55 void GL_APIENTRY GL_AlphaFunc(GLenum func, GLfloat ref)
56 {
57 Context *context = GetValidGlobalContext();
58 EVENT(context, GLAlphaFunc, "context = %d, func = %s, ref = %f", CID(context),
59 GLenumToString(GLenumGroup::AlphaFunction, func), ref);
60
61 if (context)
62 {
63 AlphaTestFunc funcPacked = PackParam<AlphaTestFunc>(func);
64 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
65 bool isCallValid =
66 (context->skipValidation() || ValidateAlphaFunc(context, funcPacked, ref));
67 if (isCallValid)
68 {
69 context->alphaFunc(funcPacked, ref);
70 }
71 ANGLE_CAPTURE(AlphaFunc, isCallValid, context, funcPacked, ref);
72 }
73 else
74 {
75 GenerateContextLostErrorOnCurrentGlobalContext();
76 }
77 }
78
GL_Begin(GLenum mode)79 void GL_APIENTRY GL_Begin(GLenum mode)
80 {
81 Context *context = GetValidGlobalContext();
82 EVENT(context, GLBegin, "context = %d, mode = %s", CID(context),
83 GLenumToString(GLenumGroup::PrimitiveType, mode));
84
85 if (context)
86 {
87 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
88 bool isCallValid = (context->skipValidation() || ValidateBegin(context, mode));
89 if (isCallValid)
90 {
91 context->begin(mode);
92 }
93 ANGLE_CAPTURE(Begin, isCallValid, context, mode);
94 }
95 else
96 {
97 GenerateContextLostErrorOnCurrentGlobalContext();
98 }
99 }
100
GL_Bitmap(GLsizei width,GLsizei height,GLfloat xorig,GLfloat yorig,GLfloat xmove,GLfloat ymove,const GLubyte * bitmap)101 void GL_APIENTRY GL_Bitmap(GLsizei width,
102 GLsizei height,
103 GLfloat xorig,
104 GLfloat yorig,
105 GLfloat xmove,
106 GLfloat ymove,
107 const GLubyte *bitmap)
108 {
109 Context *context = GetValidGlobalContext();
110 EVENT(context, GLBitmap,
111 "context = %d, width = %d, height = %d, xorig = %f, yorig = %f, xmove = %f, ymove = %f, "
112 "bitmap = 0x%016" PRIxPTR "",
113 CID(context), width, height, xorig, yorig, xmove, ymove, (uintptr_t)bitmap);
114
115 if (context)
116 {
117 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
118 bool isCallValid =
119 (context->skipValidation() ||
120 ValidateBitmap(context, width, height, xorig, yorig, xmove, ymove, bitmap));
121 if (isCallValid)
122 {
123 context->bitmap(width, height, xorig, yorig, xmove, ymove, bitmap);
124 }
125 ANGLE_CAPTURE(Bitmap, isCallValid, context, width, height, xorig, yorig, xmove, ymove,
126 bitmap);
127 }
128 else
129 {
130 GenerateContextLostErrorOnCurrentGlobalContext();
131 }
132 }
133
GL_BlendFunc(GLenum sfactor,GLenum dfactor)134 void GL_APIENTRY GL_BlendFunc(GLenum sfactor, GLenum dfactor)
135 {
136 Context *context = GetValidGlobalContext();
137 EVENT(context, GLBlendFunc, "context = %d, sfactor = %s, dfactor = %s", CID(context),
138 GLenumToString(GLenumGroup::BlendingFactor, sfactor),
139 GLenumToString(GLenumGroup::BlendingFactor, dfactor));
140
141 if (context)
142 {
143 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
144 bool isCallValid =
145 (context->skipValidation() || ValidateBlendFunc(context, sfactor, dfactor));
146 if (isCallValid)
147 {
148 context->blendFunc(sfactor, dfactor);
149 }
150 ANGLE_CAPTURE(BlendFunc, isCallValid, context, sfactor, dfactor);
151 }
152 else
153 {
154 GenerateContextLostErrorOnCurrentGlobalContext();
155 }
156 }
157
GL_CallList(GLuint list)158 void GL_APIENTRY GL_CallList(GLuint list)
159 {
160 Context *context = GetValidGlobalContext();
161 EVENT(context, GLCallList, "context = %d, list = %u", CID(context), list);
162
163 if (context)
164 {
165 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
166 bool isCallValid = (context->skipValidation() || ValidateCallList(context, list));
167 if (isCallValid)
168 {
169 context->callList(list);
170 }
171 ANGLE_CAPTURE(CallList, isCallValid, context, list);
172 }
173 else
174 {
175 GenerateContextLostErrorOnCurrentGlobalContext();
176 }
177 }
178
GL_CallLists(GLsizei n,GLenum type,const void * lists)179 void GL_APIENTRY GL_CallLists(GLsizei n, GLenum type, const void *lists)
180 {
181 Context *context = GetValidGlobalContext();
182 EVENT(context, GLCallLists, "context = %d, n = %d, type = %s, lists = 0x%016" PRIxPTR "",
183 CID(context), n, GLenumToString(GLenumGroup::ListNameType, type), (uintptr_t)lists);
184
185 if (context)
186 {
187 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
188 bool isCallValid =
189 (context->skipValidation() || ValidateCallLists(context, n, type, lists));
190 if (isCallValid)
191 {
192 context->callLists(n, type, lists);
193 }
194 ANGLE_CAPTURE(CallLists, isCallValid, context, n, type, lists);
195 }
196 else
197 {
198 GenerateContextLostErrorOnCurrentGlobalContext();
199 }
200 }
201
GL_Clear(GLbitfield mask)202 void GL_APIENTRY GL_Clear(GLbitfield mask)
203 {
204 Context *context = GetValidGlobalContext();
205 EVENT(context, GLClear, "context = %d, mask = %s", CID(context),
206 GLbitfieldToString(GLenumGroup::ClearBufferMask, mask).c_str());
207
208 if (context)
209 {
210 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
211 bool isCallValid = (context->skipValidation() || ValidateClear(context, mask));
212 if (isCallValid)
213 {
214 context->clear(mask);
215 }
216 ANGLE_CAPTURE(Clear, isCallValid, context, mask);
217 }
218 else
219 {
220 GenerateContextLostErrorOnCurrentGlobalContext();
221 }
222 }
223
GL_ClearAccum(GLfloat red,GLfloat green,GLfloat blue,GLfloat alpha)224 void GL_APIENTRY GL_ClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
225 {
226 Context *context = GetValidGlobalContext();
227 EVENT(context, GLClearAccum, "context = %d, red = %f, green = %f, blue = %f, alpha = %f",
228 CID(context), red, green, blue, alpha);
229
230 if (context)
231 {
232 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
233 bool isCallValid =
234 (context->skipValidation() || ValidateClearAccum(context, red, green, blue, alpha));
235 if (isCallValid)
236 {
237 context->clearAccum(red, green, blue, alpha);
238 }
239 ANGLE_CAPTURE(ClearAccum, isCallValid, context, red, green, blue, alpha);
240 }
241 else
242 {
243 GenerateContextLostErrorOnCurrentGlobalContext();
244 }
245 }
246
GL_ClearColor(GLfloat red,GLfloat green,GLfloat blue,GLfloat alpha)247 void GL_APIENTRY GL_ClearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
248 {
249 Context *context = GetValidGlobalContext();
250 EVENT(context, GLClearColor, "context = %d, red = %f, green = %f, blue = %f, alpha = %f",
251 CID(context), red, green, blue, alpha);
252
253 if (context)
254 {
255 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
256 bool isCallValid =
257 (context->skipValidation() || ValidateClearColor(context, red, green, blue, alpha));
258 if (isCallValid)
259 {
260 context->clearColor(red, green, blue, alpha);
261 }
262 ANGLE_CAPTURE(ClearColor, isCallValid, context, red, green, blue, alpha);
263 }
264 else
265 {
266 GenerateContextLostErrorOnCurrentGlobalContext();
267 }
268 }
269
GL_ClearDepth(GLdouble depth)270 void GL_APIENTRY GL_ClearDepth(GLdouble depth)
271 {
272 Context *context = GetValidGlobalContext();
273 EVENT(context, GLClearDepth, "context = %d, depth = %f", CID(context), depth);
274
275 if (context)
276 {
277 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
278 bool isCallValid = (context->skipValidation() || ValidateClearDepth(context, depth));
279 if (isCallValid)
280 {
281 context->clearDepth(depth);
282 }
283 ANGLE_CAPTURE(ClearDepth, isCallValid, context, depth);
284 }
285 else
286 {
287 GenerateContextLostErrorOnCurrentGlobalContext();
288 }
289 }
290
GL_ClearIndex(GLfloat c)291 void GL_APIENTRY GL_ClearIndex(GLfloat c)
292 {
293 Context *context = GetValidGlobalContext();
294 EVENT(context, GLClearIndex, "context = %d, c = %f", CID(context), c);
295
296 if (context)
297 {
298 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
299 bool isCallValid = (context->skipValidation() || ValidateClearIndex(context, c));
300 if (isCallValid)
301 {
302 context->clearIndex(c);
303 }
304 ANGLE_CAPTURE(ClearIndex, isCallValid, context, c);
305 }
306 else
307 {
308 GenerateContextLostErrorOnCurrentGlobalContext();
309 }
310 }
311
GL_ClearStencil(GLint s)312 void GL_APIENTRY GL_ClearStencil(GLint s)
313 {
314 Context *context = GetValidGlobalContext();
315 EVENT(context, GLClearStencil, "context = %d, s = %d", CID(context), s);
316
317 if (context)
318 {
319 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
320 bool isCallValid = (context->skipValidation() || ValidateClearStencil(context, s));
321 if (isCallValid)
322 {
323 context->clearStencil(s);
324 }
325 ANGLE_CAPTURE(ClearStencil, isCallValid, context, s);
326 }
327 else
328 {
329 GenerateContextLostErrorOnCurrentGlobalContext();
330 }
331 }
332
GL_ClipPlane(GLenum plane,const GLdouble * equation)333 void GL_APIENTRY GL_ClipPlane(GLenum plane, const GLdouble *equation)
334 {
335 Context *context = GetValidGlobalContext();
336 EVENT(context, GLClipPlane, "context = %d, plane = %s, equation = 0x%016" PRIxPTR "",
337 CID(context), GLenumToString(GLenumGroup::ClipPlaneName, plane), (uintptr_t)equation);
338
339 if (context)
340 {
341 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
342 bool isCallValid =
343 (context->skipValidation() || ValidateClipPlane(context, plane, equation));
344 if (isCallValid)
345 {
346 context->clipPlane(plane, equation);
347 }
348 ANGLE_CAPTURE(ClipPlane, isCallValid, context, plane, equation);
349 }
350 else
351 {
352 GenerateContextLostErrorOnCurrentGlobalContext();
353 }
354 }
355
GL_Color3b(GLbyte red,GLbyte green,GLbyte blue)356 void GL_APIENTRY GL_Color3b(GLbyte red, GLbyte green, GLbyte blue)
357 {
358 Context *context = GetValidGlobalContext();
359 EVENT(context, GLColor3b, "context = %d, red = %d, green = %d, blue = %d", CID(context), red,
360 green, blue);
361
362 if (context)
363 {
364 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
365 bool isCallValid =
366 (context->skipValidation() || ValidateColor3b(context, red, green, blue));
367 if (isCallValid)
368 {
369 context->color3b(red, green, blue);
370 }
371 ANGLE_CAPTURE(Color3b, isCallValid, context, red, green, blue);
372 }
373 else
374 {
375 GenerateContextLostErrorOnCurrentGlobalContext();
376 }
377 }
378
GL_Color3bv(const GLbyte * v)379 void GL_APIENTRY GL_Color3bv(const GLbyte *v)
380 {
381 Context *context = GetValidGlobalContext();
382 EVENT(context, GLColor3bv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
383
384 if (context)
385 {
386 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
387 bool isCallValid = (context->skipValidation() || ValidateColor3bv(context, v));
388 if (isCallValid)
389 {
390 context->color3bv(v);
391 }
392 ANGLE_CAPTURE(Color3bv, isCallValid, context, v);
393 }
394 else
395 {
396 GenerateContextLostErrorOnCurrentGlobalContext();
397 }
398 }
399
GL_Color3d(GLdouble red,GLdouble green,GLdouble blue)400 void GL_APIENTRY GL_Color3d(GLdouble red, GLdouble green, GLdouble blue)
401 {
402 Context *context = GetValidGlobalContext();
403 EVENT(context, GLColor3d, "context = %d, red = %f, green = %f, blue = %f", CID(context), red,
404 green, blue);
405
406 if (context)
407 {
408 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
409 bool isCallValid =
410 (context->skipValidation() || ValidateColor3d(context, red, green, blue));
411 if (isCallValid)
412 {
413 context->color3d(red, green, blue);
414 }
415 ANGLE_CAPTURE(Color3d, isCallValid, context, red, green, blue);
416 }
417 else
418 {
419 GenerateContextLostErrorOnCurrentGlobalContext();
420 }
421 }
422
GL_Color3dv(const GLdouble * v)423 void GL_APIENTRY GL_Color3dv(const GLdouble *v)
424 {
425 Context *context = GetValidGlobalContext();
426 EVENT(context, GLColor3dv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
427
428 if (context)
429 {
430 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
431 bool isCallValid = (context->skipValidation() || ValidateColor3dv(context, v));
432 if (isCallValid)
433 {
434 context->color3dv(v);
435 }
436 ANGLE_CAPTURE(Color3dv, isCallValid, context, v);
437 }
438 else
439 {
440 GenerateContextLostErrorOnCurrentGlobalContext();
441 }
442 }
443
GL_Color3f(GLfloat red,GLfloat green,GLfloat blue)444 void GL_APIENTRY GL_Color3f(GLfloat red, GLfloat green, GLfloat blue)
445 {
446 Context *context = GetValidGlobalContext();
447 EVENT(context, GLColor3f, "context = %d, red = %f, green = %f, blue = %f", CID(context), red,
448 green, blue);
449
450 if (context)
451 {
452 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
453 bool isCallValid =
454 (context->skipValidation() || ValidateColor3f(context, red, green, blue));
455 if (isCallValid)
456 {
457 context->color3f(red, green, blue);
458 }
459 ANGLE_CAPTURE(Color3f, isCallValid, context, red, green, blue);
460 }
461 else
462 {
463 GenerateContextLostErrorOnCurrentGlobalContext();
464 }
465 }
466
GL_Color3fv(const GLfloat * v)467 void GL_APIENTRY GL_Color3fv(const GLfloat *v)
468 {
469 Context *context = GetValidGlobalContext();
470 EVENT(context, GLColor3fv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
471
472 if (context)
473 {
474 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
475 bool isCallValid = (context->skipValidation() || ValidateColor3fv(context, v));
476 if (isCallValid)
477 {
478 context->color3fv(v);
479 }
480 ANGLE_CAPTURE(Color3fv, isCallValid, context, v);
481 }
482 else
483 {
484 GenerateContextLostErrorOnCurrentGlobalContext();
485 }
486 }
487
GL_Color3i(GLint red,GLint green,GLint blue)488 void GL_APIENTRY GL_Color3i(GLint red, GLint green, GLint blue)
489 {
490 Context *context = GetValidGlobalContext();
491 EVENT(context, GLColor3i, "context = %d, red = %d, green = %d, blue = %d", CID(context), red,
492 green, blue);
493
494 if (context)
495 {
496 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
497 bool isCallValid =
498 (context->skipValidation() || ValidateColor3i(context, red, green, blue));
499 if (isCallValid)
500 {
501 context->color3i(red, green, blue);
502 }
503 ANGLE_CAPTURE(Color3i, isCallValid, context, red, green, blue);
504 }
505 else
506 {
507 GenerateContextLostErrorOnCurrentGlobalContext();
508 }
509 }
510
GL_Color3iv(const GLint * v)511 void GL_APIENTRY GL_Color3iv(const GLint *v)
512 {
513 Context *context = GetValidGlobalContext();
514 EVENT(context, GLColor3iv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
515
516 if (context)
517 {
518 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
519 bool isCallValid = (context->skipValidation() || ValidateColor3iv(context, v));
520 if (isCallValid)
521 {
522 context->color3iv(v);
523 }
524 ANGLE_CAPTURE(Color3iv, isCallValid, context, v);
525 }
526 else
527 {
528 GenerateContextLostErrorOnCurrentGlobalContext();
529 }
530 }
531
GL_Color3s(GLshort red,GLshort green,GLshort blue)532 void GL_APIENTRY GL_Color3s(GLshort red, GLshort green, GLshort blue)
533 {
534 Context *context = GetValidGlobalContext();
535 EVENT(context, GLColor3s, "context = %d, red = %d, green = %d, blue = %d", CID(context), red,
536 green, blue);
537
538 if (context)
539 {
540 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
541 bool isCallValid =
542 (context->skipValidation() || ValidateColor3s(context, red, green, blue));
543 if (isCallValid)
544 {
545 context->color3s(red, green, blue);
546 }
547 ANGLE_CAPTURE(Color3s, isCallValid, context, red, green, blue);
548 }
549 else
550 {
551 GenerateContextLostErrorOnCurrentGlobalContext();
552 }
553 }
554
GL_Color3sv(const GLshort * v)555 void GL_APIENTRY GL_Color3sv(const GLshort *v)
556 {
557 Context *context = GetValidGlobalContext();
558 EVENT(context, GLColor3sv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
559
560 if (context)
561 {
562 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
563 bool isCallValid = (context->skipValidation() || ValidateColor3sv(context, v));
564 if (isCallValid)
565 {
566 context->color3sv(v);
567 }
568 ANGLE_CAPTURE(Color3sv, isCallValid, context, v);
569 }
570 else
571 {
572 GenerateContextLostErrorOnCurrentGlobalContext();
573 }
574 }
575
GL_Color3ub(GLubyte red,GLubyte green,GLubyte blue)576 void GL_APIENTRY GL_Color3ub(GLubyte red, GLubyte green, GLubyte blue)
577 {
578 Context *context = GetValidGlobalContext();
579 EVENT(context, GLColor3ub, "context = %d, red = %d, green = %d, blue = %d", CID(context), red,
580 green, blue);
581
582 if (context)
583 {
584 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
585 bool isCallValid =
586 (context->skipValidation() || ValidateColor3ub(context, red, green, blue));
587 if (isCallValid)
588 {
589 context->color3ub(red, green, blue);
590 }
591 ANGLE_CAPTURE(Color3ub, isCallValid, context, red, green, blue);
592 }
593 else
594 {
595 GenerateContextLostErrorOnCurrentGlobalContext();
596 }
597 }
598
GL_Color3ubv(const GLubyte * v)599 void GL_APIENTRY GL_Color3ubv(const GLubyte *v)
600 {
601 Context *context = GetValidGlobalContext();
602 EVENT(context, GLColor3ubv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
603
604 if (context)
605 {
606 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
607 bool isCallValid = (context->skipValidation() || ValidateColor3ubv(context, v));
608 if (isCallValid)
609 {
610 context->color3ubv(v);
611 }
612 ANGLE_CAPTURE(Color3ubv, isCallValid, context, v);
613 }
614 else
615 {
616 GenerateContextLostErrorOnCurrentGlobalContext();
617 }
618 }
619
GL_Color3ui(GLuint red,GLuint green,GLuint blue)620 void GL_APIENTRY GL_Color3ui(GLuint red, GLuint green, GLuint blue)
621 {
622 Context *context = GetValidGlobalContext();
623 EVENT(context, GLColor3ui, "context = %d, red = %u, green = %u, blue = %u", CID(context), red,
624 green, blue);
625
626 if (context)
627 {
628 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
629 bool isCallValid =
630 (context->skipValidation() || ValidateColor3ui(context, red, green, blue));
631 if (isCallValid)
632 {
633 context->color3ui(red, green, blue);
634 }
635 ANGLE_CAPTURE(Color3ui, isCallValid, context, red, green, blue);
636 }
637 else
638 {
639 GenerateContextLostErrorOnCurrentGlobalContext();
640 }
641 }
642
GL_Color3uiv(const GLuint * v)643 void GL_APIENTRY GL_Color3uiv(const GLuint *v)
644 {
645 Context *context = GetValidGlobalContext();
646 EVENT(context, GLColor3uiv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
647
648 if (context)
649 {
650 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
651 bool isCallValid = (context->skipValidation() || ValidateColor3uiv(context, v));
652 if (isCallValid)
653 {
654 context->color3uiv(v);
655 }
656 ANGLE_CAPTURE(Color3uiv, isCallValid, context, v);
657 }
658 else
659 {
660 GenerateContextLostErrorOnCurrentGlobalContext();
661 }
662 }
663
GL_Color3us(GLushort red,GLushort green,GLushort blue)664 void GL_APIENTRY GL_Color3us(GLushort red, GLushort green, GLushort blue)
665 {
666 Context *context = GetValidGlobalContext();
667 EVENT(context, GLColor3us, "context = %d, red = %u, green = %u, blue = %u", CID(context), red,
668 green, blue);
669
670 if (context)
671 {
672 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
673 bool isCallValid =
674 (context->skipValidation() || ValidateColor3us(context, red, green, blue));
675 if (isCallValid)
676 {
677 context->color3us(red, green, blue);
678 }
679 ANGLE_CAPTURE(Color3us, isCallValid, context, red, green, blue);
680 }
681 else
682 {
683 GenerateContextLostErrorOnCurrentGlobalContext();
684 }
685 }
686
GL_Color3usv(const GLushort * v)687 void GL_APIENTRY GL_Color3usv(const GLushort *v)
688 {
689 Context *context = GetValidGlobalContext();
690 EVENT(context, GLColor3usv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
691
692 if (context)
693 {
694 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
695 bool isCallValid = (context->skipValidation() || ValidateColor3usv(context, v));
696 if (isCallValid)
697 {
698 context->color3usv(v);
699 }
700 ANGLE_CAPTURE(Color3usv, isCallValid, context, v);
701 }
702 else
703 {
704 GenerateContextLostErrorOnCurrentGlobalContext();
705 }
706 }
707
GL_Color4b(GLbyte red,GLbyte green,GLbyte blue,GLbyte alpha)708 void GL_APIENTRY GL_Color4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)
709 {
710 Context *context = GetValidGlobalContext();
711 EVENT(context, GLColor4b, "context = %d, red = %d, green = %d, blue = %d, alpha = %d",
712 CID(context), red, green, blue, alpha);
713
714 if (context)
715 {
716 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
717 bool isCallValid =
718 (context->skipValidation() || ValidateColor4b(context, red, green, blue, alpha));
719 if (isCallValid)
720 {
721 context->color4b(red, green, blue, alpha);
722 }
723 ANGLE_CAPTURE(Color4b, isCallValid, context, red, green, blue, alpha);
724 }
725 else
726 {
727 GenerateContextLostErrorOnCurrentGlobalContext();
728 }
729 }
730
GL_Color4bv(const GLbyte * v)731 void GL_APIENTRY GL_Color4bv(const GLbyte *v)
732 {
733 Context *context = GetValidGlobalContext();
734 EVENT(context, GLColor4bv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
735
736 if (context)
737 {
738 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
739 bool isCallValid = (context->skipValidation() || ValidateColor4bv(context, v));
740 if (isCallValid)
741 {
742 context->color4bv(v);
743 }
744 ANGLE_CAPTURE(Color4bv, isCallValid, context, v);
745 }
746 else
747 {
748 GenerateContextLostErrorOnCurrentGlobalContext();
749 }
750 }
751
GL_Color4d(GLdouble red,GLdouble green,GLdouble blue,GLdouble alpha)752 void GL_APIENTRY GL_Color4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
753 {
754 Context *context = GetValidGlobalContext();
755 EVENT(context, GLColor4d, "context = %d, red = %f, green = %f, blue = %f, alpha = %f",
756 CID(context), red, green, blue, alpha);
757
758 if (context)
759 {
760 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
761 bool isCallValid =
762 (context->skipValidation() || ValidateColor4d(context, red, green, blue, alpha));
763 if (isCallValid)
764 {
765 context->color4d(red, green, blue, alpha);
766 }
767 ANGLE_CAPTURE(Color4d, isCallValid, context, red, green, blue, alpha);
768 }
769 else
770 {
771 GenerateContextLostErrorOnCurrentGlobalContext();
772 }
773 }
774
GL_Color4dv(const GLdouble * v)775 void GL_APIENTRY GL_Color4dv(const GLdouble *v)
776 {
777 Context *context = GetValidGlobalContext();
778 EVENT(context, GLColor4dv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
779
780 if (context)
781 {
782 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
783 bool isCallValid = (context->skipValidation() || ValidateColor4dv(context, v));
784 if (isCallValid)
785 {
786 context->color4dv(v);
787 }
788 ANGLE_CAPTURE(Color4dv, isCallValid, context, v);
789 }
790 else
791 {
792 GenerateContextLostErrorOnCurrentGlobalContext();
793 }
794 }
795
GL_Color4f(GLfloat red,GLfloat green,GLfloat blue,GLfloat alpha)796 void GL_APIENTRY GL_Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
797 {
798 Context *context = GetValidGlobalContext();
799 EVENT(context, GLColor4f, "context = %d, red = %f, green = %f, blue = %f, alpha = %f",
800 CID(context), red, green, blue, alpha);
801
802 if (context)
803 {
804 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
805 bool isCallValid =
806 (context->skipValidation() || ValidateColor4f(context, red, green, blue, alpha));
807 if (isCallValid)
808 {
809 context->color4f(red, green, blue, alpha);
810 }
811 ANGLE_CAPTURE(Color4f, isCallValid, context, red, green, blue, alpha);
812 }
813 else
814 {
815 GenerateContextLostErrorOnCurrentGlobalContext();
816 }
817 }
818
GL_Color4fv(const GLfloat * v)819 void GL_APIENTRY GL_Color4fv(const GLfloat *v)
820 {
821 Context *context = GetValidGlobalContext();
822 EVENT(context, GLColor4fv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
823
824 if (context)
825 {
826 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
827 bool isCallValid = (context->skipValidation() || ValidateColor4fv(context, v));
828 if (isCallValid)
829 {
830 context->color4fv(v);
831 }
832 ANGLE_CAPTURE(Color4fv, isCallValid, context, v);
833 }
834 else
835 {
836 GenerateContextLostErrorOnCurrentGlobalContext();
837 }
838 }
839
GL_Color4i(GLint red,GLint green,GLint blue,GLint alpha)840 void GL_APIENTRY GL_Color4i(GLint red, GLint green, GLint blue, GLint alpha)
841 {
842 Context *context = GetValidGlobalContext();
843 EVENT(context, GLColor4i, "context = %d, red = %d, green = %d, blue = %d, alpha = %d",
844 CID(context), red, green, blue, alpha);
845
846 if (context)
847 {
848 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
849 bool isCallValid =
850 (context->skipValidation() || ValidateColor4i(context, red, green, blue, alpha));
851 if (isCallValid)
852 {
853 context->color4i(red, green, blue, alpha);
854 }
855 ANGLE_CAPTURE(Color4i, isCallValid, context, red, green, blue, alpha);
856 }
857 else
858 {
859 GenerateContextLostErrorOnCurrentGlobalContext();
860 }
861 }
862
GL_Color4iv(const GLint * v)863 void GL_APIENTRY GL_Color4iv(const GLint *v)
864 {
865 Context *context = GetValidGlobalContext();
866 EVENT(context, GLColor4iv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
867
868 if (context)
869 {
870 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
871 bool isCallValid = (context->skipValidation() || ValidateColor4iv(context, v));
872 if (isCallValid)
873 {
874 context->color4iv(v);
875 }
876 ANGLE_CAPTURE(Color4iv, isCallValid, context, v);
877 }
878 else
879 {
880 GenerateContextLostErrorOnCurrentGlobalContext();
881 }
882 }
883
GL_Color4s(GLshort red,GLshort green,GLshort blue,GLshort alpha)884 void GL_APIENTRY GL_Color4s(GLshort red, GLshort green, GLshort blue, GLshort alpha)
885 {
886 Context *context = GetValidGlobalContext();
887 EVENT(context, GLColor4s, "context = %d, red = %d, green = %d, blue = %d, alpha = %d",
888 CID(context), red, green, blue, alpha);
889
890 if (context)
891 {
892 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
893 bool isCallValid =
894 (context->skipValidation() || ValidateColor4s(context, red, green, blue, alpha));
895 if (isCallValid)
896 {
897 context->color4s(red, green, blue, alpha);
898 }
899 ANGLE_CAPTURE(Color4s, isCallValid, context, red, green, blue, alpha);
900 }
901 else
902 {
903 GenerateContextLostErrorOnCurrentGlobalContext();
904 }
905 }
906
GL_Color4sv(const GLshort * v)907 void GL_APIENTRY GL_Color4sv(const GLshort *v)
908 {
909 Context *context = GetValidGlobalContext();
910 EVENT(context, GLColor4sv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
911
912 if (context)
913 {
914 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
915 bool isCallValid = (context->skipValidation() || ValidateColor4sv(context, v));
916 if (isCallValid)
917 {
918 context->color4sv(v);
919 }
920 ANGLE_CAPTURE(Color4sv, isCallValid, context, v);
921 }
922 else
923 {
924 GenerateContextLostErrorOnCurrentGlobalContext();
925 }
926 }
927
GL_Color4ub(GLubyte red,GLubyte green,GLubyte blue,GLubyte alpha)928 void GL_APIENTRY GL_Color4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
929 {
930 Context *context = GetValidGlobalContext();
931 EVENT(context, GLColor4ub, "context = %d, red = %d, green = %d, blue = %d, alpha = %d",
932 CID(context), red, green, blue, alpha);
933
934 if (context)
935 {
936 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
937 bool isCallValid =
938 (context->skipValidation() || ValidateColor4ub(context, red, green, blue, alpha));
939 if (isCallValid)
940 {
941 context->color4ub(red, green, blue, alpha);
942 }
943 ANGLE_CAPTURE(Color4ub, isCallValid, context, red, green, blue, alpha);
944 }
945 else
946 {
947 GenerateContextLostErrorOnCurrentGlobalContext();
948 }
949 }
950
GL_Color4ubv(const GLubyte * v)951 void GL_APIENTRY GL_Color4ubv(const GLubyte *v)
952 {
953 Context *context = GetValidGlobalContext();
954 EVENT(context, GLColor4ubv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
955
956 if (context)
957 {
958 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
959 bool isCallValid = (context->skipValidation() || ValidateColor4ubv(context, v));
960 if (isCallValid)
961 {
962 context->color4ubv(v);
963 }
964 ANGLE_CAPTURE(Color4ubv, isCallValid, context, v);
965 }
966 else
967 {
968 GenerateContextLostErrorOnCurrentGlobalContext();
969 }
970 }
971
GL_Color4ui(GLuint red,GLuint green,GLuint blue,GLuint alpha)972 void GL_APIENTRY GL_Color4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha)
973 {
974 Context *context = GetValidGlobalContext();
975 EVENT(context, GLColor4ui, "context = %d, red = %u, green = %u, blue = %u, alpha = %u",
976 CID(context), red, green, blue, alpha);
977
978 if (context)
979 {
980 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
981 bool isCallValid =
982 (context->skipValidation() || ValidateColor4ui(context, red, green, blue, alpha));
983 if (isCallValid)
984 {
985 context->color4ui(red, green, blue, alpha);
986 }
987 ANGLE_CAPTURE(Color4ui, isCallValid, context, red, green, blue, alpha);
988 }
989 else
990 {
991 GenerateContextLostErrorOnCurrentGlobalContext();
992 }
993 }
994
GL_Color4uiv(const GLuint * v)995 void GL_APIENTRY GL_Color4uiv(const GLuint *v)
996 {
997 Context *context = GetValidGlobalContext();
998 EVENT(context, GLColor4uiv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
999
1000 if (context)
1001 {
1002 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1003 bool isCallValid = (context->skipValidation() || ValidateColor4uiv(context, v));
1004 if (isCallValid)
1005 {
1006 context->color4uiv(v);
1007 }
1008 ANGLE_CAPTURE(Color4uiv, isCallValid, context, v);
1009 }
1010 else
1011 {
1012 GenerateContextLostErrorOnCurrentGlobalContext();
1013 }
1014 }
1015
GL_Color4us(GLushort red,GLushort green,GLushort blue,GLushort alpha)1016 void GL_APIENTRY GL_Color4us(GLushort red, GLushort green, GLushort blue, GLushort alpha)
1017 {
1018 Context *context = GetValidGlobalContext();
1019 EVENT(context, GLColor4us, "context = %d, red = %u, green = %u, blue = %u, alpha = %u",
1020 CID(context), red, green, blue, alpha);
1021
1022 if (context)
1023 {
1024 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1025 bool isCallValid =
1026 (context->skipValidation() || ValidateColor4us(context, red, green, blue, alpha));
1027 if (isCallValid)
1028 {
1029 context->color4us(red, green, blue, alpha);
1030 }
1031 ANGLE_CAPTURE(Color4us, isCallValid, context, red, green, blue, alpha);
1032 }
1033 else
1034 {
1035 GenerateContextLostErrorOnCurrentGlobalContext();
1036 }
1037 }
1038
GL_Color4usv(const GLushort * v)1039 void GL_APIENTRY GL_Color4usv(const GLushort *v)
1040 {
1041 Context *context = GetValidGlobalContext();
1042 EVENT(context, GLColor4usv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
1043
1044 if (context)
1045 {
1046 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1047 bool isCallValid = (context->skipValidation() || ValidateColor4usv(context, v));
1048 if (isCallValid)
1049 {
1050 context->color4usv(v);
1051 }
1052 ANGLE_CAPTURE(Color4usv, isCallValid, context, v);
1053 }
1054 else
1055 {
1056 GenerateContextLostErrorOnCurrentGlobalContext();
1057 }
1058 }
1059
GL_ColorMask(GLboolean red,GLboolean green,GLboolean blue,GLboolean alpha)1060 void GL_APIENTRY GL_ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
1061 {
1062 Context *context = GetValidGlobalContext();
1063 EVENT(context, GLColorMask, "context = %d, red = %s, green = %s, blue = %s, alpha = %s",
1064 CID(context), GLbooleanToString(red), GLbooleanToString(green), GLbooleanToString(blue),
1065 GLbooleanToString(alpha));
1066
1067 if (context)
1068 {
1069 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1070 bool isCallValid =
1071 (context->skipValidation() || ValidateColorMask(context, red, green, blue, alpha));
1072 if (isCallValid)
1073 {
1074 context->colorMask(red, green, blue, alpha);
1075 }
1076 ANGLE_CAPTURE(ColorMask, isCallValid, context, red, green, blue, alpha);
1077 }
1078 else
1079 {
1080 GenerateContextLostErrorOnCurrentGlobalContext();
1081 }
1082 }
1083
GL_ColorMaterial(GLenum face,GLenum mode)1084 void GL_APIENTRY GL_ColorMaterial(GLenum face, GLenum mode)
1085 {
1086 Context *context = GetValidGlobalContext();
1087 EVENT(context, GLColorMaterial, "context = %d, face = %s, mode = %s", CID(context),
1088 GLenumToString(GLenumGroup::MaterialFace, face),
1089 GLenumToString(GLenumGroup::ColorMaterialParameter, mode));
1090
1091 if (context)
1092 {
1093 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1094 bool isCallValid =
1095 (context->skipValidation() || ValidateColorMaterial(context, face, mode));
1096 if (isCallValid)
1097 {
1098 context->colorMaterial(face, mode);
1099 }
1100 ANGLE_CAPTURE(ColorMaterial, isCallValid, context, face, mode);
1101 }
1102 else
1103 {
1104 GenerateContextLostErrorOnCurrentGlobalContext();
1105 }
1106 }
1107
GL_CopyPixels(GLint x,GLint y,GLsizei width,GLsizei height,GLenum type)1108 void GL_APIENTRY GL_CopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
1109 {
1110 Context *context = GetValidGlobalContext();
1111 EVENT(context, GLCopyPixels, "context = %d, x = %d, y = %d, width = %d, height = %d, type = %s",
1112 CID(context), x, y, width, height, GLenumToString(GLenumGroup::PixelCopyType, type));
1113
1114 if (context)
1115 {
1116 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1117 bool isCallValid =
1118 (context->skipValidation() || ValidateCopyPixels(context, x, y, width, height, type));
1119 if (isCallValid)
1120 {
1121 context->copyPixels(x, y, width, height, type);
1122 }
1123 ANGLE_CAPTURE(CopyPixels, isCallValid, context, x, y, width, height, type);
1124 }
1125 else
1126 {
1127 GenerateContextLostErrorOnCurrentGlobalContext();
1128 }
1129 }
1130
GL_CullFace(GLenum mode)1131 void GL_APIENTRY GL_CullFace(GLenum mode)
1132 {
1133 Context *context = GetValidGlobalContext();
1134 EVENT(context, GLCullFace, "context = %d, mode = %s", CID(context),
1135 GLenumToString(GLenumGroup::CullFaceMode, mode));
1136
1137 if (context)
1138 {
1139 CullFaceMode modePacked = PackParam<CullFaceMode>(mode);
1140 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1141 bool isCallValid = (context->skipValidation() || ValidateCullFace(context, modePacked));
1142 if (isCallValid)
1143 {
1144 context->cullFace(modePacked);
1145 }
1146 ANGLE_CAPTURE(CullFace, isCallValid, context, modePacked);
1147 }
1148 else
1149 {
1150 GenerateContextLostErrorOnCurrentGlobalContext();
1151 }
1152 }
1153
GL_DeleteLists(GLuint list,GLsizei range)1154 void GL_APIENTRY GL_DeleteLists(GLuint list, GLsizei range)
1155 {
1156 Context *context = GetValidGlobalContext();
1157 EVENT(context, GLDeleteLists, "context = %d, list = %u, range = %d", CID(context), list, range);
1158
1159 if (context)
1160 {
1161 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1162 bool isCallValid = (context->skipValidation() || ValidateDeleteLists(context, list, range));
1163 if (isCallValid)
1164 {
1165 context->deleteLists(list, range);
1166 }
1167 ANGLE_CAPTURE(DeleteLists, isCallValid, context, list, range);
1168 }
1169 else
1170 {
1171 GenerateContextLostErrorOnCurrentGlobalContext();
1172 }
1173 }
1174
GL_DepthFunc(GLenum func)1175 void GL_APIENTRY GL_DepthFunc(GLenum func)
1176 {
1177 Context *context = GetValidGlobalContext();
1178 EVENT(context, GLDepthFunc, "context = %d, func = %s", CID(context),
1179 GLenumToString(GLenumGroup::DepthFunction, func));
1180
1181 if (context)
1182 {
1183 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1184 bool isCallValid = (context->skipValidation() || ValidateDepthFunc(context, func));
1185 if (isCallValid)
1186 {
1187 context->depthFunc(func);
1188 }
1189 ANGLE_CAPTURE(DepthFunc, isCallValid, context, func);
1190 }
1191 else
1192 {
1193 GenerateContextLostErrorOnCurrentGlobalContext();
1194 }
1195 }
1196
GL_DepthMask(GLboolean flag)1197 void GL_APIENTRY GL_DepthMask(GLboolean flag)
1198 {
1199 Context *context = GetValidGlobalContext();
1200 EVENT(context, GLDepthMask, "context = %d, flag = %s", CID(context), GLbooleanToString(flag));
1201
1202 if (context)
1203 {
1204 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1205 bool isCallValid = (context->skipValidation() || ValidateDepthMask(context, flag));
1206 if (isCallValid)
1207 {
1208 context->depthMask(flag);
1209 }
1210 ANGLE_CAPTURE(DepthMask, isCallValid, context, flag);
1211 }
1212 else
1213 {
1214 GenerateContextLostErrorOnCurrentGlobalContext();
1215 }
1216 }
1217
GL_DepthRange(GLdouble n,GLdouble f)1218 void GL_APIENTRY GL_DepthRange(GLdouble n, GLdouble f)
1219 {
1220 Context *context = GetValidGlobalContext();
1221 EVENT(context, GLDepthRange, "context = %d, n = %f, f = %f", CID(context), n, f);
1222
1223 if (context)
1224 {
1225 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1226 bool isCallValid = (context->skipValidation() || ValidateDepthRange(context, n, f));
1227 if (isCallValid)
1228 {
1229 context->depthRange(n, f);
1230 }
1231 ANGLE_CAPTURE(DepthRange, isCallValid, context, n, f);
1232 }
1233 else
1234 {
1235 GenerateContextLostErrorOnCurrentGlobalContext();
1236 }
1237 }
1238
GL_Disable(GLenum cap)1239 void GL_APIENTRY GL_Disable(GLenum cap)
1240 {
1241 Context *context = GetValidGlobalContext();
1242 EVENT(context, GLDisable, "context = %d, cap = %s", CID(context),
1243 GLenumToString(GLenumGroup::EnableCap, cap));
1244
1245 if (context)
1246 {
1247 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1248 bool isCallValid = (context->skipValidation() || ValidateDisable(context, cap));
1249 if (isCallValid)
1250 {
1251 context->disable(cap);
1252 }
1253 ANGLE_CAPTURE(Disable, isCallValid, context, cap);
1254 }
1255 else
1256 {
1257 GenerateContextLostErrorOnCurrentGlobalContext();
1258 }
1259 }
1260
GL_DrawBuffer(GLenum buf)1261 void GL_APIENTRY GL_DrawBuffer(GLenum buf)
1262 {
1263 Context *context = GetValidGlobalContext();
1264 EVENT(context, GLDrawBuffer, "context = %d, buf = %s", CID(context),
1265 GLenumToString(GLenumGroup::DrawBufferMode, buf));
1266
1267 if (context)
1268 {
1269 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1270 bool isCallValid = (context->skipValidation() || ValidateDrawBuffer(context, buf));
1271 if (isCallValid)
1272 {
1273 context->drawBuffer(buf);
1274 }
1275 ANGLE_CAPTURE(DrawBuffer, isCallValid, context, buf);
1276 }
1277 else
1278 {
1279 GenerateContextLostErrorOnCurrentGlobalContext();
1280 }
1281 }
1282
1283 void GL_APIENTRY
GL_DrawPixels(GLsizei width,GLsizei height,GLenum format,GLenum type,const void * pixels)1284 GL_DrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels)
1285 {
1286 Context *context = GetValidGlobalContext();
1287 EVENT(context, GLDrawPixels,
1288 "context = %d, width = %d, height = %d, format = %s, type = %s, pixels = 0x%016" PRIxPTR
1289 "",
1290 CID(context), width, height, GLenumToString(GLenumGroup::PixelFormat, format),
1291 GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)pixels);
1292
1293 if (context)
1294 {
1295 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1296 bool isCallValid = (context->skipValidation() ||
1297 ValidateDrawPixels(context, width, height, format, type, pixels));
1298 if (isCallValid)
1299 {
1300 context->drawPixels(width, height, format, type, pixels);
1301 }
1302 ANGLE_CAPTURE(DrawPixels, isCallValid, context, width, height, format, type, pixels);
1303 }
1304 else
1305 {
1306 GenerateContextLostErrorOnCurrentGlobalContext();
1307 }
1308 }
1309
GL_EdgeFlag(GLboolean flag)1310 void GL_APIENTRY GL_EdgeFlag(GLboolean flag)
1311 {
1312 Context *context = GetValidGlobalContext();
1313 EVENT(context, GLEdgeFlag, "context = %d, flag = %s", CID(context), GLbooleanToString(flag));
1314
1315 if (context)
1316 {
1317 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1318 bool isCallValid = (context->skipValidation() || ValidateEdgeFlag(context, flag));
1319 if (isCallValid)
1320 {
1321 context->edgeFlag(flag);
1322 }
1323 ANGLE_CAPTURE(EdgeFlag, isCallValid, context, flag);
1324 }
1325 else
1326 {
1327 GenerateContextLostErrorOnCurrentGlobalContext();
1328 }
1329 }
1330
GL_EdgeFlagv(const GLboolean * flag)1331 void GL_APIENTRY GL_EdgeFlagv(const GLboolean *flag)
1332 {
1333 Context *context = GetValidGlobalContext();
1334 EVENT(context, GLEdgeFlagv, "context = %d, flag = 0x%016" PRIxPTR "", CID(context),
1335 (uintptr_t)flag);
1336
1337 if (context)
1338 {
1339 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1340 bool isCallValid = (context->skipValidation() || ValidateEdgeFlagv(context, flag));
1341 if (isCallValid)
1342 {
1343 context->edgeFlagv(flag);
1344 }
1345 ANGLE_CAPTURE(EdgeFlagv, isCallValid, context, flag);
1346 }
1347 else
1348 {
1349 GenerateContextLostErrorOnCurrentGlobalContext();
1350 }
1351 }
1352
GL_Enable(GLenum cap)1353 void GL_APIENTRY GL_Enable(GLenum cap)
1354 {
1355 Context *context = GetValidGlobalContext();
1356 EVENT(context, GLEnable, "context = %d, cap = %s", CID(context),
1357 GLenumToString(GLenumGroup::EnableCap, cap));
1358
1359 if (context)
1360 {
1361 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1362 bool isCallValid = (context->skipValidation() || ValidateEnable(context, cap));
1363 if (isCallValid)
1364 {
1365 context->enable(cap);
1366 }
1367 ANGLE_CAPTURE(Enable, isCallValid, context, cap);
1368 }
1369 else
1370 {
1371 GenerateContextLostErrorOnCurrentGlobalContext();
1372 }
1373 }
1374
GL_End()1375 void GL_APIENTRY GL_End()
1376 {
1377 Context *context = GetValidGlobalContext();
1378 EVENT(context, GLEnd, "context = %d", CID(context));
1379
1380 if (context)
1381 {
1382 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1383 bool isCallValid = (context->skipValidation() || ValidateEnd(context));
1384 if (isCallValid)
1385 {
1386 context->end();
1387 }
1388 ANGLE_CAPTURE(End, isCallValid, context);
1389 }
1390 else
1391 {
1392 GenerateContextLostErrorOnCurrentGlobalContext();
1393 }
1394 }
1395
GL_EndList()1396 void GL_APIENTRY GL_EndList()
1397 {
1398 Context *context = GetValidGlobalContext();
1399 EVENT(context, GLEndList, "context = %d", CID(context));
1400
1401 if (context)
1402 {
1403 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1404 bool isCallValid = (context->skipValidation() || ValidateEndList(context));
1405 if (isCallValid)
1406 {
1407 context->endList();
1408 }
1409 ANGLE_CAPTURE(EndList, isCallValid, context);
1410 }
1411 else
1412 {
1413 GenerateContextLostErrorOnCurrentGlobalContext();
1414 }
1415 }
1416
GL_EvalCoord1d(GLdouble u)1417 void GL_APIENTRY GL_EvalCoord1d(GLdouble u)
1418 {
1419 Context *context = GetValidGlobalContext();
1420 EVENT(context, GLEvalCoord1d, "context = %d, u = %f", CID(context), u);
1421
1422 if (context)
1423 {
1424 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1425 bool isCallValid = (context->skipValidation() || ValidateEvalCoord1d(context, u));
1426 if (isCallValid)
1427 {
1428 context->evalCoord1d(u);
1429 }
1430 ANGLE_CAPTURE(EvalCoord1d, isCallValid, context, u);
1431 }
1432 else
1433 {
1434 GenerateContextLostErrorOnCurrentGlobalContext();
1435 }
1436 }
1437
GL_EvalCoord1dv(const GLdouble * u)1438 void GL_APIENTRY GL_EvalCoord1dv(const GLdouble *u)
1439 {
1440 Context *context = GetValidGlobalContext();
1441 EVENT(context, GLEvalCoord1dv, "context = %d, u = 0x%016" PRIxPTR "", CID(context),
1442 (uintptr_t)u);
1443
1444 if (context)
1445 {
1446 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1447 bool isCallValid = (context->skipValidation() || ValidateEvalCoord1dv(context, u));
1448 if (isCallValid)
1449 {
1450 context->evalCoord1dv(u);
1451 }
1452 ANGLE_CAPTURE(EvalCoord1dv, isCallValid, context, u);
1453 }
1454 else
1455 {
1456 GenerateContextLostErrorOnCurrentGlobalContext();
1457 }
1458 }
1459
GL_EvalCoord1f(GLfloat u)1460 void GL_APIENTRY GL_EvalCoord1f(GLfloat u)
1461 {
1462 Context *context = GetValidGlobalContext();
1463 EVENT(context, GLEvalCoord1f, "context = %d, u = %f", CID(context), u);
1464
1465 if (context)
1466 {
1467 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1468 bool isCallValid = (context->skipValidation() || ValidateEvalCoord1f(context, u));
1469 if (isCallValid)
1470 {
1471 context->evalCoord1f(u);
1472 }
1473 ANGLE_CAPTURE(EvalCoord1f, isCallValid, context, u);
1474 }
1475 else
1476 {
1477 GenerateContextLostErrorOnCurrentGlobalContext();
1478 }
1479 }
1480
GL_EvalCoord1fv(const GLfloat * u)1481 void GL_APIENTRY GL_EvalCoord1fv(const GLfloat *u)
1482 {
1483 Context *context = GetValidGlobalContext();
1484 EVENT(context, GLEvalCoord1fv, "context = %d, u = 0x%016" PRIxPTR "", CID(context),
1485 (uintptr_t)u);
1486
1487 if (context)
1488 {
1489 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1490 bool isCallValid = (context->skipValidation() || ValidateEvalCoord1fv(context, u));
1491 if (isCallValid)
1492 {
1493 context->evalCoord1fv(u);
1494 }
1495 ANGLE_CAPTURE(EvalCoord1fv, isCallValid, context, u);
1496 }
1497 else
1498 {
1499 GenerateContextLostErrorOnCurrentGlobalContext();
1500 }
1501 }
1502
GL_EvalCoord2d(GLdouble u,GLdouble v)1503 void GL_APIENTRY GL_EvalCoord2d(GLdouble u, GLdouble v)
1504 {
1505 Context *context = GetValidGlobalContext();
1506 EVENT(context, GLEvalCoord2d, "context = %d, u = %f, v = %f", CID(context), u, v);
1507
1508 if (context)
1509 {
1510 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1511 bool isCallValid = (context->skipValidation() || ValidateEvalCoord2d(context, u, v));
1512 if (isCallValid)
1513 {
1514 context->evalCoord2d(u, v);
1515 }
1516 ANGLE_CAPTURE(EvalCoord2d, isCallValid, context, u, v);
1517 }
1518 else
1519 {
1520 GenerateContextLostErrorOnCurrentGlobalContext();
1521 }
1522 }
1523
GL_EvalCoord2dv(const GLdouble * u)1524 void GL_APIENTRY GL_EvalCoord2dv(const GLdouble *u)
1525 {
1526 Context *context = GetValidGlobalContext();
1527 EVENT(context, GLEvalCoord2dv, "context = %d, u = 0x%016" PRIxPTR "", CID(context),
1528 (uintptr_t)u);
1529
1530 if (context)
1531 {
1532 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1533 bool isCallValid = (context->skipValidation() || ValidateEvalCoord2dv(context, u));
1534 if (isCallValid)
1535 {
1536 context->evalCoord2dv(u);
1537 }
1538 ANGLE_CAPTURE(EvalCoord2dv, isCallValid, context, u);
1539 }
1540 else
1541 {
1542 GenerateContextLostErrorOnCurrentGlobalContext();
1543 }
1544 }
1545
GL_EvalCoord2f(GLfloat u,GLfloat v)1546 void GL_APIENTRY GL_EvalCoord2f(GLfloat u, GLfloat v)
1547 {
1548 Context *context = GetValidGlobalContext();
1549 EVENT(context, GLEvalCoord2f, "context = %d, u = %f, v = %f", CID(context), u, v);
1550
1551 if (context)
1552 {
1553 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1554 bool isCallValid = (context->skipValidation() || ValidateEvalCoord2f(context, u, v));
1555 if (isCallValid)
1556 {
1557 context->evalCoord2f(u, v);
1558 }
1559 ANGLE_CAPTURE(EvalCoord2f, isCallValid, context, u, v);
1560 }
1561 else
1562 {
1563 GenerateContextLostErrorOnCurrentGlobalContext();
1564 }
1565 }
1566
GL_EvalCoord2fv(const GLfloat * u)1567 void GL_APIENTRY GL_EvalCoord2fv(const GLfloat *u)
1568 {
1569 Context *context = GetValidGlobalContext();
1570 EVENT(context, GLEvalCoord2fv, "context = %d, u = 0x%016" PRIxPTR "", CID(context),
1571 (uintptr_t)u);
1572
1573 if (context)
1574 {
1575 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1576 bool isCallValid = (context->skipValidation() || ValidateEvalCoord2fv(context, u));
1577 if (isCallValid)
1578 {
1579 context->evalCoord2fv(u);
1580 }
1581 ANGLE_CAPTURE(EvalCoord2fv, isCallValid, context, u);
1582 }
1583 else
1584 {
1585 GenerateContextLostErrorOnCurrentGlobalContext();
1586 }
1587 }
1588
GL_EvalMesh1(GLenum mode,GLint i1,GLint i2)1589 void GL_APIENTRY GL_EvalMesh1(GLenum mode, GLint i1, GLint i2)
1590 {
1591 Context *context = GetValidGlobalContext();
1592 EVENT(context, GLEvalMesh1, "context = %d, mode = %s, i1 = %d, i2 = %d", CID(context),
1593 GLenumToString(GLenumGroup::MeshMode1, mode), i1, i2);
1594
1595 if (context)
1596 {
1597 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1598 bool isCallValid = (context->skipValidation() || ValidateEvalMesh1(context, mode, i1, i2));
1599 if (isCallValid)
1600 {
1601 context->evalMesh1(mode, i1, i2);
1602 }
1603 ANGLE_CAPTURE(EvalMesh1, isCallValid, context, mode, i1, i2);
1604 }
1605 else
1606 {
1607 GenerateContextLostErrorOnCurrentGlobalContext();
1608 }
1609 }
1610
GL_EvalMesh2(GLenum mode,GLint i1,GLint i2,GLint j1,GLint j2)1611 void GL_APIENTRY GL_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
1612 {
1613 Context *context = GetValidGlobalContext();
1614 EVENT(context, GLEvalMesh2, "context = %d, mode = %s, i1 = %d, i2 = %d, j1 = %d, j2 = %d",
1615 CID(context), GLenumToString(GLenumGroup::MeshMode2, mode), i1, i2, j1, j2);
1616
1617 if (context)
1618 {
1619 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1620 bool isCallValid =
1621 (context->skipValidation() || ValidateEvalMesh2(context, mode, i1, i2, j1, j2));
1622 if (isCallValid)
1623 {
1624 context->evalMesh2(mode, i1, i2, j1, j2);
1625 }
1626 ANGLE_CAPTURE(EvalMesh2, isCallValid, context, mode, i1, i2, j1, j2);
1627 }
1628 else
1629 {
1630 GenerateContextLostErrorOnCurrentGlobalContext();
1631 }
1632 }
1633
GL_EvalPoint1(GLint i)1634 void GL_APIENTRY GL_EvalPoint1(GLint i)
1635 {
1636 Context *context = GetValidGlobalContext();
1637 EVENT(context, GLEvalPoint1, "context = %d, i = %d", CID(context), i);
1638
1639 if (context)
1640 {
1641 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1642 bool isCallValid = (context->skipValidation() || ValidateEvalPoint1(context, i));
1643 if (isCallValid)
1644 {
1645 context->evalPoint1(i);
1646 }
1647 ANGLE_CAPTURE(EvalPoint1, isCallValid, context, i);
1648 }
1649 else
1650 {
1651 GenerateContextLostErrorOnCurrentGlobalContext();
1652 }
1653 }
1654
GL_EvalPoint2(GLint i,GLint j)1655 void GL_APIENTRY GL_EvalPoint2(GLint i, GLint j)
1656 {
1657 Context *context = GetValidGlobalContext();
1658 EVENT(context, GLEvalPoint2, "context = %d, i = %d, j = %d", CID(context), i, j);
1659
1660 if (context)
1661 {
1662 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1663 bool isCallValid = (context->skipValidation() || ValidateEvalPoint2(context, i, j));
1664 if (isCallValid)
1665 {
1666 context->evalPoint2(i, j);
1667 }
1668 ANGLE_CAPTURE(EvalPoint2, isCallValid, context, i, j);
1669 }
1670 else
1671 {
1672 GenerateContextLostErrorOnCurrentGlobalContext();
1673 }
1674 }
1675
GL_FeedbackBuffer(GLsizei size,GLenum type,GLfloat * buffer)1676 void GL_APIENTRY GL_FeedbackBuffer(GLsizei size, GLenum type, GLfloat *buffer)
1677 {
1678 Context *context = GetValidGlobalContext();
1679 EVENT(context, GLFeedbackBuffer,
1680 "context = %d, size = %d, type = %s, buffer = 0x%016" PRIxPTR "", CID(context), size,
1681 GLenumToString(GLenumGroup::FeedbackType, type), (uintptr_t)buffer);
1682
1683 if (context)
1684 {
1685 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1686 bool isCallValid =
1687 (context->skipValidation() || ValidateFeedbackBuffer(context, size, type, buffer));
1688 if (isCallValid)
1689 {
1690 context->feedbackBuffer(size, type, buffer);
1691 }
1692 ANGLE_CAPTURE(FeedbackBuffer, isCallValid, context, size, type, buffer);
1693 }
1694 else
1695 {
1696 GenerateContextLostErrorOnCurrentGlobalContext();
1697 }
1698 }
1699
GL_Finish()1700 void GL_APIENTRY GL_Finish()
1701 {
1702 Context *context = GetValidGlobalContext();
1703 EVENT(context, GLFinish, "context = %d", CID(context));
1704
1705 if (context)
1706 {
1707 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1708 bool isCallValid = (context->skipValidation() || ValidateFinish(context));
1709 if (isCallValid)
1710 {
1711 context->finish();
1712 }
1713 ANGLE_CAPTURE(Finish, isCallValid, context);
1714 }
1715 else
1716 {
1717 GenerateContextLostErrorOnCurrentGlobalContext();
1718 }
1719 }
1720
GL_Flush()1721 void GL_APIENTRY GL_Flush()
1722 {
1723 Context *context = GetValidGlobalContext();
1724 EVENT(context, GLFlush, "context = %d", CID(context));
1725
1726 if (context)
1727 {
1728 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1729 bool isCallValid = (context->skipValidation() || ValidateFlush(context));
1730 if (isCallValid)
1731 {
1732 context->flush();
1733 }
1734 ANGLE_CAPTURE(Flush, isCallValid, context);
1735 }
1736 else
1737 {
1738 GenerateContextLostErrorOnCurrentGlobalContext();
1739 }
1740 }
1741
GL_Fogf(GLenum pname,GLfloat param)1742 void GL_APIENTRY GL_Fogf(GLenum pname, GLfloat param)
1743 {
1744 Context *context = GetValidGlobalContext();
1745 EVENT(context, GLFogf, "context = %d, pname = %s, param = %f", CID(context),
1746 GLenumToString(GLenumGroup::FogParameter, pname), param);
1747
1748 if (context)
1749 {
1750 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1751 bool isCallValid = (context->skipValidation() || ValidateFogf(context, pname, param));
1752 if (isCallValid)
1753 {
1754 context->fogf(pname, param);
1755 }
1756 ANGLE_CAPTURE(Fogf, isCallValid, context, pname, param);
1757 }
1758 else
1759 {
1760 GenerateContextLostErrorOnCurrentGlobalContext();
1761 }
1762 }
1763
GL_Fogfv(GLenum pname,const GLfloat * params)1764 void GL_APIENTRY GL_Fogfv(GLenum pname, const GLfloat *params)
1765 {
1766 Context *context = GetValidGlobalContext();
1767 EVENT(context, GLFogfv, "context = %d, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
1768 GLenumToString(GLenumGroup::FogParameter, pname), (uintptr_t)params);
1769
1770 if (context)
1771 {
1772 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1773 bool isCallValid = (context->skipValidation() || ValidateFogfv(context, pname, params));
1774 if (isCallValid)
1775 {
1776 context->fogfv(pname, params);
1777 }
1778 ANGLE_CAPTURE(Fogfv, isCallValid, context, pname, params);
1779 }
1780 else
1781 {
1782 GenerateContextLostErrorOnCurrentGlobalContext();
1783 }
1784 }
1785
GL_Fogi(GLenum pname,GLint param)1786 void GL_APIENTRY GL_Fogi(GLenum pname, GLint param)
1787 {
1788 Context *context = GetValidGlobalContext();
1789 EVENT(context, GLFogi, "context = %d, pname = %s, param = %d", CID(context),
1790 GLenumToString(GLenumGroup::FogParameter, pname), param);
1791
1792 if (context)
1793 {
1794 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1795 bool isCallValid = (context->skipValidation() || ValidateFogi(context, pname, param));
1796 if (isCallValid)
1797 {
1798 context->fogi(pname, param);
1799 }
1800 ANGLE_CAPTURE(Fogi, isCallValid, context, pname, param);
1801 }
1802 else
1803 {
1804 GenerateContextLostErrorOnCurrentGlobalContext();
1805 }
1806 }
1807
GL_Fogiv(GLenum pname,const GLint * params)1808 void GL_APIENTRY GL_Fogiv(GLenum pname, const GLint *params)
1809 {
1810 Context *context = GetValidGlobalContext();
1811 EVENT(context, GLFogiv, "context = %d, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
1812 GLenumToString(GLenumGroup::FogParameter, pname), (uintptr_t)params);
1813
1814 if (context)
1815 {
1816 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1817 bool isCallValid = (context->skipValidation() || ValidateFogiv(context, pname, params));
1818 if (isCallValid)
1819 {
1820 context->fogiv(pname, params);
1821 }
1822 ANGLE_CAPTURE(Fogiv, isCallValid, context, pname, params);
1823 }
1824 else
1825 {
1826 GenerateContextLostErrorOnCurrentGlobalContext();
1827 }
1828 }
1829
GL_FrontFace(GLenum mode)1830 void GL_APIENTRY GL_FrontFace(GLenum mode)
1831 {
1832 Context *context = GetValidGlobalContext();
1833 EVENT(context, GLFrontFace, "context = %d, mode = %s", CID(context),
1834 GLenumToString(GLenumGroup::FrontFaceDirection, mode));
1835
1836 if (context)
1837 {
1838 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1839 bool isCallValid = (context->skipValidation() || ValidateFrontFace(context, mode));
1840 if (isCallValid)
1841 {
1842 context->frontFace(mode);
1843 }
1844 ANGLE_CAPTURE(FrontFace, isCallValid, context, mode);
1845 }
1846 else
1847 {
1848 GenerateContextLostErrorOnCurrentGlobalContext();
1849 }
1850 }
1851
GL_Frustum(GLdouble left,GLdouble right,GLdouble bottom,GLdouble top,GLdouble zNear,GLdouble zFar)1852 void GL_APIENTRY GL_Frustum(GLdouble left,
1853 GLdouble right,
1854 GLdouble bottom,
1855 GLdouble top,
1856 GLdouble zNear,
1857 GLdouble zFar)
1858 {
1859 Context *context = GetValidGlobalContext();
1860 EVENT(context, GLFrustum,
1861 "context = %d, left = %f, right = %f, bottom = %f, top = %f, zNear = %f, zFar = %f",
1862 CID(context), left, right, bottom, top, zNear, zFar);
1863
1864 if (context)
1865 {
1866 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1867 bool isCallValid = (context->skipValidation() ||
1868 ValidateFrustum(context, left, right, bottom, top, zNear, zFar));
1869 if (isCallValid)
1870 {
1871 context->frustum(left, right, bottom, top, zNear, zFar);
1872 }
1873 ANGLE_CAPTURE(Frustum, isCallValid, context, left, right, bottom, top, zNear, zFar);
1874 }
1875 else
1876 {
1877 GenerateContextLostErrorOnCurrentGlobalContext();
1878 }
1879 }
1880
GL_GenLists(GLsizei range)1881 GLuint GL_APIENTRY GL_GenLists(GLsizei range)
1882 {
1883 Context *context = GetValidGlobalContext();
1884 EVENT(context, GLGenLists, "context = %d, range = %d", CID(context), range);
1885
1886 GLuint returnValue;
1887 if (context)
1888 {
1889 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1890 bool isCallValid = (context->skipValidation() || ValidateGenLists(context, range));
1891 if (isCallValid)
1892 {
1893 returnValue = context->genLists(range);
1894 }
1895 else
1896 {
1897 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLGenLists, GLuint>();
1898 }
1899 ANGLE_CAPTURE(GenLists, isCallValid, context, range, returnValue);
1900 }
1901 else
1902 {
1903 GenerateContextLostErrorOnCurrentGlobalContext();
1904 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLGenLists, GLuint>();
1905 }
1906 return returnValue;
1907 }
1908
GL_GetBooleanv(GLenum pname,GLboolean * data)1909 void GL_APIENTRY GL_GetBooleanv(GLenum pname, GLboolean *data)
1910 {
1911 Context *context = GetValidGlobalContext();
1912 EVENT(context, GLGetBooleanv, "context = %d, pname = %s, data = 0x%016" PRIxPTR "",
1913 CID(context), GLenumToString(GLenumGroup::GetPName, pname), (uintptr_t)data);
1914
1915 if (context)
1916 {
1917 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1918 bool isCallValid = (context->skipValidation() || ValidateGetBooleanv(context, pname, data));
1919 if (isCallValid)
1920 {
1921 context->getBooleanv(pname, data);
1922 }
1923 ANGLE_CAPTURE(GetBooleanv, isCallValid, context, pname, data);
1924 }
1925 else
1926 {
1927 GenerateContextLostErrorOnCurrentGlobalContext();
1928 }
1929 }
1930
GL_GetClipPlane(GLenum plane,GLdouble * equation)1931 void GL_APIENTRY GL_GetClipPlane(GLenum plane, GLdouble *equation)
1932 {
1933 Context *context = GetValidGlobalContext();
1934 EVENT(context, GLGetClipPlane, "context = %d, plane = %s, equation = 0x%016" PRIxPTR "",
1935 CID(context), GLenumToString(GLenumGroup::ClipPlaneName, plane), (uintptr_t)equation);
1936
1937 if (context)
1938 {
1939 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1940 bool isCallValid =
1941 (context->skipValidation() || ValidateGetClipPlane(context, plane, equation));
1942 if (isCallValid)
1943 {
1944 context->getClipPlane(plane, equation);
1945 }
1946 ANGLE_CAPTURE(GetClipPlane, isCallValid, context, plane, equation);
1947 }
1948 else
1949 {
1950 GenerateContextLostErrorOnCurrentGlobalContext();
1951 }
1952 }
1953
GL_GetDoublev(GLenum pname,GLdouble * data)1954 void GL_APIENTRY GL_GetDoublev(GLenum pname, GLdouble *data)
1955 {
1956 Context *context = GetValidGlobalContext();
1957 EVENT(context, GLGetDoublev, "context = %d, pname = %s, data = 0x%016" PRIxPTR "", CID(context),
1958 GLenumToString(GLenumGroup::GetPName, pname), (uintptr_t)data);
1959
1960 if (context)
1961 {
1962 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1963 bool isCallValid = (context->skipValidation() || ValidateGetDoublev(context, pname, data));
1964 if (isCallValid)
1965 {
1966 context->getDoublev(pname, data);
1967 }
1968 ANGLE_CAPTURE(GetDoublev, isCallValid, context, pname, data);
1969 }
1970 else
1971 {
1972 GenerateContextLostErrorOnCurrentGlobalContext();
1973 }
1974 }
1975
GL_GetError()1976 GLenum GL_APIENTRY GL_GetError()
1977 {
1978 Context *context = GetGlobalContext();
1979 EVENT(context, GLGetError, "context = %d", CID(context));
1980
1981 GLenum returnValue;
1982 if (context)
1983 {
1984 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1985 bool isCallValid = (context->skipValidation() || ValidateGetError(context));
1986 if (isCallValid)
1987 {
1988 returnValue = context->getError();
1989 }
1990 else
1991 {
1992 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLGetError, GLenum>();
1993 }
1994 ANGLE_CAPTURE(GetError, isCallValid, context, returnValue);
1995 }
1996 else
1997 {
1998
1999 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLGetError, GLenum>();
2000 }
2001 return returnValue;
2002 }
2003
GL_GetFloatv(GLenum pname,GLfloat * data)2004 void GL_APIENTRY GL_GetFloatv(GLenum pname, GLfloat *data)
2005 {
2006 Context *context = GetValidGlobalContext();
2007 EVENT(context, GLGetFloatv, "context = %d, pname = %s, data = 0x%016" PRIxPTR "", CID(context),
2008 GLenumToString(GLenumGroup::GetPName, pname), (uintptr_t)data);
2009
2010 if (context)
2011 {
2012 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2013 bool isCallValid = (context->skipValidation() || ValidateGetFloatv(context, pname, data));
2014 if (isCallValid)
2015 {
2016 context->getFloatv(pname, data);
2017 }
2018 ANGLE_CAPTURE(GetFloatv, isCallValid, context, pname, data);
2019 }
2020 else
2021 {
2022 GenerateContextLostErrorOnCurrentGlobalContext();
2023 }
2024 }
2025
GL_GetIntegerv(GLenum pname,GLint * data)2026 void GL_APIENTRY GL_GetIntegerv(GLenum pname, GLint *data)
2027 {
2028 Context *context = GetValidGlobalContext();
2029 EVENT(context, GLGetIntegerv, "context = %d, pname = %s, data = 0x%016" PRIxPTR "",
2030 CID(context), GLenumToString(GLenumGroup::GetPName, pname), (uintptr_t)data);
2031
2032 if (context)
2033 {
2034 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2035 bool isCallValid = (context->skipValidation() || ValidateGetIntegerv(context, pname, data));
2036 if (isCallValid)
2037 {
2038 context->getIntegerv(pname, data);
2039 }
2040 ANGLE_CAPTURE(GetIntegerv, isCallValid, context, pname, data);
2041 }
2042 else
2043 {
2044 GenerateContextLostErrorOnCurrentGlobalContext();
2045 }
2046 }
2047
GL_GetLightfv(GLenum light,GLenum pname,GLfloat * params)2048 void GL_APIENTRY GL_GetLightfv(GLenum light, GLenum pname, GLfloat *params)
2049 {
2050 Context *context = GetValidGlobalContext();
2051 EVENT(context, GLGetLightfv, "context = %d, light = %s, pname = %s, params = 0x%016" PRIxPTR "",
2052 CID(context), GLenumToString(GLenumGroup::LightName, light),
2053 GLenumToString(GLenumGroup::LightParameter, pname), (uintptr_t)params);
2054
2055 if (context)
2056 {
2057 LightParameter pnamePacked = PackParam<LightParameter>(pname);
2058 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2059 bool isCallValid =
2060 (context->skipValidation() || ValidateGetLightfv(context, light, pnamePacked, params));
2061 if (isCallValid)
2062 {
2063 context->getLightfv(light, pnamePacked, params);
2064 }
2065 ANGLE_CAPTURE(GetLightfv, isCallValid, context, light, pnamePacked, params);
2066 }
2067 else
2068 {
2069 GenerateContextLostErrorOnCurrentGlobalContext();
2070 }
2071 }
2072
GL_GetLightiv(GLenum light,GLenum pname,GLint * params)2073 void GL_APIENTRY GL_GetLightiv(GLenum light, GLenum pname, GLint *params)
2074 {
2075 Context *context = GetValidGlobalContext();
2076 EVENT(context, GLGetLightiv, "context = %d, light = %s, pname = %s, params = 0x%016" PRIxPTR "",
2077 CID(context), GLenumToString(GLenumGroup::LightName, light),
2078 GLenumToString(GLenumGroup::LightParameter, pname), (uintptr_t)params);
2079
2080 if (context)
2081 {
2082 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2083 bool isCallValid =
2084 (context->skipValidation() || ValidateGetLightiv(context, light, pname, params));
2085 if (isCallValid)
2086 {
2087 context->getLightiv(light, pname, params);
2088 }
2089 ANGLE_CAPTURE(GetLightiv, isCallValid, context, light, pname, params);
2090 }
2091 else
2092 {
2093 GenerateContextLostErrorOnCurrentGlobalContext();
2094 }
2095 }
2096
GL_GetMapdv(GLenum target,GLenum query,GLdouble * v)2097 void GL_APIENTRY GL_GetMapdv(GLenum target, GLenum query, GLdouble *v)
2098 {
2099 Context *context = GetValidGlobalContext();
2100 EVENT(context, GLGetMapdv, "context = %d, target = %s, query = %s, v = 0x%016" PRIxPTR "",
2101 CID(context), GLenumToString(GLenumGroup::MapTarget, target),
2102 GLenumToString(GLenumGroup::GetMapQuery, query), (uintptr_t)v);
2103
2104 if (context)
2105 {
2106 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2107 bool isCallValid =
2108 (context->skipValidation() || ValidateGetMapdv(context, target, query, v));
2109 if (isCallValid)
2110 {
2111 context->getMapdv(target, query, v);
2112 }
2113 ANGLE_CAPTURE(GetMapdv, isCallValid, context, target, query, v);
2114 }
2115 else
2116 {
2117 GenerateContextLostErrorOnCurrentGlobalContext();
2118 }
2119 }
2120
GL_GetMapfv(GLenum target,GLenum query,GLfloat * v)2121 void GL_APIENTRY GL_GetMapfv(GLenum target, GLenum query, GLfloat *v)
2122 {
2123 Context *context = GetValidGlobalContext();
2124 EVENT(context, GLGetMapfv, "context = %d, target = %s, query = %s, v = 0x%016" PRIxPTR "",
2125 CID(context), GLenumToString(GLenumGroup::MapTarget, target),
2126 GLenumToString(GLenumGroup::GetMapQuery, query), (uintptr_t)v);
2127
2128 if (context)
2129 {
2130 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2131 bool isCallValid =
2132 (context->skipValidation() || ValidateGetMapfv(context, target, query, v));
2133 if (isCallValid)
2134 {
2135 context->getMapfv(target, query, v);
2136 }
2137 ANGLE_CAPTURE(GetMapfv, isCallValid, context, target, query, v);
2138 }
2139 else
2140 {
2141 GenerateContextLostErrorOnCurrentGlobalContext();
2142 }
2143 }
2144
GL_GetMapiv(GLenum target,GLenum query,GLint * v)2145 void GL_APIENTRY GL_GetMapiv(GLenum target, GLenum query, GLint *v)
2146 {
2147 Context *context = GetValidGlobalContext();
2148 EVENT(context, GLGetMapiv, "context = %d, target = %s, query = %s, v = 0x%016" PRIxPTR "",
2149 CID(context), GLenumToString(GLenumGroup::MapTarget, target),
2150 GLenumToString(GLenumGroup::GetMapQuery, query), (uintptr_t)v);
2151
2152 if (context)
2153 {
2154 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2155 bool isCallValid =
2156 (context->skipValidation() || ValidateGetMapiv(context, target, query, v));
2157 if (isCallValid)
2158 {
2159 context->getMapiv(target, query, v);
2160 }
2161 ANGLE_CAPTURE(GetMapiv, isCallValid, context, target, query, v);
2162 }
2163 else
2164 {
2165 GenerateContextLostErrorOnCurrentGlobalContext();
2166 }
2167 }
2168
GL_GetMaterialfv(GLenum face,GLenum pname,GLfloat * params)2169 void GL_APIENTRY GL_GetMaterialfv(GLenum face, GLenum pname, GLfloat *params)
2170 {
2171 Context *context = GetValidGlobalContext();
2172 EVENT(context, GLGetMaterialfv,
2173 "context = %d, face = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
2174 GLenumToString(GLenumGroup::MaterialFace, face),
2175 GLenumToString(GLenumGroup::MaterialParameter, pname), (uintptr_t)params);
2176
2177 if (context)
2178 {
2179 MaterialParameter pnamePacked = PackParam<MaterialParameter>(pname);
2180 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2181 bool isCallValid = (context->skipValidation() ||
2182 ValidateGetMaterialfv(context, face, pnamePacked, params));
2183 if (isCallValid)
2184 {
2185 context->getMaterialfv(face, pnamePacked, params);
2186 }
2187 ANGLE_CAPTURE(GetMaterialfv, isCallValid, context, face, pnamePacked, params);
2188 }
2189 else
2190 {
2191 GenerateContextLostErrorOnCurrentGlobalContext();
2192 }
2193 }
2194
GL_GetMaterialiv(GLenum face,GLenum pname,GLint * params)2195 void GL_APIENTRY GL_GetMaterialiv(GLenum face, GLenum pname, GLint *params)
2196 {
2197 Context *context = GetValidGlobalContext();
2198 EVENT(context, GLGetMaterialiv,
2199 "context = %d, face = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
2200 GLenumToString(GLenumGroup::MaterialFace, face),
2201 GLenumToString(GLenumGroup::MaterialParameter, pname), (uintptr_t)params);
2202
2203 if (context)
2204 {
2205 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2206 bool isCallValid =
2207 (context->skipValidation() || ValidateGetMaterialiv(context, face, pname, params));
2208 if (isCallValid)
2209 {
2210 context->getMaterialiv(face, pname, params);
2211 }
2212 ANGLE_CAPTURE(GetMaterialiv, isCallValid, context, face, pname, params);
2213 }
2214 else
2215 {
2216 GenerateContextLostErrorOnCurrentGlobalContext();
2217 }
2218 }
2219
GL_GetPixelMapfv(GLenum map,GLfloat * values)2220 void GL_APIENTRY GL_GetPixelMapfv(GLenum map, GLfloat *values)
2221 {
2222 Context *context = GetValidGlobalContext();
2223 EVENT(context, GLGetPixelMapfv, "context = %d, map = %s, values = 0x%016" PRIxPTR "",
2224 CID(context), GLenumToString(GLenumGroup::PixelMap, map), (uintptr_t)values);
2225
2226 if (context)
2227 {
2228 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2229 bool isCallValid =
2230 (context->skipValidation() || ValidateGetPixelMapfv(context, map, values));
2231 if (isCallValid)
2232 {
2233 context->getPixelMapfv(map, values);
2234 }
2235 ANGLE_CAPTURE(GetPixelMapfv, isCallValid, context, map, values);
2236 }
2237 else
2238 {
2239 GenerateContextLostErrorOnCurrentGlobalContext();
2240 }
2241 }
2242
GL_GetPixelMapuiv(GLenum map,GLuint * values)2243 void GL_APIENTRY GL_GetPixelMapuiv(GLenum map, GLuint *values)
2244 {
2245 Context *context = GetValidGlobalContext();
2246 EVENT(context, GLGetPixelMapuiv, "context = %d, map = %s, values = 0x%016" PRIxPTR "",
2247 CID(context), GLenumToString(GLenumGroup::PixelMap, map), (uintptr_t)values);
2248
2249 if (context)
2250 {
2251 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2252 bool isCallValid =
2253 (context->skipValidation() || ValidateGetPixelMapuiv(context, map, values));
2254 if (isCallValid)
2255 {
2256 context->getPixelMapuiv(map, values);
2257 }
2258 ANGLE_CAPTURE(GetPixelMapuiv, isCallValid, context, map, values);
2259 }
2260 else
2261 {
2262 GenerateContextLostErrorOnCurrentGlobalContext();
2263 }
2264 }
2265
GL_GetPixelMapusv(GLenum map,GLushort * values)2266 void GL_APIENTRY GL_GetPixelMapusv(GLenum map, GLushort *values)
2267 {
2268 Context *context = GetValidGlobalContext();
2269 EVENT(context, GLGetPixelMapusv, "context = %d, map = %s, values = 0x%016" PRIxPTR "",
2270 CID(context), GLenumToString(GLenumGroup::PixelMap, map), (uintptr_t)values);
2271
2272 if (context)
2273 {
2274 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2275 bool isCallValid =
2276 (context->skipValidation() || ValidateGetPixelMapusv(context, map, values));
2277 if (isCallValid)
2278 {
2279 context->getPixelMapusv(map, values);
2280 }
2281 ANGLE_CAPTURE(GetPixelMapusv, isCallValid, context, map, values);
2282 }
2283 else
2284 {
2285 GenerateContextLostErrorOnCurrentGlobalContext();
2286 }
2287 }
2288
GL_GetPolygonStipple(GLubyte * mask)2289 void GL_APIENTRY GL_GetPolygonStipple(GLubyte *mask)
2290 {
2291 Context *context = GetValidGlobalContext();
2292 EVENT(context, GLGetPolygonStipple, "context = %d, mask = 0x%016" PRIxPTR "", CID(context),
2293 (uintptr_t)mask);
2294
2295 if (context)
2296 {
2297 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2298 bool isCallValid = (context->skipValidation() || ValidateGetPolygonStipple(context, mask));
2299 if (isCallValid)
2300 {
2301 context->getPolygonStipple(mask);
2302 }
2303 ANGLE_CAPTURE(GetPolygonStipple, isCallValid, context, mask);
2304 }
2305 else
2306 {
2307 GenerateContextLostErrorOnCurrentGlobalContext();
2308 }
2309 }
2310
GL_GetString(GLenum name)2311 const GLubyte *GL_APIENTRY GL_GetString(GLenum name)
2312 {
2313 Context *context = GetValidGlobalContext();
2314 EVENT(context, GLGetString, "context = %d, name = %s", CID(context),
2315 GLenumToString(GLenumGroup::StringName, name));
2316
2317 const GLubyte *returnValue;
2318 if (context)
2319 {
2320 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2321 bool isCallValid = (context->skipValidation() || ValidateGetString(context, name));
2322 if (isCallValid)
2323 {
2324 returnValue = context->getString(name);
2325 }
2326 else
2327 {
2328 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLGetString, const GLubyte *>();
2329 }
2330 ANGLE_CAPTURE(GetString, isCallValid, context, name, returnValue);
2331 }
2332 else
2333 {
2334 GenerateContextLostErrorOnCurrentGlobalContext();
2335 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLGetString, const GLubyte *>();
2336 }
2337 return returnValue;
2338 }
2339
GL_GetTexEnvfv(GLenum target,GLenum pname,GLfloat * params)2340 void GL_APIENTRY GL_GetTexEnvfv(GLenum target, GLenum pname, GLfloat *params)
2341 {
2342 Context *context = GetValidGlobalContext();
2343 EVENT(context, GLGetTexEnvfv,
2344 "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
2345 GLenumToString(GLenumGroup::TextureEnvTarget, target),
2346 GLenumToString(GLenumGroup::TextureEnvParameter, pname), (uintptr_t)params);
2347
2348 if (context)
2349 {
2350 TextureEnvTarget targetPacked = PackParam<TextureEnvTarget>(target);
2351 TextureEnvParameter pnamePacked = PackParam<TextureEnvParameter>(pname);
2352 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2353 bool isCallValid = (context->skipValidation() ||
2354 ValidateGetTexEnvfv(context, targetPacked, pnamePacked, params));
2355 if (isCallValid)
2356 {
2357 context->getTexEnvfv(targetPacked, pnamePacked, params);
2358 }
2359 ANGLE_CAPTURE(GetTexEnvfv, isCallValid, context, targetPacked, pnamePacked, params);
2360 }
2361 else
2362 {
2363 GenerateContextLostErrorOnCurrentGlobalContext();
2364 }
2365 }
2366
GL_GetTexEnviv(GLenum target,GLenum pname,GLint * params)2367 void GL_APIENTRY GL_GetTexEnviv(GLenum target, GLenum pname, GLint *params)
2368 {
2369 Context *context = GetValidGlobalContext();
2370 EVENT(context, GLGetTexEnviv,
2371 "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
2372 GLenumToString(GLenumGroup::TextureEnvTarget, target),
2373 GLenumToString(GLenumGroup::TextureEnvParameter, pname), (uintptr_t)params);
2374
2375 if (context)
2376 {
2377 TextureEnvTarget targetPacked = PackParam<TextureEnvTarget>(target);
2378 TextureEnvParameter pnamePacked = PackParam<TextureEnvParameter>(pname);
2379 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2380 bool isCallValid = (context->skipValidation() ||
2381 ValidateGetTexEnviv(context, targetPacked, pnamePacked, params));
2382 if (isCallValid)
2383 {
2384 context->getTexEnviv(targetPacked, pnamePacked, params);
2385 }
2386 ANGLE_CAPTURE(GetTexEnviv, isCallValid, context, targetPacked, pnamePacked, params);
2387 }
2388 else
2389 {
2390 GenerateContextLostErrorOnCurrentGlobalContext();
2391 }
2392 }
2393
GL_GetTexGendv(GLenum coord,GLenum pname,GLdouble * params)2394 void GL_APIENTRY GL_GetTexGendv(GLenum coord, GLenum pname, GLdouble *params)
2395 {
2396 Context *context = GetValidGlobalContext();
2397 EVENT(context, GLGetTexGendv,
2398 "context = %d, coord = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
2399 GLenumToString(GLenumGroup::TextureCoordName, coord),
2400 GLenumToString(GLenumGroup::TextureGenParameter, pname), (uintptr_t)params);
2401
2402 if (context)
2403 {
2404 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2405 bool isCallValid =
2406 (context->skipValidation() || ValidateGetTexGendv(context, coord, pname, params));
2407 if (isCallValid)
2408 {
2409 context->getTexGendv(coord, pname, params);
2410 }
2411 ANGLE_CAPTURE(GetTexGendv, isCallValid, context, coord, pname, params);
2412 }
2413 else
2414 {
2415 GenerateContextLostErrorOnCurrentGlobalContext();
2416 }
2417 }
2418
GL_GetTexGenfv(GLenum coord,GLenum pname,GLfloat * params)2419 void GL_APIENTRY GL_GetTexGenfv(GLenum coord, GLenum pname, GLfloat *params)
2420 {
2421 Context *context = GetValidGlobalContext();
2422 EVENT(context, GLGetTexGenfv,
2423 "context = %d, coord = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
2424 GLenumToString(GLenumGroup::TextureCoordName, coord),
2425 GLenumToString(GLenumGroup::TextureGenParameter, pname), (uintptr_t)params);
2426
2427 if (context)
2428 {
2429 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2430 bool isCallValid =
2431 (context->skipValidation() || ValidateGetTexGenfv(context, coord, pname, params));
2432 if (isCallValid)
2433 {
2434 context->getTexGenfv(coord, pname, params);
2435 }
2436 ANGLE_CAPTURE(GetTexGenfv, isCallValid, context, coord, pname, params);
2437 }
2438 else
2439 {
2440 GenerateContextLostErrorOnCurrentGlobalContext();
2441 }
2442 }
2443
GL_GetTexGeniv(GLenum coord,GLenum pname,GLint * params)2444 void GL_APIENTRY GL_GetTexGeniv(GLenum coord, GLenum pname, GLint *params)
2445 {
2446 Context *context = GetValidGlobalContext();
2447 EVENT(context, GLGetTexGeniv,
2448 "context = %d, coord = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
2449 GLenumToString(GLenumGroup::TextureCoordName, coord),
2450 GLenumToString(GLenumGroup::TextureGenParameter, pname), (uintptr_t)params);
2451
2452 if (context)
2453 {
2454 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2455 bool isCallValid =
2456 (context->skipValidation() || ValidateGetTexGeniv(context, coord, pname, params));
2457 if (isCallValid)
2458 {
2459 context->getTexGeniv(coord, pname, params);
2460 }
2461 ANGLE_CAPTURE(GetTexGeniv, isCallValid, context, coord, pname, params);
2462 }
2463 else
2464 {
2465 GenerateContextLostErrorOnCurrentGlobalContext();
2466 }
2467 }
2468
2469 void GL_APIENTRY
GL_GetTexImage(GLenum target,GLint level,GLenum format,GLenum type,void * pixels)2470 GL_GetTexImage(GLenum target, GLint level, GLenum format, GLenum type, void *pixels)
2471 {
2472 Context *context = GetValidGlobalContext();
2473 EVENT(context, GLGetTexImage,
2474 "context = %d, target = %s, level = %d, format = %s, type = %s, pixels = 0x%016" PRIxPTR
2475 "",
2476 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level,
2477 GLenumToString(GLenumGroup::PixelFormat, format),
2478 GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)pixels);
2479
2480 if (context)
2481 {
2482 TextureTarget targetPacked = PackParam<TextureTarget>(target);
2483 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2484 bool isCallValid =
2485 (context->skipValidation() ||
2486 ValidateGetTexImage(context, targetPacked, level, format, type, pixels));
2487 if (isCallValid)
2488 {
2489 context->getTexImage(targetPacked, level, format, type, pixels);
2490 }
2491 ANGLE_CAPTURE(GetTexImage, isCallValid, context, targetPacked, level, format, type, pixels);
2492 }
2493 else
2494 {
2495 GenerateContextLostErrorOnCurrentGlobalContext();
2496 }
2497 }
2498
GL_GetTexLevelParameterfv(GLenum target,GLint level,GLenum pname,GLfloat * params)2499 void GL_APIENTRY GL_GetTexLevelParameterfv(GLenum target,
2500 GLint level,
2501 GLenum pname,
2502 GLfloat *params)
2503 {
2504 Context *context = GetValidGlobalContext();
2505 EVENT(context, GLGetTexLevelParameterfv,
2506 "context = %d, target = %s, level = %d, pname = %s, params = 0x%016" PRIxPTR "",
2507 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level,
2508 GLenumToString(GLenumGroup::GetTextureParameter, pname), (uintptr_t)params);
2509
2510 if (context)
2511 {
2512 TextureTarget targetPacked = PackParam<TextureTarget>(target);
2513 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2514 bool isCallValid =
2515 (context->skipValidation() ||
2516 ValidateGetTexLevelParameterfv(context, targetPacked, level, pname, params));
2517 if (isCallValid)
2518 {
2519 context->getTexLevelParameterfv(targetPacked, level, pname, params);
2520 }
2521 ANGLE_CAPTURE(GetTexLevelParameterfv, isCallValid, context, targetPacked, level, pname,
2522 params);
2523 }
2524 else
2525 {
2526 GenerateContextLostErrorOnCurrentGlobalContext();
2527 }
2528 }
2529
GL_GetTexLevelParameteriv(GLenum target,GLint level,GLenum pname,GLint * params)2530 void GL_APIENTRY GL_GetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params)
2531 {
2532 Context *context = GetValidGlobalContext();
2533 EVENT(context, GLGetTexLevelParameteriv,
2534 "context = %d, target = %s, level = %d, pname = %s, params = 0x%016" PRIxPTR "",
2535 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level,
2536 GLenumToString(GLenumGroup::GetTextureParameter, pname), (uintptr_t)params);
2537
2538 if (context)
2539 {
2540 TextureTarget targetPacked = PackParam<TextureTarget>(target);
2541 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2542 bool isCallValid =
2543 (context->skipValidation() ||
2544 ValidateGetTexLevelParameteriv(context, targetPacked, level, pname, params));
2545 if (isCallValid)
2546 {
2547 context->getTexLevelParameteriv(targetPacked, level, pname, params);
2548 }
2549 ANGLE_CAPTURE(GetTexLevelParameteriv, isCallValid, context, targetPacked, level, pname,
2550 params);
2551 }
2552 else
2553 {
2554 GenerateContextLostErrorOnCurrentGlobalContext();
2555 }
2556 }
2557
GL_GetTexParameterfv(GLenum target,GLenum pname,GLfloat * params)2558 void GL_APIENTRY GL_GetTexParameterfv(GLenum target, GLenum pname, GLfloat *params)
2559 {
2560 Context *context = GetValidGlobalContext();
2561 EVENT(context, GLGetTexParameterfv,
2562 "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
2563 GLenumToString(GLenumGroup::TextureTarget, target),
2564 GLenumToString(GLenumGroup::GetTextureParameter, pname), (uintptr_t)params);
2565
2566 if (context)
2567 {
2568 TextureType targetPacked = PackParam<TextureType>(target);
2569 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2570 bool isCallValid = (context->skipValidation() ||
2571 ValidateGetTexParameterfv(context, targetPacked, pname, params));
2572 if (isCallValid)
2573 {
2574 context->getTexParameterfv(targetPacked, pname, params);
2575 }
2576 ANGLE_CAPTURE(GetTexParameterfv, isCallValid, context, targetPacked, pname, params);
2577 }
2578 else
2579 {
2580 GenerateContextLostErrorOnCurrentGlobalContext();
2581 }
2582 }
2583
GL_GetTexParameteriv(GLenum target,GLenum pname,GLint * params)2584 void GL_APIENTRY GL_GetTexParameteriv(GLenum target, GLenum pname, GLint *params)
2585 {
2586 Context *context = GetValidGlobalContext();
2587 EVENT(context, GLGetTexParameteriv,
2588 "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
2589 GLenumToString(GLenumGroup::TextureTarget, target),
2590 GLenumToString(GLenumGroup::GetTextureParameter, pname), (uintptr_t)params);
2591
2592 if (context)
2593 {
2594 TextureType targetPacked = PackParam<TextureType>(target);
2595 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2596 bool isCallValid = (context->skipValidation() ||
2597 ValidateGetTexParameteriv(context, targetPacked, pname, params));
2598 if (isCallValid)
2599 {
2600 context->getTexParameteriv(targetPacked, pname, params);
2601 }
2602 ANGLE_CAPTURE(GetTexParameteriv, isCallValid, context, targetPacked, pname, params);
2603 }
2604 else
2605 {
2606 GenerateContextLostErrorOnCurrentGlobalContext();
2607 }
2608 }
2609
GL_Hint(GLenum target,GLenum mode)2610 void GL_APIENTRY GL_Hint(GLenum target, GLenum mode)
2611 {
2612 Context *context = GetValidGlobalContext();
2613 EVENT(context, GLHint, "context = %d, target = %s, mode = %s", CID(context),
2614 GLenumToString(GLenumGroup::HintTarget, target),
2615 GLenumToString(GLenumGroup::HintMode, mode));
2616
2617 if (context)
2618 {
2619 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2620 bool isCallValid = (context->skipValidation() || ValidateHint(context, target, mode));
2621 if (isCallValid)
2622 {
2623 context->hint(target, mode);
2624 }
2625 ANGLE_CAPTURE(Hint, isCallValid, context, target, mode);
2626 }
2627 else
2628 {
2629 GenerateContextLostErrorOnCurrentGlobalContext();
2630 }
2631 }
2632
GL_IndexMask(GLuint mask)2633 void GL_APIENTRY GL_IndexMask(GLuint mask)
2634 {
2635 Context *context = GetValidGlobalContext();
2636 EVENT(context, GLIndexMask, "context = %d, mask = %u", CID(context), mask);
2637
2638 if (context)
2639 {
2640 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2641 bool isCallValid = (context->skipValidation() || ValidateIndexMask(context, mask));
2642 if (isCallValid)
2643 {
2644 context->indexMask(mask);
2645 }
2646 ANGLE_CAPTURE(IndexMask, isCallValid, context, mask);
2647 }
2648 else
2649 {
2650 GenerateContextLostErrorOnCurrentGlobalContext();
2651 }
2652 }
2653
GL_Indexd(GLdouble c)2654 void GL_APIENTRY GL_Indexd(GLdouble c)
2655 {
2656 Context *context = GetValidGlobalContext();
2657 EVENT(context, GLIndexd, "context = %d, c = %f", CID(context), c);
2658
2659 if (context)
2660 {
2661 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2662 bool isCallValid = (context->skipValidation() || ValidateIndexd(context, c));
2663 if (isCallValid)
2664 {
2665 context->indexd(c);
2666 }
2667 ANGLE_CAPTURE(Indexd, isCallValid, context, c);
2668 }
2669 else
2670 {
2671 GenerateContextLostErrorOnCurrentGlobalContext();
2672 }
2673 }
2674
GL_Indexdv(const GLdouble * c)2675 void GL_APIENTRY GL_Indexdv(const GLdouble *c)
2676 {
2677 Context *context = GetValidGlobalContext();
2678 EVENT(context, GLIndexdv, "context = %d, c = 0x%016" PRIxPTR "", CID(context), (uintptr_t)c);
2679
2680 if (context)
2681 {
2682 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2683 bool isCallValid = (context->skipValidation() || ValidateIndexdv(context, c));
2684 if (isCallValid)
2685 {
2686 context->indexdv(c);
2687 }
2688 ANGLE_CAPTURE(Indexdv, isCallValid, context, c);
2689 }
2690 else
2691 {
2692 GenerateContextLostErrorOnCurrentGlobalContext();
2693 }
2694 }
2695
GL_Indexf(GLfloat c)2696 void GL_APIENTRY GL_Indexf(GLfloat c)
2697 {
2698 Context *context = GetValidGlobalContext();
2699 EVENT(context, GLIndexf, "context = %d, c = %f", CID(context), c);
2700
2701 if (context)
2702 {
2703 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2704 bool isCallValid = (context->skipValidation() || ValidateIndexf(context, c));
2705 if (isCallValid)
2706 {
2707 context->indexf(c);
2708 }
2709 ANGLE_CAPTURE(Indexf, isCallValid, context, c);
2710 }
2711 else
2712 {
2713 GenerateContextLostErrorOnCurrentGlobalContext();
2714 }
2715 }
2716
GL_Indexfv(const GLfloat * c)2717 void GL_APIENTRY GL_Indexfv(const GLfloat *c)
2718 {
2719 Context *context = GetValidGlobalContext();
2720 EVENT(context, GLIndexfv, "context = %d, c = 0x%016" PRIxPTR "", CID(context), (uintptr_t)c);
2721
2722 if (context)
2723 {
2724 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2725 bool isCallValid = (context->skipValidation() || ValidateIndexfv(context, c));
2726 if (isCallValid)
2727 {
2728 context->indexfv(c);
2729 }
2730 ANGLE_CAPTURE(Indexfv, isCallValid, context, c);
2731 }
2732 else
2733 {
2734 GenerateContextLostErrorOnCurrentGlobalContext();
2735 }
2736 }
2737
GL_Indexi(GLint c)2738 void GL_APIENTRY GL_Indexi(GLint c)
2739 {
2740 Context *context = GetValidGlobalContext();
2741 EVENT(context, GLIndexi, "context = %d, c = %d", CID(context), c);
2742
2743 if (context)
2744 {
2745 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2746 bool isCallValid = (context->skipValidation() || ValidateIndexi(context, c));
2747 if (isCallValid)
2748 {
2749 context->indexi(c);
2750 }
2751 ANGLE_CAPTURE(Indexi, isCallValid, context, c);
2752 }
2753 else
2754 {
2755 GenerateContextLostErrorOnCurrentGlobalContext();
2756 }
2757 }
2758
GL_Indexiv(const GLint * c)2759 void GL_APIENTRY GL_Indexiv(const GLint *c)
2760 {
2761 Context *context = GetValidGlobalContext();
2762 EVENT(context, GLIndexiv, "context = %d, c = 0x%016" PRIxPTR "", CID(context), (uintptr_t)c);
2763
2764 if (context)
2765 {
2766 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2767 bool isCallValid = (context->skipValidation() || ValidateIndexiv(context, c));
2768 if (isCallValid)
2769 {
2770 context->indexiv(c);
2771 }
2772 ANGLE_CAPTURE(Indexiv, isCallValid, context, c);
2773 }
2774 else
2775 {
2776 GenerateContextLostErrorOnCurrentGlobalContext();
2777 }
2778 }
2779
GL_Indexs(GLshort c)2780 void GL_APIENTRY GL_Indexs(GLshort c)
2781 {
2782 Context *context = GetValidGlobalContext();
2783 EVENT(context, GLIndexs, "context = %d, c = %d", CID(context), c);
2784
2785 if (context)
2786 {
2787 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2788 bool isCallValid = (context->skipValidation() || ValidateIndexs(context, c));
2789 if (isCallValid)
2790 {
2791 context->indexs(c);
2792 }
2793 ANGLE_CAPTURE(Indexs, isCallValid, context, c);
2794 }
2795 else
2796 {
2797 GenerateContextLostErrorOnCurrentGlobalContext();
2798 }
2799 }
2800
GL_Indexsv(const GLshort * c)2801 void GL_APIENTRY GL_Indexsv(const GLshort *c)
2802 {
2803 Context *context = GetValidGlobalContext();
2804 EVENT(context, GLIndexsv, "context = %d, c = 0x%016" PRIxPTR "", CID(context), (uintptr_t)c);
2805
2806 if (context)
2807 {
2808 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2809 bool isCallValid = (context->skipValidation() || ValidateIndexsv(context, c));
2810 if (isCallValid)
2811 {
2812 context->indexsv(c);
2813 }
2814 ANGLE_CAPTURE(Indexsv, isCallValid, context, c);
2815 }
2816 else
2817 {
2818 GenerateContextLostErrorOnCurrentGlobalContext();
2819 }
2820 }
2821
GL_InitNames()2822 void GL_APIENTRY GL_InitNames()
2823 {
2824 Context *context = GetValidGlobalContext();
2825 EVENT(context, GLInitNames, "context = %d", CID(context));
2826
2827 if (context)
2828 {
2829 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2830 bool isCallValid = (context->skipValidation() || ValidateInitNames(context));
2831 if (isCallValid)
2832 {
2833 context->initNames();
2834 }
2835 ANGLE_CAPTURE(InitNames, isCallValid, context);
2836 }
2837 else
2838 {
2839 GenerateContextLostErrorOnCurrentGlobalContext();
2840 }
2841 }
2842
GL_IsEnabled(GLenum cap)2843 GLboolean GL_APIENTRY GL_IsEnabled(GLenum cap)
2844 {
2845 Context *context = GetValidGlobalContext();
2846 EVENT(context, GLIsEnabled, "context = %d, cap = %s", CID(context),
2847 GLenumToString(GLenumGroup::EnableCap, cap));
2848
2849 GLboolean returnValue;
2850 if (context)
2851 {
2852 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2853 bool isCallValid = (context->skipValidation() || ValidateIsEnabled(context, cap));
2854 if (isCallValid)
2855 {
2856 returnValue = context->isEnabled(cap);
2857 }
2858 else
2859 {
2860 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsEnabled, GLboolean>();
2861 }
2862 ANGLE_CAPTURE(IsEnabled, isCallValid, context, cap, returnValue);
2863 }
2864 else
2865 {
2866 GenerateContextLostErrorOnCurrentGlobalContext();
2867 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsEnabled, GLboolean>();
2868 }
2869 return returnValue;
2870 }
2871
GL_IsList(GLuint list)2872 GLboolean GL_APIENTRY GL_IsList(GLuint list)
2873 {
2874 Context *context = GetValidGlobalContext();
2875 EVENT(context, GLIsList, "context = %d, list = %u", CID(context), list);
2876
2877 GLboolean returnValue;
2878 if (context)
2879 {
2880 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2881 bool isCallValid = (context->skipValidation() || ValidateIsList(context, list));
2882 if (isCallValid)
2883 {
2884 returnValue = context->isList(list);
2885 }
2886 else
2887 {
2888 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsList, GLboolean>();
2889 }
2890 ANGLE_CAPTURE(IsList, isCallValid, context, list, returnValue);
2891 }
2892 else
2893 {
2894 GenerateContextLostErrorOnCurrentGlobalContext();
2895 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsList, GLboolean>();
2896 }
2897 return returnValue;
2898 }
2899
GL_LightModelf(GLenum pname,GLfloat param)2900 void GL_APIENTRY GL_LightModelf(GLenum pname, GLfloat param)
2901 {
2902 Context *context = GetValidGlobalContext();
2903 EVENT(context, GLLightModelf, "context = %d, pname = %s, param = %f", CID(context),
2904 GLenumToString(GLenumGroup::LightModelParameter, pname), param);
2905
2906 if (context)
2907 {
2908 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2909 bool isCallValid =
2910 (context->skipValidation() || ValidateLightModelf(context, pname, param));
2911 if (isCallValid)
2912 {
2913 context->lightModelf(pname, param);
2914 }
2915 ANGLE_CAPTURE(LightModelf, isCallValid, context, pname, param);
2916 }
2917 else
2918 {
2919 GenerateContextLostErrorOnCurrentGlobalContext();
2920 }
2921 }
2922
GL_LightModelfv(GLenum pname,const GLfloat * params)2923 void GL_APIENTRY GL_LightModelfv(GLenum pname, const GLfloat *params)
2924 {
2925 Context *context = GetValidGlobalContext();
2926 EVENT(context, GLLightModelfv, "context = %d, pname = %s, params = 0x%016" PRIxPTR "",
2927 CID(context), GLenumToString(GLenumGroup::LightModelParameter, pname), (uintptr_t)params);
2928
2929 if (context)
2930 {
2931 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2932 bool isCallValid =
2933 (context->skipValidation() || ValidateLightModelfv(context, pname, params));
2934 if (isCallValid)
2935 {
2936 context->lightModelfv(pname, params);
2937 }
2938 ANGLE_CAPTURE(LightModelfv, isCallValid, context, pname, params);
2939 }
2940 else
2941 {
2942 GenerateContextLostErrorOnCurrentGlobalContext();
2943 }
2944 }
2945
GL_LightModeli(GLenum pname,GLint param)2946 void GL_APIENTRY GL_LightModeli(GLenum pname, GLint param)
2947 {
2948 Context *context = GetValidGlobalContext();
2949 EVENT(context, GLLightModeli, "context = %d, pname = %s, param = %d", CID(context),
2950 GLenumToString(GLenumGroup::LightModelParameter, pname), param);
2951
2952 if (context)
2953 {
2954 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2955 bool isCallValid =
2956 (context->skipValidation() || ValidateLightModeli(context, pname, param));
2957 if (isCallValid)
2958 {
2959 context->lightModeli(pname, param);
2960 }
2961 ANGLE_CAPTURE(LightModeli, isCallValid, context, pname, param);
2962 }
2963 else
2964 {
2965 GenerateContextLostErrorOnCurrentGlobalContext();
2966 }
2967 }
2968
GL_LightModeliv(GLenum pname,const GLint * params)2969 void GL_APIENTRY GL_LightModeliv(GLenum pname, const GLint *params)
2970 {
2971 Context *context = GetValidGlobalContext();
2972 EVENT(context, GLLightModeliv, "context = %d, pname = %s, params = 0x%016" PRIxPTR "",
2973 CID(context), GLenumToString(GLenumGroup::LightModelParameter, pname), (uintptr_t)params);
2974
2975 if (context)
2976 {
2977 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2978 bool isCallValid =
2979 (context->skipValidation() || ValidateLightModeliv(context, pname, params));
2980 if (isCallValid)
2981 {
2982 context->lightModeliv(pname, params);
2983 }
2984 ANGLE_CAPTURE(LightModeliv, isCallValid, context, pname, params);
2985 }
2986 else
2987 {
2988 GenerateContextLostErrorOnCurrentGlobalContext();
2989 }
2990 }
2991
GL_Lightf(GLenum light,GLenum pname,GLfloat param)2992 void GL_APIENTRY GL_Lightf(GLenum light, GLenum pname, GLfloat param)
2993 {
2994 Context *context = GetValidGlobalContext();
2995 EVENT(context, GLLightf, "context = %d, light = %s, pname = %s, param = %f", CID(context),
2996 GLenumToString(GLenumGroup::LightName, light),
2997 GLenumToString(GLenumGroup::LightParameter, pname), param);
2998
2999 if (context)
3000 {
3001 LightParameter pnamePacked = PackParam<LightParameter>(pname);
3002 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3003 bool isCallValid =
3004 (context->skipValidation() || ValidateLightf(context, light, pnamePacked, param));
3005 if (isCallValid)
3006 {
3007 context->lightf(light, pnamePacked, param);
3008 }
3009 ANGLE_CAPTURE(Lightf, isCallValid, context, light, pnamePacked, param);
3010 }
3011 else
3012 {
3013 GenerateContextLostErrorOnCurrentGlobalContext();
3014 }
3015 }
3016
GL_Lightfv(GLenum light,GLenum pname,const GLfloat * params)3017 void GL_APIENTRY GL_Lightfv(GLenum light, GLenum pname, const GLfloat *params)
3018 {
3019 Context *context = GetValidGlobalContext();
3020 EVENT(context, GLLightfv, "context = %d, light = %s, pname = %s, params = 0x%016" PRIxPTR "",
3021 CID(context), GLenumToString(GLenumGroup::LightName, light),
3022 GLenumToString(GLenumGroup::LightParameter, pname), (uintptr_t)params);
3023
3024 if (context)
3025 {
3026 LightParameter pnamePacked = PackParam<LightParameter>(pname);
3027 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3028 bool isCallValid =
3029 (context->skipValidation() || ValidateLightfv(context, light, pnamePacked, params));
3030 if (isCallValid)
3031 {
3032 context->lightfv(light, pnamePacked, params);
3033 }
3034 ANGLE_CAPTURE(Lightfv, isCallValid, context, light, pnamePacked, params);
3035 }
3036 else
3037 {
3038 GenerateContextLostErrorOnCurrentGlobalContext();
3039 }
3040 }
3041
GL_Lighti(GLenum light,GLenum pname,GLint param)3042 void GL_APIENTRY GL_Lighti(GLenum light, GLenum pname, GLint param)
3043 {
3044 Context *context = GetValidGlobalContext();
3045 EVENT(context, GLLighti, "context = %d, light = %s, pname = %s, param = %d", CID(context),
3046 GLenumToString(GLenumGroup::LightName, light),
3047 GLenumToString(GLenumGroup::LightParameter, pname), param);
3048
3049 if (context)
3050 {
3051 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3052 bool isCallValid =
3053 (context->skipValidation() || ValidateLighti(context, light, pname, param));
3054 if (isCallValid)
3055 {
3056 context->lighti(light, pname, param);
3057 }
3058 ANGLE_CAPTURE(Lighti, isCallValid, context, light, pname, param);
3059 }
3060 else
3061 {
3062 GenerateContextLostErrorOnCurrentGlobalContext();
3063 }
3064 }
3065
GL_Lightiv(GLenum light,GLenum pname,const GLint * params)3066 void GL_APIENTRY GL_Lightiv(GLenum light, GLenum pname, const GLint *params)
3067 {
3068 Context *context = GetValidGlobalContext();
3069 EVENT(context, GLLightiv, "context = %d, light = %s, pname = %s, params = 0x%016" PRIxPTR "",
3070 CID(context), GLenumToString(GLenumGroup::LightName, light),
3071 GLenumToString(GLenumGroup::LightParameter, pname), (uintptr_t)params);
3072
3073 if (context)
3074 {
3075 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3076 bool isCallValid =
3077 (context->skipValidation() || ValidateLightiv(context, light, pname, params));
3078 if (isCallValid)
3079 {
3080 context->lightiv(light, pname, params);
3081 }
3082 ANGLE_CAPTURE(Lightiv, isCallValid, context, light, pname, params);
3083 }
3084 else
3085 {
3086 GenerateContextLostErrorOnCurrentGlobalContext();
3087 }
3088 }
3089
GL_LineStipple(GLint factor,GLushort pattern)3090 void GL_APIENTRY GL_LineStipple(GLint factor, GLushort pattern)
3091 {
3092 Context *context = GetValidGlobalContext();
3093 EVENT(context, GLLineStipple, "context = %d, factor = %d, pattern = %u", CID(context), factor,
3094 pattern);
3095
3096 if (context)
3097 {
3098 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3099 bool isCallValid =
3100 (context->skipValidation() || ValidateLineStipple(context, factor, pattern));
3101 if (isCallValid)
3102 {
3103 context->lineStipple(factor, pattern);
3104 }
3105 ANGLE_CAPTURE(LineStipple, isCallValid, context, factor, pattern);
3106 }
3107 else
3108 {
3109 GenerateContextLostErrorOnCurrentGlobalContext();
3110 }
3111 }
3112
GL_LineWidth(GLfloat width)3113 void GL_APIENTRY GL_LineWidth(GLfloat width)
3114 {
3115 Context *context = GetValidGlobalContext();
3116 EVENT(context, GLLineWidth, "context = %d, width = %f", CID(context), width);
3117
3118 if (context)
3119 {
3120 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3121 bool isCallValid = (context->skipValidation() || ValidateLineWidth(context, width));
3122 if (isCallValid)
3123 {
3124 context->lineWidth(width);
3125 }
3126 ANGLE_CAPTURE(LineWidth, isCallValid, context, width);
3127 }
3128 else
3129 {
3130 GenerateContextLostErrorOnCurrentGlobalContext();
3131 }
3132 }
3133
GL_ListBase(GLuint base)3134 void GL_APIENTRY GL_ListBase(GLuint base)
3135 {
3136 Context *context = GetValidGlobalContext();
3137 EVENT(context, GLListBase, "context = %d, base = %u", CID(context), base);
3138
3139 if (context)
3140 {
3141 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3142 bool isCallValid = (context->skipValidation() || ValidateListBase(context, base));
3143 if (isCallValid)
3144 {
3145 context->listBase(base);
3146 }
3147 ANGLE_CAPTURE(ListBase, isCallValid, context, base);
3148 }
3149 else
3150 {
3151 GenerateContextLostErrorOnCurrentGlobalContext();
3152 }
3153 }
3154
GL_LoadIdentity()3155 void GL_APIENTRY GL_LoadIdentity()
3156 {
3157 Context *context = GetValidGlobalContext();
3158 EVENT(context, GLLoadIdentity, "context = %d", CID(context));
3159
3160 if (context)
3161 {
3162 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3163 bool isCallValid = (context->skipValidation() || ValidateLoadIdentity(context));
3164 if (isCallValid)
3165 {
3166 context->loadIdentity();
3167 }
3168 ANGLE_CAPTURE(LoadIdentity, isCallValid, context);
3169 }
3170 else
3171 {
3172 GenerateContextLostErrorOnCurrentGlobalContext();
3173 }
3174 }
3175
GL_LoadMatrixd(const GLdouble * m)3176 void GL_APIENTRY GL_LoadMatrixd(const GLdouble *m)
3177 {
3178 Context *context = GetValidGlobalContext();
3179 EVENT(context, GLLoadMatrixd, "context = %d, m = 0x%016" PRIxPTR "", CID(context),
3180 (uintptr_t)m);
3181
3182 if (context)
3183 {
3184 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3185 bool isCallValid = (context->skipValidation() || ValidateLoadMatrixd(context, m));
3186 if (isCallValid)
3187 {
3188 context->loadMatrixd(m);
3189 }
3190 ANGLE_CAPTURE(LoadMatrixd, isCallValid, context, m);
3191 }
3192 else
3193 {
3194 GenerateContextLostErrorOnCurrentGlobalContext();
3195 }
3196 }
3197
GL_LoadMatrixf(const GLfloat * m)3198 void GL_APIENTRY GL_LoadMatrixf(const GLfloat *m)
3199 {
3200 Context *context = GetValidGlobalContext();
3201 EVENT(context, GLLoadMatrixf, "context = %d, m = 0x%016" PRIxPTR "", CID(context),
3202 (uintptr_t)m);
3203
3204 if (context)
3205 {
3206 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3207 bool isCallValid = (context->skipValidation() || ValidateLoadMatrixf(context, m));
3208 if (isCallValid)
3209 {
3210 context->loadMatrixf(m);
3211 }
3212 ANGLE_CAPTURE(LoadMatrixf, isCallValid, context, m);
3213 }
3214 else
3215 {
3216 GenerateContextLostErrorOnCurrentGlobalContext();
3217 }
3218 }
3219
GL_LoadName(GLuint name)3220 void GL_APIENTRY GL_LoadName(GLuint name)
3221 {
3222 Context *context = GetValidGlobalContext();
3223 EVENT(context, GLLoadName, "context = %d, name = %u", CID(context), name);
3224
3225 if (context)
3226 {
3227 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3228 bool isCallValid = (context->skipValidation() || ValidateLoadName(context, name));
3229 if (isCallValid)
3230 {
3231 context->loadName(name);
3232 }
3233 ANGLE_CAPTURE(LoadName, isCallValid, context, name);
3234 }
3235 else
3236 {
3237 GenerateContextLostErrorOnCurrentGlobalContext();
3238 }
3239 }
3240
GL_LogicOp(GLenum opcode)3241 void GL_APIENTRY GL_LogicOp(GLenum opcode)
3242 {
3243 Context *context = GetValidGlobalContext();
3244 EVENT(context, GLLogicOp, "context = %d, opcode = %s", CID(context),
3245 GLenumToString(GLenumGroup::LogicOp, opcode));
3246
3247 if (context)
3248 {
3249 LogicalOperation opcodePacked = PackParam<LogicalOperation>(opcode);
3250 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3251 bool isCallValid = (context->skipValidation() || ValidateLogicOp(context, opcodePacked));
3252 if (isCallValid)
3253 {
3254 context->logicOp(opcodePacked);
3255 }
3256 ANGLE_CAPTURE(LogicOp, isCallValid, context, opcodePacked);
3257 }
3258 else
3259 {
3260 GenerateContextLostErrorOnCurrentGlobalContext();
3261 }
3262 }
3263
3264 void GL_APIENTRY
GL_Map1d(GLenum target,GLdouble u1,GLdouble u2,GLint stride,GLint order,const GLdouble * points)3265 GL_Map1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points)
3266 {
3267 Context *context = GetValidGlobalContext();
3268 EVENT(context, GLMap1d,
3269 "context = %d, target = %s, u1 = %f, u2 = %f, stride = %d, order = %d, points = "
3270 "0x%016" PRIxPTR "",
3271 CID(context), GLenumToString(GLenumGroup::MapTarget, target), u1, u2, stride, order,
3272 (uintptr_t)points);
3273
3274 if (context)
3275 {
3276 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3277 bool isCallValid = (context->skipValidation() ||
3278 ValidateMap1d(context, target, u1, u2, stride, order, points));
3279 if (isCallValid)
3280 {
3281 context->map1d(target, u1, u2, stride, order, points);
3282 }
3283 ANGLE_CAPTURE(Map1d, isCallValid, context, target, u1, u2, stride, order, points);
3284 }
3285 else
3286 {
3287 GenerateContextLostErrorOnCurrentGlobalContext();
3288 }
3289 }
3290
3291 void GL_APIENTRY
GL_Map1f(GLenum target,GLfloat u1,GLfloat u2,GLint stride,GLint order,const GLfloat * points)3292 GL_Map1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points)
3293 {
3294 Context *context = GetValidGlobalContext();
3295 EVENT(context, GLMap1f,
3296 "context = %d, target = %s, u1 = %f, u2 = %f, stride = %d, order = %d, points = "
3297 "0x%016" PRIxPTR "",
3298 CID(context), GLenumToString(GLenumGroup::MapTarget, target), u1, u2, stride, order,
3299 (uintptr_t)points);
3300
3301 if (context)
3302 {
3303 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3304 bool isCallValid = (context->skipValidation() ||
3305 ValidateMap1f(context, target, u1, u2, stride, order, points));
3306 if (isCallValid)
3307 {
3308 context->map1f(target, u1, u2, stride, order, points);
3309 }
3310 ANGLE_CAPTURE(Map1f, isCallValid, context, target, u1, u2, stride, order, points);
3311 }
3312 else
3313 {
3314 GenerateContextLostErrorOnCurrentGlobalContext();
3315 }
3316 }
3317
GL_Map2d(GLenum target,GLdouble u1,GLdouble u2,GLint ustride,GLint uorder,GLdouble v1,GLdouble v2,GLint vstride,GLint vorder,const GLdouble * points)3318 void GL_APIENTRY GL_Map2d(GLenum target,
3319 GLdouble u1,
3320 GLdouble u2,
3321 GLint ustride,
3322 GLint uorder,
3323 GLdouble v1,
3324 GLdouble v2,
3325 GLint vstride,
3326 GLint vorder,
3327 const GLdouble *points)
3328 {
3329 Context *context = GetValidGlobalContext();
3330 EVENT(context, GLMap2d,
3331 "context = %d, target = %s, u1 = %f, u2 = %f, ustride = %d, uorder = %d, v1 = %f, v2 = "
3332 "%f, vstride = %d, vorder = %d, points = 0x%016" PRIxPTR "",
3333 CID(context), GLenumToString(GLenumGroup::MapTarget, target), u1, u2, ustride, uorder, v1,
3334 v2, vstride, vorder, (uintptr_t)points);
3335
3336 if (context)
3337 {
3338 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3339 bool isCallValid =
3340 (context->skipValidation() || ValidateMap2d(context, target, u1, u2, ustride, uorder,
3341 v1, v2, vstride, vorder, points));
3342 if (isCallValid)
3343 {
3344 context->map2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
3345 }
3346 ANGLE_CAPTURE(Map2d, isCallValid, context, target, u1, u2, ustride, uorder, v1, v2, vstride,
3347 vorder, points);
3348 }
3349 else
3350 {
3351 GenerateContextLostErrorOnCurrentGlobalContext();
3352 }
3353 }
3354
GL_Map2f(GLenum target,GLfloat u1,GLfloat u2,GLint ustride,GLint uorder,GLfloat v1,GLfloat v2,GLint vstride,GLint vorder,const GLfloat * points)3355 void GL_APIENTRY GL_Map2f(GLenum target,
3356 GLfloat u1,
3357 GLfloat u2,
3358 GLint ustride,
3359 GLint uorder,
3360 GLfloat v1,
3361 GLfloat v2,
3362 GLint vstride,
3363 GLint vorder,
3364 const GLfloat *points)
3365 {
3366 Context *context = GetValidGlobalContext();
3367 EVENT(context, GLMap2f,
3368 "context = %d, target = %s, u1 = %f, u2 = %f, ustride = %d, uorder = %d, v1 = %f, v2 = "
3369 "%f, vstride = %d, vorder = %d, points = 0x%016" PRIxPTR "",
3370 CID(context), GLenumToString(GLenumGroup::MapTarget, target), u1, u2, ustride, uorder, v1,
3371 v2, vstride, vorder, (uintptr_t)points);
3372
3373 if (context)
3374 {
3375 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3376 bool isCallValid =
3377 (context->skipValidation() || ValidateMap2f(context, target, u1, u2, ustride, uorder,
3378 v1, v2, vstride, vorder, points));
3379 if (isCallValid)
3380 {
3381 context->map2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
3382 }
3383 ANGLE_CAPTURE(Map2f, isCallValid, context, target, u1, u2, ustride, uorder, v1, v2, vstride,
3384 vorder, points);
3385 }
3386 else
3387 {
3388 GenerateContextLostErrorOnCurrentGlobalContext();
3389 }
3390 }
3391
GL_MapGrid1d(GLint un,GLdouble u1,GLdouble u2)3392 void GL_APIENTRY GL_MapGrid1d(GLint un, GLdouble u1, GLdouble u2)
3393 {
3394 Context *context = GetValidGlobalContext();
3395 EVENT(context, GLMapGrid1d, "context = %d, un = %d, u1 = %f, u2 = %f", CID(context), un, u1,
3396 u2);
3397
3398 if (context)
3399 {
3400 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3401 bool isCallValid = (context->skipValidation() || ValidateMapGrid1d(context, un, u1, u2));
3402 if (isCallValid)
3403 {
3404 context->mapGrid1d(un, u1, u2);
3405 }
3406 ANGLE_CAPTURE(MapGrid1d, isCallValid, context, un, u1, u2);
3407 }
3408 else
3409 {
3410 GenerateContextLostErrorOnCurrentGlobalContext();
3411 }
3412 }
3413
GL_MapGrid1f(GLint un,GLfloat u1,GLfloat u2)3414 void GL_APIENTRY GL_MapGrid1f(GLint un, GLfloat u1, GLfloat u2)
3415 {
3416 Context *context = GetValidGlobalContext();
3417 EVENT(context, GLMapGrid1f, "context = %d, un = %d, u1 = %f, u2 = %f", CID(context), un, u1,
3418 u2);
3419
3420 if (context)
3421 {
3422 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3423 bool isCallValid = (context->skipValidation() || ValidateMapGrid1f(context, un, u1, u2));
3424 if (isCallValid)
3425 {
3426 context->mapGrid1f(un, u1, u2);
3427 }
3428 ANGLE_CAPTURE(MapGrid1f, isCallValid, context, un, u1, u2);
3429 }
3430 else
3431 {
3432 GenerateContextLostErrorOnCurrentGlobalContext();
3433 }
3434 }
3435
3436 void GL_APIENTRY
GL_MapGrid2d(GLint un,GLdouble u1,GLdouble u2,GLint vn,GLdouble v1,GLdouble v2)3437 GL_MapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
3438 {
3439 Context *context = GetValidGlobalContext();
3440 EVENT(context, GLMapGrid2d,
3441 "context = %d, un = %d, u1 = %f, u2 = %f, vn = %d, v1 = %f, v2 = %f", CID(context), un,
3442 u1, u2, vn, v1, v2);
3443
3444 if (context)
3445 {
3446 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3447 bool isCallValid =
3448 (context->skipValidation() || ValidateMapGrid2d(context, un, u1, u2, vn, v1, v2));
3449 if (isCallValid)
3450 {
3451 context->mapGrid2d(un, u1, u2, vn, v1, v2);
3452 }
3453 ANGLE_CAPTURE(MapGrid2d, isCallValid, context, un, u1, u2, vn, v1, v2);
3454 }
3455 else
3456 {
3457 GenerateContextLostErrorOnCurrentGlobalContext();
3458 }
3459 }
3460
GL_MapGrid2f(GLint un,GLfloat u1,GLfloat u2,GLint vn,GLfloat v1,GLfloat v2)3461 void GL_APIENTRY GL_MapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
3462 {
3463 Context *context = GetValidGlobalContext();
3464 EVENT(context, GLMapGrid2f,
3465 "context = %d, un = %d, u1 = %f, u2 = %f, vn = %d, v1 = %f, v2 = %f", CID(context), un,
3466 u1, u2, vn, v1, v2);
3467
3468 if (context)
3469 {
3470 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3471 bool isCallValid =
3472 (context->skipValidation() || ValidateMapGrid2f(context, un, u1, u2, vn, v1, v2));
3473 if (isCallValid)
3474 {
3475 context->mapGrid2f(un, u1, u2, vn, v1, v2);
3476 }
3477 ANGLE_CAPTURE(MapGrid2f, isCallValid, context, un, u1, u2, vn, v1, v2);
3478 }
3479 else
3480 {
3481 GenerateContextLostErrorOnCurrentGlobalContext();
3482 }
3483 }
3484
GL_Materialf(GLenum face,GLenum pname,GLfloat param)3485 void GL_APIENTRY GL_Materialf(GLenum face, GLenum pname, GLfloat param)
3486 {
3487 Context *context = GetValidGlobalContext();
3488 EVENT(context, GLMaterialf, "context = %d, face = %s, pname = %s, param = %f", CID(context),
3489 GLenumToString(GLenumGroup::MaterialFace, face),
3490 GLenumToString(GLenumGroup::MaterialParameter, pname), param);
3491
3492 if (context)
3493 {
3494 MaterialParameter pnamePacked = PackParam<MaterialParameter>(pname);
3495 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3496 bool isCallValid =
3497 (context->skipValidation() || ValidateMaterialf(context, face, pnamePacked, param));
3498 if (isCallValid)
3499 {
3500 context->materialf(face, pnamePacked, param);
3501 }
3502 ANGLE_CAPTURE(Materialf, isCallValid, context, face, pnamePacked, param);
3503 }
3504 else
3505 {
3506 GenerateContextLostErrorOnCurrentGlobalContext();
3507 }
3508 }
3509
GL_Materialfv(GLenum face,GLenum pname,const GLfloat * params)3510 void GL_APIENTRY GL_Materialfv(GLenum face, GLenum pname, const GLfloat *params)
3511 {
3512 Context *context = GetValidGlobalContext();
3513 EVENT(context, GLMaterialfv, "context = %d, face = %s, pname = %s, params = 0x%016" PRIxPTR "",
3514 CID(context), GLenumToString(GLenumGroup::MaterialFace, face),
3515 GLenumToString(GLenumGroup::MaterialParameter, pname), (uintptr_t)params);
3516
3517 if (context)
3518 {
3519 MaterialParameter pnamePacked = PackParam<MaterialParameter>(pname);
3520 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3521 bool isCallValid =
3522 (context->skipValidation() || ValidateMaterialfv(context, face, pnamePacked, params));
3523 if (isCallValid)
3524 {
3525 context->materialfv(face, pnamePacked, params);
3526 }
3527 ANGLE_CAPTURE(Materialfv, isCallValid, context, face, pnamePacked, params);
3528 }
3529 else
3530 {
3531 GenerateContextLostErrorOnCurrentGlobalContext();
3532 }
3533 }
3534
GL_Materiali(GLenum face,GLenum pname,GLint param)3535 void GL_APIENTRY GL_Materiali(GLenum face, GLenum pname, GLint param)
3536 {
3537 Context *context = GetValidGlobalContext();
3538 EVENT(context, GLMateriali, "context = %d, face = %s, pname = %s, param = %d", CID(context),
3539 GLenumToString(GLenumGroup::MaterialFace, face),
3540 GLenumToString(GLenumGroup::MaterialParameter, pname), param);
3541
3542 if (context)
3543 {
3544 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3545 bool isCallValid =
3546 (context->skipValidation() || ValidateMateriali(context, face, pname, param));
3547 if (isCallValid)
3548 {
3549 context->materiali(face, pname, param);
3550 }
3551 ANGLE_CAPTURE(Materiali, isCallValid, context, face, pname, param);
3552 }
3553 else
3554 {
3555 GenerateContextLostErrorOnCurrentGlobalContext();
3556 }
3557 }
3558
GL_Materialiv(GLenum face,GLenum pname,const GLint * params)3559 void GL_APIENTRY GL_Materialiv(GLenum face, GLenum pname, const GLint *params)
3560 {
3561 Context *context = GetValidGlobalContext();
3562 EVENT(context, GLMaterialiv, "context = %d, face = %s, pname = %s, params = 0x%016" PRIxPTR "",
3563 CID(context), GLenumToString(GLenumGroup::MaterialFace, face),
3564 GLenumToString(GLenumGroup::MaterialParameter, pname), (uintptr_t)params);
3565
3566 if (context)
3567 {
3568 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3569 bool isCallValid =
3570 (context->skipValidation() || ValidateMaterialiv(context, face, pname, params));
3571 if (isCallValid)
3572 {
3573 context->materialiv(face, pname, params);
3574 }
3575 ANGLE_CAPTURE(Materialiv, isCallValid, context, face, pname, params);
3576 }
3577 else
3578 {
3579 GenerateContextLostErrorOnCurrentGlobalContext();
3580 }
3581 }
3582
GL_MatrixMode(GLenum mode)3583 void GL_APIENTRY GL_MatrixMode(GLenum mode)
3584 {
3585 Context *context = GetValidGlobalContext();
3586 EVENT(context, GLMatrixMode, "context = %d, mode = %s", CID(context),
3587 GLenumToString(GLenumGroup::MatrixMode, mode));
3588
3589 if (context)
3590 {
3591 MatrixType modePacked = PackParam<MatrixType>(mode);
3592 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3593 bool isCallValid = (context->skipValidation() || ValidateMatrixMode(context, modePacked));
3594 if (isCallValid)
3595 {
3596 context->matrixMode(modePacked);
3597 }
3598 ANGLE_CAPTURE(MatrixMode, isCallValid, context, modePacked);
3599 }
3600 else
3601 {
3602 GenerateContextLostErrorOnCurrentGlobalContext();
3603 }
3604 }
3605
GL_MultMatrixd(const GLdouble * m)3606 void GL_APIENTRY GL_MultMatrixd(const GLdouble *m)
3607 {
3608 Context *context = GetValidGlobalContext();
3609 EVENT(context, GLMultMatrixd, "context = %d, m = 0x%016" PRIxPTR "", CID(context),
3610 (uintptr_t)m);
3611
3612 if (context)
3613 {
3614 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3615 bool isCallValid = (context->skipValidation() || ValidateMultMatrixd(context, m));
3616 if (isCallValid)
3617 {
3618 context->multMatrixd(m);
3619 }
3620 ANGLE_CAPTURE(MultMatrixd, isCallValid, context, m);
3621 }
3622 else
3623 {
3624 GenerateContextLostErrorOnCurrentGlobalContext();
3625 }
3626 }
3627
GL_MultMatrixf(const GLfloat * m)3628 void GL_APIENTRY GL_MultMatrixf(const GLfloat *m)
3629 {
3630 Context *context = GetValidGlobalContext();
3631 EVENT(context, GLMultMatrixf, "context = %d, m = 0x%016" PRIxPTR "", CID(context),
3632 (uintptr_t)m);
3633
3634 if (context)
3635 {
3636 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3637 bool isCallValid = (context->skipValidation() || ValidateMultMatrixf(context, m));
3638 if (isCallValid)
3639 {
3640 context->multMatrixf(m);
3641 }
3642 ANGLE_CAPTURE(MultMatrixf, isCallValid, context, m);
3643 }
3644 else
3645 {
3646 GenerateContextLostErrorOnCurrentGlobalContext();
3647 }
3648 }
3649
GL_NewList(GLuint list,GLenum mode)3650 void GL_APIENTRY GL_NewList(GLuint list, GLenum mode)
3651 {
3652 Context *context = GetValidGlobalContext();
3653 EVENT(context, GLNewList, "context = %d, list = %u, mode = %s", CID(context), list,
3654 GLenumToString(GLenumGroup::ListMode, mode));
3655
3656 if (context)
3657 {
3658 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3659 bool isCallValid = (context->skipValidation() || ValidateNewList(context, list, mode));
3660 if (isCallValid)
3661 {
3662 context->newList(list, mode);
3663 }
3664 ANGLE_CAPTURE(NewList, isCallValid, context, list, mode);
3665 }
3666 else
3667 {
3668 GenerateContextLostErrorOnCurrentGlobalContext();
3669 }
3670 }
3671
GL_Normal3b(GLbyte nx,GLbyte ny,GLbyte nz)3672 void GL_APIENTRY GL_Normal3b(GLbyte nx, GLbyte ny, GLbyte nz)
3673 {
3674 Context *context = GetValidGlobalContext();
3675 EVENT(context, GLNormal3b, "context = %d, nx = %d, ny = %d, nz = %d", CID(context), nx, ny, nz);
3676
3677 if (context)
3678 {
3679 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3680 bool isCallValid = (context->skipValidation() || ValidateNormal3b(context, nx, ny, nz));
3681 if (isCallValid)
3682 {
3683 context->normal3b(nx, ny, nz);
3684 }
3685 ANGLE_CAPTURE(Normal3b, isCallValid, context, nx, ny, nz);
3686 }
3687 else
3688 {
3689 GenerateContextLostErrorOnCurrentGlobalContext();
3690 }
3691 }
3692
GL_Normal3bv(const GLbyte * v)3693 void GL_APIENTRY GL_Normal3bv(const GLbyte *v)
3694 {
3695 Context *context = GetValidGlobalContext();
3696 EVENT(context, GLNormal3bv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
3697
3698 if (context)
3699 {
3700 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3701 bool isCallValid = (context->skipValidation() || ValidateNormal3bv(context, v));
3702 if (isCallValid)
3703 {
3704 context->normal3bv(v);
3705 }
3706 ANGLE_CAPTURE(Normal3bv, isCallValid, context, v);
3707 }
3708 else
3709 {
3710 GenerateContextLostErrorOnCurrentGlobalContext();
3711 }
3712 }
3713
GL_Normal3d(GLdouble nx,GLdouble ny,GLdouble nz)3714 void GL_APIENTRY GL_Normal3d(GLdouble nx, GLdouble ny, GLdouble nz)
3715 {
3716 Context *context = GetValidGlobalContext();
3717 EVENT(context, GLNormal3d, "context = %d, nx = %f, ny = %f, nz = %f", CID(context), nx, ny, nz);
3718
3719 if (context)
3720 {
3721 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3722 bool isCallValid = (context->skipValidation() || ValidateNormal3d(context, nx, ny, nz));
3723 if (isCallValid)
3724 {
3725 context->normal3d(nx, ny, nz);
3726 }
3727 ANGLE_CAPTURE(Normal3d, isCallValid, context, nx, ny, nz);
3728 }
3729 else
3730 {
3731 GenerateContextLostErrorOnCurrentGlobalContext();
3732 }
3733 }
3734
GL_Normal3dv(const GLdouble * v)3735 void GL_APIENTRY GL_Normal3dv(const GLdouble *v)
3736 {
3737 Context *context = GetValidGlobalContext();
3738 EVENT(context, GLNormal3dv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
3739
3740 if (context)
3741 {
3742 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3743 bool isCallValid = (context->skipValidation() || ValidateNormal3dv(context, v));
3744 if (isCallValid)
3745 {
3746 context->normal3dv(v);
3747 }
3748 ANGLE_CAPTURE(Normal3dv, isCallValid, context, v);
3749 }
3750 else
3751 {
3752 GenerateContextLostErrorOnCurrentGlobalContext();
3753 }
3754 }
3755
GL_Normal3f(GLfloat nx,GLfloat ny,GLfloat nz)3756 void GL_APIENTRY GL_Normal3f(GLfloat nx, GLfloat ny, GLfloat nz)
3757 {
3758 Context *context = GetValidGlobalContext();
3759 EVENT(context, GLNormal3f, "context = %d, nx = %f, ny = %f, nz = %f", CID(context), nx, ny, nz);
3760
3761 if (context)
3762 {
3763 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3764 bool isCallValid = (context->skipValidation() || ValidateNormal3f(context, nx, ny, nz));
3765 if (isCallValid)
3766 {
3767 context->normal3f(nx, ny, nz);
3768 }
3769 ANGLE_CAPTURE(Normal3f, isCallValid, context, nx, ny, nz);
3770 }
3771 else
3772 {
3773 GenerateContextLostErrorOnCurrentGlobalContext();
3774 }
3775 }
3776
GL_Normal3fv(const GLfloat * v)3777 void GL_APIENTRY GL_Normal3fv(const GLfloat *v)
3778 {
3779 Context *context = GetValidGlobalContext();
3780 EVENT(context, GLNormal3fv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
3781
3782 if (context)
3783 {
3784 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3785 bool isCallValid = (context->skipValidation() || ValidateNormal3fv(context, v));
3786 if (isCallValid)
3787 {
3788 context->normal3fv(v);
3789 }
3790 ANGLE_CAPTURE(Normal3fv, isCallValid, context, v);
3791 }
3792 else
3793 {
3794 GenerateContextLostErrorOnCurrentGlobalContext();
3795 }
3796 }
3797
GL_Normal3i(GLint nx,GLint ny,GLint nz)3798 void GL_APIENTRY GL_Normal3i(GLint nx, GLint ny, GLint nz)
3799 {
3800 Context *context = GetValidGlobalContext();
3801 EVENT(context, GLNormal3i, "context = %d, nx = %d, ny = %d, nz = %d", CID(context), nx, ny, nz);
3802
3803 if (context)
3804 {
3805 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3806 bool isCallValid = (context->skipValidation() || ValidateNormal3i(context, nx, ny, nz));
3807 if (isCallValid)
3808 {
3809 context->normal3i(nx, ny, nz);
3810 }
3811 ANGLE_CAPTURE(Normal3i, isCallValid, context, nx, ny, nz);
3812 }
3813 else
3814 {
3815 GenerateContextLostErrorOnCurrentGlobalContext();
3816 }
3817 }
3818
GL_Normal3iv(const GLint * v)3819 void GL_APIENTRY GL_Normal3iv(const GLint *v)
3820 {
3821 Context *context = GetValidGlobalContext();
3822 EVENT(context, GLNormal3iv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
3823
3824 if (context)
3825 {
3826 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3827 bool isCallValid = (context->skipValidation() || ValidateNormal3iv(context, v));
3828 if (isCallValid)
3829 {
3830 context->normal3iv(v);
3831 }
3832 ANGLE_CAPTURE(Normal3iv, isCallValid, context, v);
3833 }
3834 else
3835 {
3836 GenerateContextLostErrorOnCurrentGlobalContext();
3837 }
3838 }
3839
GL_Normal3s(GLshort nx,GLshort ny,GLshort nz)3840 void GL_APIENTRY GL_Normal3s(GLshort nx, GLshort ny, GLshort nz)
3841 {
3842 Context *context = GetValidGlobalContext();
3843 EVENT(context, GLNormal3s, "context = %d, nx = %d, ny = %d, nz = %d", CID(context), nx, ny, nz);
3844
3845 if (context)
3846 {
3847 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3848 bool isCallValid = (context->skipValidation() || ValidateNormal3s(context, nx, ny, nz));
3849 if (isCallValid)
3850 {
3851 context->normal3s(nx, ny, nz);
3852 }
3853 ANGLE_CAPTURE(Normal3s, isCallValid, context, nx, ny, nz);
3854 }
3855 else
3856 {
3857 GenerateContextLostErrorOnCurrentGlobalContext();
3858 }
3859 }
3860
GL_Normal3sv(const GLshort * v)3861 void GL_APIENTRY GL_Normal3sv(const GLshort *v)
3862 {
3863 Context *context = GetValidGlobalContext();
3864 EVENT(context, GLNormal3sv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
3865
3866 if (context)
3867 {
3868 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3869 bool isCallValid = (context->skipValidation() || ValidateNormal3sv(context, v));
3870 if (isCallValid)
3871 {
3872 context->normal3sv(v);
3873 }
3874 ANGLE_CAPTURE(Normal3sv, isCallValid, context, v);
3875 }
3876 else
3877 {
3878 GenerateContextLostErrorOnCurrentGlobalContext();
3879 }
3880 }
3881
GL_Ortho(GLdouble left,GLdouble right,GLdouble bottom,GLdouble top,GLdouble zNear,GLdouble zFar)3882 void GL_APIENTRY GL_Ortho(GLdouble left,
3883 GLdouble right,
3884 GLdouble bottom,
3885 GLdouble top,
3886 GLdouble zNear,
3887 GLdouble zFar)
3888 {
3889 Context *context = GetValidGlobalContext();
3890 EVENT(context, GLOrtho,
3891 "context = %d, left = %f, right = %f, bottom = %f, top = %f, zNear = %f, zFar = %f",
3892 CID(context), left, right, bottom, top, zNear, zFar);
3893
3894 if (context)
3895 {
3896 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3897 bool isCallValid = (context->skipValidation() ||
3898 ValidateOrtho(context, left, right, bottom, top, zNear, zFar));
3899 if (isCallValid)
3900 {
3901 context->ortho(left, right, bottom, top, zNear, zFar);
3902 }
3903 ANGLE_CAPTURE(Ortho, isCallValid, context, left, right, bottom, top, zNear, zFar);
3904 }
3905 else
3906 {
3907 GenerateContextLostErrorOnCurrentGlobalContext();
3908 }
3909 }
3910
GL_PassThrough(GLfloat token)3911 void GL_APIENTRY GL_PassThrough(GLfloat token)
3912 {
3913 Context *context = GetValidGlobalContext();
3914 EVENT(context, GLPassThrough, "context = %d, token = %f", CID(context), token);
3915
3916 if (context)
3917 {
3918 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3919 bool isCallValid = (context->skipValidation() || ValidatePassThrough(context, token));
3920 if (isCallValid)
3921 {
3922 context->passThrough(token);
3923 }
3924 ANGLE_CAPTURE(PassThrough, isCallValid, context, token);
3925 }
3926 else
3927 {
3928 GenerateContextLostErrorOnCurrentGlobalContext();
3929 }
3930 }
3931
GL_PixelMapfv(GLenum map,GLsizei mapsize,const GLfloat * values)3932 void GL_APIENTRY GL_PixelMapfv(GLenum map, GLsizei mapsize, const GLfloat *values)
3933 {
3934 Context *context = GetValidGlobalContext();
3935 EVENT(context, GLPixelMapfv, "context = %d, map = %s, mapsize = %d, values = 0x%016" PRIxPTR "",
3936 CID(context), GLenumToString(GLenumGroup::PixelMap, map), mapsize, (uintptr_t)values);
3937
3938 if (context)
3939 {
3940 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3941 bool isCallValid =
3942 (context->skipValidation() || ValidatePixelMapfv(context, map, mapsize, values));
3943 if (isCallValid)
3944 {
3945 context->pixelMapfv(map, mapsize, values);
3946 }
3947 ANGLE_CAPTURE(PixelMapfv, isCallValid, context, map, mapsize, values);
3948 }
3949 else
3950 {
3951 GenerateContextLostErrorOnCurrentGlobalContext();
3952 }
3953 }
3954
GL_PixelMapuiv(GLenum map,GLsizei mapsize,const GLuint * values)3955 void GL_APIENTRY GL_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values)
3956 {
3957 Context *context = GetValidGlobalContext();
3958 EVENT(context, GLPixelMapuiv,
3959 "context = %d, map = %s, mapsize = %d, values = 0x%016" PRIxPTR "", CID(context),
3960 GLenumToString(GLenumGroup::PixelMap, map), mapsize, (uintptr_t)values);
3961
3962 if (context)
3963 {
3964 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3965 bool isCallValid =
3966 (context->skipValidation() || ValidatePixelMapuiv(context, map, mapsize, values));
3967 if (isCallValid)
3968 {
3969 context->pixelMapuiv(map, mapsize, values);
3970 }
3971 ANGLE_CAPTURE(PixelMapuiv, isCallValid, context, map, mapsize, values);
3972 }
3973 else
3974 {
3975 GenerateContextLostErrorOnCurrentGlobalContext();
3976 }
3977 }
3978
GL_PixelMapusv(GLenum map,GLsizei mapsize,const GLushort * values)3979 void GL_APIENTRY GL_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values)
3980 {
3981 Context *context = GetValidGlobalContext();
3982 EVENT(context, GLPixelMapusv,
3983 "context = %d, map = %s, mapsize = %d, values = 0x%016" PRIxPTR "", CID(context),
3984 GLenumToString(GLenumGroup::PixelMap, map), mapsize, (uintptr_t)values);
3985
3986 if (context)
3987 {
3988 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
3989 bool isCallValid =
3990 (context->skipValidation() || ValidatePixelMapusv(context, map, mapsize, values));
3991 if (isCallValid)
3992 {
3993 context->pixelMapusv(map, mapsize, values);
3994 }
3995 ANGLE_CAPTURE(PixelMapusv, isCallValid, context, map, mapsize, values);
3996 }
3997 else
3998 {
3999 GenerateContextLostErrorOnCurrentGlobalContext();
4000 }
4001 }
4002
GL_PixelStoref(GLenum pname,GLfloat param)4003 void GL_APIENTRY GL_PixelStoref(GLenum pname, GLfloat param)
4004 {
4005 Context *context = GetValidGlobalContext();
4006 EVENT(context, GLPixelStoref, "context = %d, pname = %s, param = %f", CID(context),
4007 GLenumToString(GLenumGroup::PixelStoreParameter, pname), param);
4008
4009 if (context)
4010 {
4011 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4012 bool isCallValid =
4013 (context->skipValidation() || ValidatePixelStoref(context, pname, param));
4014 if (isCallValid)
4015 {
4016 context->pixelStoref(pname, param);
4017 }
4018 ANGLE_CAPTURE(PixelStoref, isCallValid, context, pname, param);
4019 }
4020 else
4021 {
4022 GenerateContextLostErrorOnCurrentGlobalContext();
4023 }
4024 }
4025
GL_PixelStorei(GLenum pname,GLint param)4026 void GL_APIENTRY GL_PixelStorei(GLenum pname, GLint param)
4027 {
4028 Context *context = GetValidGlobalContext();
4029 EVENT(context, GLPixelStorei, "context = %d, pname = %s, param = %d", CID(context),
4030 GLenumToString(GLenumGroup::PixelStoreParameter, pname), param);
4031
4032 if (context)
4033 {
4034 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4035 bool isCallValid =
4036 (context->skipValidation() || ValidatePixelStorei(context, pname, param));
4037 if (isCallValid)
4038 {
4039 context->pixelStorei(pname, param);
4040 }
4041 ANGLE_CAPTURE(PixelStorei, isCallValid, context, pname, param);
4042 }
4043 else
4044 {
4045 GenerateContextLostErrorOnCurrentGlobalContext();
4046 }
4047 }
4048
GL_PixelTransferf(GLenum pname,GLfloat param)4049 void GL_APIENTRY GL_PixelTransferf(GLenum pname, GLfloat param)
4050 {
4051 Context *context = GetValidGlobalContext();
4052 EVENT(context, GLPixelTransferf, "context = %d, pname = %s, param = %f", CID(context),
4053 GLenumToString(GLenumGroup::PixelTransferParameter, pname), param);
4054
4055 if (context)
4056 {
4057 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4058 bool isCallValid =
4059 (context->skipValidation() || ValidatePixelTransferf(context, pname, param));
4060 if (isCallValid)
4061 {
4062 context->pixelTransferf(pname, param);
4063 }
4064 ANGLE_CAPTURE(PixelTransferf, isCallValid, context, pname, param);
4065 }
4066 else
4067 {
4068 GenerateContextLostErrorOnCurrentGlobalContext();
4069 }
4070 }
4071
GL_PixelTransferi(GLenum pname,GLint param)4072 void GL_APIENTRY GL_PixelTransferi(GLenum pname, GLint param)
4073 {
4074 Context *context = GetValidGlobalContext();
4075 EVENT(context, GLPixelTransferi, "context = %d, pname = %s, param = %d", CID(context),
4076 GLenumToString(GLenumGroup::PixelTransferParameter, pname), param);
4077
4078 if (context)
4079 {
4080 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4081 bool isCallValid =
4082 (context->skipValidation() || ValidatePixelTransferi(context, pname, param));
4083 if (isCallValid)
4084 {
4085 context->pixelTransferi(pname, param);
4086 }
4087 ANGLE_CAPTURE(PixelTransferi, isCallValid, context, pname, param);
4088 }
4089 else
4090 {
4091 GenerateContextLostErrorOnCurrentGlobalContext();
4092 }
4093 }
4094
GL_PixelZoom(GLfloat xfactor,GLfloat yfactor)4095 void GL_APIENTRY GL_PixelZoom(GLfloat xfactor, GLfloat yfactor)
4096 {
4097 Context *context = GetValidGlobalContext();
4098 EVENT(context, GLPixelZoom, "context = %d, xfactor = %f, yfactor = %f", CID(context), xfactor,
4099 yfactor);
4100
4101 if (context)
4102 {
4103 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4104 bool isCallValid =
4105 (context->skipValidation() || ValidatePixelZoom(context, xfactor, yfactor));
4106 if (isCallValid)
4107 {
4108 context->pixelZoom(xfactor, yfactor);
4109 }
4110 ANGLE_CAPTURE(PixelZoom, isCallValid, context, xfactor, yfactor);
4111 }
4112 else
4113 {
4114 GenerateContextLostErrorOnCurrentGlobalContext();
4115 }
4116 }
4117
GL_PointSize(GLfloat size)4118 void GL_APIENTRY GL_PointSize(GLfloat size)
4119 {
4120 Context *context = GetValidGlobalContext();
4121 EVENT(context, GLPointSize, "context = %d, size = %f", CID(context), size);
4122
4123 if (context)
4124 {
4125 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4126 bool isCallValid = (context->skipValidation() || ValidatePointSize(context, size));
4127 if (isCallValid)
4128 {
4129 context->pointSize(size);
4130 }
4131 ANGLE_CAPTURE(PointSize, isCallValid, context, size);
4132 }
4133 else
4134 {
4135 GenerateContextLostErrorOnCurrentGlobalContext();
4136 }
4137 }
4138
GL_PolygonMode(GLenum face,GLenum mode)4139 void GL_APIENTRY GL_PolygonMode(GLenum face, GLenum mode)
4140 {
4141 Context *context = GetValidGlobalContext();
4142 EVENT(context, GLPolygonMode, "context = %d, face = %s, mode = %s", CID(context),
4143 GLenumToString(GLenumGroup::MaterialFace, face),
4144 GLenumToString(GLenumGroup::PolygonMode, mode));
4145
4146 if (context)
4147 {
4148 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4149 bool isCallValid = (context->skipValidation() || ValidatePolygonMode(context, face, mode));
4150 if (isCallValid)
4151 {
4152 context->polygonMode(face, mode);
4153 }
4154 ANGLE_CAPTURE(PolygonMode, isCallValid, context, face, mode);
4155 }
4156 else
4157 {
4158 GenerateContextLostErrorOnCurrentGlobalContext();
4159 }
4160 }
4161
GL_PolygonStipple(const GLubyte * mask)4162 void GL_APIENTRY GL_PolygonStipple(const GLubyte *mask)
4163 {
4164 Context *context = GetValidGlobalContext();
4165 EVENT(context, GLPolygonStipple, "context = %d, mask = 0x%016" PRIxPTR "", CID(context),
4166 (uintptr_t)mask);
4167
4168 if (context)
4169 {
4170 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4171 bool isCallValid = (context->skipValidation() || ValidatePolygonStipple(context, mask));
4172 if (isCallValid)
4173 {
4174 context->polygonStipple(mask);
4175 }
4176 ANGLE_CAPTURE(PolygonStipple, isCallValid, context, mask);
4177 }
4178 else
4179 {
4180 GenerateContextLostErrorOnCurrentGlobalContext();
4181 }
4182 }
4183
GL_PopAttrib()4184 void GL_APIENTRY GL_PopAttrib()
4185 {
4186 Context *context = GetValidGlobalContext();
4187 EVENT(context, GLPopAttrib, "context = %d", CID(context));
4188
4189 if (context)
4190 {
4191 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4192 bool isCallValid = (context->skipValidation() || ValidatePopAttrib(context));
4193 if (isCallValid)
4194 {
4195 context->popAttrib();
4196 }
4197 ANGLE_CAPTURE(PopAttrib, isCallValid, context);
4198 }
4199 else
4200 {
4201 GenerateContextLostErrorOnCurrentGlobalContext();
4202 }
4203 }
4204
GL_PopMatrix()4205 void GL_APIENTRY GL_PopMatrix()
4206 {
4207 Context *context = GetValidGlobalContext();
4208 EVENT(context, GLPopMatrix, "context = %d", CID(context));
4209
4210 if (context)
4211 {
4212 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4213 bool isCallValid = (context->skipValidation() || ValidatePopMatrix(context));
4214 if (isCallValid)
4215 {
4216 context->popMatrix();
4217 }
4218 ANGLE_CAPTURE(PopMatrix, isCallValid, context);
4219 }
4220 else
4221 {
4222 GenerateContextLostErrorOnCurrentGlobalContext();
4223 }
4224 }
4225
GL_PopName()4226 void GL_APIENTRY GL_PopName()
4227 {
4228 Context *context = GetValidGlobalContext();
4229 EVENT(context, GLPopName, "context = %d", CID(context));
4230
4231 if (context)
4232 {
4233 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4234 bool isCallValid = (context->skipValidation() || ValidatePopName(context));
4235 if (isCallValid)
4236 {
4237 context->popName();
4238 }
4239 ANGLE_CAPTURE(PopName, isCallValid, context);
4240 }
4241 else
4242 {
4243 GenerateContextLostErrorOnCurrentGlobalContext();
4244 }
4245 }
4246
GL_PushAttrib(GLbitfield mask)4247 void GL_APIENTRY GL_PushAttrib(GLbitfield mask)
4248 {
4249 Context *context = GetValidGlobalContext();
4250 EVENT(context, GLPushAttrib, "context = %d, mask = %s", CID(context),
4251 GLbitfieldToString(GLenumGroup::AttribMask, mask).c_str());
4252
4253 if (context)
4254 {
4255 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4256 bool isCallValid = (context->skipValidation() || ValidatePushAttrib(context, mask));
4257 if (isCallValid)
4258 {
4259 context->pushAttrib(mask);
4260 }
4261 ANGLE_CAPTURE(PushAttrib, isCallValid, context, mask);
4262 }
4263 else
4264 {
4265 GenerateContextLostErrorOnCurrentGlobalContext();
4266 }
4267 }
4268
GL_PushMatrix()4269 void GL_APIENTRY GL_PushMatrix()
4270 {
4271 Context *context = GetValidGlobalContext();
4272 EVENT(context, GLPushMatrix, "context = %d", CID(context));
4273
4274 if (context)
4275 {
4276 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4277 bool isCallValid = (context->skipValidation() || ValidatePushMatrix(context));
4278 if (isCallValid)
4279 {
4280 context->pushMatrix();
4281 }
4282 ANGLE_CAPTURE(PushMatrix, isCallValid, context);
4283 }
4284 else
4285 {
4286 GenerateContextLostErrorOnCurrentGlobalContext();
4287 }
4288 }
4289
GL_PushName(GLuint name)4290 void GL_APIENTRY GL_PushName(GLuint name)
4291 {
4292 Context *context = GetValidGlobalContext();
4293 EVENT(context, GLPushName, "context = %d, name = %u", CID(context), name);
4294
4295 if (context)
4296 {
4297 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4298 bool isCallValid = (context->skipValidation() || ValidatePushName(context, name));
4299 if (isCallValid)
4300 {
4301 context->pushName(name);
4302 }
4303 ANGLE_CAPTURE(PushName, isCallValid, context, name);
4304 }
4305 else
4306 {
4307 GenerateContextLostErrorOnCurrentGlobalContext();
4308 }
4309 }
4310
GL_RasterPos2d(GLdouble x,GLdouble y)4311 void GL_APIENTRY GL_RasterPos2d(GLdouble x, GLdouble y)
4312 {
4313 Context *context = GetValidGlobalContext();
4314 EVENT(context, GLRasterPos2d, "context = %d, x = %f, y = %f", CID(context), x, y);
4315
4316 if (context)
4317 {
4318 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4319 bool isCallValid = (context->skipValidation() || ValidateRasterPos2d(context, x, y));
4320 if (isCallValid)
4321 {
4322 context->rasterPos2d(x, y);
4323 }
4324 ANGLE_CAPTURE(RasterPos2d, isCallValid, context, x, y);
4325 }
4326 else
4327 {
4328 GenerateContextLostErrorOnCurrentGlobalContext();
4329 }
4330 }
4331
GL_RasterPos2dv(const GLdouble * v)4332 void GL_APIENTRY GL_RasterPos2dv(const GLdouble *v)
4333 {
4334 Context *context = GetValidGlobalContext();
4335 EVENT(context, GLRasterPos2dv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
4336 (uintptr_t)v);
4337
4338 if (context)
4339 {
4340 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4341 bool isCallValid = (context->skipValidation() || ValidateRasterPos2dv(context, v));
4342 if (isCallValid)
4343 {
4344 context->rasterPos2dv(v);
4345 }
4346 ANGLE_CAPTURE(RasterPos2dv, isCallValid, context, v);
4347 }
4348 else
4349 {
4350 GenerateContextLostErrorOnCurrentGlobalContext();
4351 }
4352 }
4353
GL_RasterPos2f(GLfloat x,GLfloat y)4354 void GL_APIENTRY GL_RasterPos2f(GLfloat x, GLfloat y)
4355 {
4356 Context *context = GetValidGlobalContext();
4357 EVENT(context, GLRasterPos2f, "context = %d, x = %f, y = %f", CID(context), x, y);
4358
4359 if (context)
4360 {
4361 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4362 bool isCallValid = (context->skipValidation() || ValidateRasterPos2f(context, x, y));
4363 if (isCallValid)
4364 {
4365 context->rasterPos2f(x, y);
4366 }
4367 ANGLE_CAPTURE(RasterPos2f, isCallValid, context, x, y);
4368 }
4369 else
4370 {
4371 GenerateContextLostErrorOnCurrentGlobalContext();
4372 }
4373 }
4374
GL_RasterPos2fv(const GLfloat * v)4375 void GL_APIENTRY GL_RasterPos2fv(const GLfloat *v)
4376 {
4377 Context *context = GetValidGlobalContext();
4378 EVENT(context, GLRasterPos2fv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
4379 (uintptr_t)v);
4380
4381 if (context)
4382 {
4383 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4384 bool isCallValid = (context->skipValidation() || ValidateRasterPos2fv(context, v));
4385 if (isCallValid)
4386 {
4387 context->rasterPos2fv(v);
4388 }
4389 ANGLE_CAPTURE(RasterPos2fv, isCallValid, context, v);
4390 }
4391 else
4392 {
4393 GenerateContextLostErrorOnCurrentGlobalContext();
4394 }
4395 }
4396
GL_RasterPos2i(GLint x,GLint y)4397 void GL_APIENTRY GL_RasterPos2i(GLint x, GLint y)
4398 {
4399 Context *context = GetValidGlobalContext();
4400 EVENT(context, GLRasterPos2i, "context = %d, x = %d, y = %d", CID(context), x, y);
4401
4402 if (context)
4403 {
4404 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4405 bool isCallValid = (context->skipValidation() || ValidateRasterPos2i(context, x, y));
4406 if (isCallValid)
4407 {
4408 context->rasterPos2i(x, y);
4409 }
4410 ANGLE_CAPTURE(RasterPos2i, isCallValid, context, x, y);
4411 }
4412 else
4413 {
4414 GenerateContextLostErrorOnCurrentGlobalContext();
4415 }
4416 }
4417
GL_RasterPos2iv(const GLint * v)4418 void GL_APIENTRY GL_RasterPos2iv(const GLint *v)
4419 {
4420 Context *context = GetValidGlobalContext();
4421 EVENT(context, GLRasterPos2iv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
4422 (uintptr_t)v);
4423
4424 if (context)
4425 {
4426 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4427 bool isCallValid = (context->skipValidation() || ValidateRasterPos2iv(context, v));
4428 if (isCallValid)
4429 {
4430 context->rasterPos2iv(v);
4431 }
4432 ANGLE_CAPTURE(RasterPos2iv, isCallValid, context, v);
4433 }
4434 else
4435 {
4436 GenerateContextLostErrorOnCurrentGlobalContext();
4437 }
4438 }
4439
GL_RasterPos2s(GLshort x,GLshort y)4440 void GL_APIENTRY GL_RasterPos2s(GLshort x, GLshort y)
4441 {
4442 Context *context = GetValidGlobalContext();
4443 EVENT(context, GLRasterPos2s, "context = %d, x = %d, y = %d", CID(context), x, y);
4444
4445 if (context)
4446 {
4447 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4448 bool isCallValid = (context->skipValidation() || ValidateRasterPos2s(context, x, y));
4449 if (isCallValid)
4450 {
4451 context->rasterPos2s(x, y);
4452 }
4453 ANGLE_CAPTURE(RasterPos2s, isCallValid, context, x, y);
4454 }
4455 else
4456 {
4457 GenerateContextLostErrorOnCurrentGlobalContext();
4458 }
4459 }
4460
GL_RasterPos2sv(const GLshort * v)4461 void GL_APIENTRY GL_RasterPos2sv(const GLshort *v)
4462 {
4463 Context *context = GetValidGlobalContext();
4464 EVENT(context, GLRasterPos2sv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
4465 (uintptr_t)v);
4466
4467 if (context)
4468 {
4469 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4470 bool isCallValid = (context->skipValidation() || ValidateRasterPos2sv(context, v));
4471 if (isCallValid)
4472 {
4473 context->rasterPos2sv(v);
4474 }
4475 ANGLE_CAPTURE(RasterPos2sv, isCallValid, context, v);
4476 }
4477 else
4478 {
4479 GenerateContextLostErrorOnCurrentGlobalContext();
4480 }
4481 }
4482
GL_RasterPos3d(GLdouble x,GLdouble y,GLdouble z)4483 void GL_APIENTRY GL_RasterPos3d(GLdouble x, GLdouble y, GLdouble z)
4484 {
4485 Context *context = GetValidGlobalContext();
4486 EVENT(context, GLRasterPos3d, "context = %d, x = %f, y = %f, z = %f", CID(context), x, y, z);
4487
4488 if (context)
4489 {
4490 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4491 bool isCallValid = (context->skipValidation() || ValidateRasterPos3d(context, x, y, z));
4492 if (isCallValid)
4493 {
4494 context->rasterPos3d(x, y, z);
4495 }
4496 ANGLE_CAPTURE(RasterPos3d, isCallValid, context, x, y, z);
4497 }
4498 else
4499 {
4500 GenerateContextLostErrorOnCurrentGlobalContext();
4501 }
4502 }
4503
GL_RasterPos3dv(const GLdouble * v)4504 void GL_APIENTRY GL_RasterPos3dv(const GLdouble *v)
4505 {
4506 Context *context = GetValidGlobalContext();
4507 EVENT(context, GLRasterPos3dv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
4508 (uintptr_t)v);
4509
4510 if (context)
4511 {
4512 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4513 bool isCallValid = (context->skipValidation() || ValidateRasterPos3dv(context, v));
4514 if (isCallValid)
4515 {
4516 context->rasterPos3dv(v);
4517 }
4518 ANGLE_CAPTURE(RasterPos3dv, isCallValid, context, v);
4519 }
4520 else
4521 {
4522 GenerateContextLostErrorOnCurrentGlobalContext();
4523 }
4524 }
4525
GL_RasterPos3f(GLfloat x,GLfloat y,GLfloat z)4526 void GL_APIENTRY GL_RasterPos3f(GLfloat x, GLfloat y, GLfloat z)
4527 {
4528 Context *context = GetValidGlobalContext();
4529 EVENT(context, GLRasterPos3f, "context = %d, x = %f, y = %f, z = %f", CID(context), x, y, z);
4530
4531 if (context)
4532 {
4533 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4534 bool isCallValid = (context->skipValidation() || ValidateRasterPos3f(context, x, y, z));
4535 if (isCallValid)
4536 {
4537 context->rasterPos3f(x, y, z);
4538 }
4539 ANGLE_CAPTURE(RasterPos3f, isCallValid, context, x, y, z);
4540 }
4541 else
4542 {
4543 GenerateContextLostErrorOnCurrentGlobalContext();
4544 }
4545 }
4546
GL_RasterPos3fv(const GLfloat * v)4547 void GL_APIENTRY GL_RasterPos3fv(const GLfloat *v)
4548 {
4549 Context *context = GetValidGlobalContext();
4550 EVENT(context, GLRasterPos3fv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
4551 (uintptr_t)v);
4552
4553 if (context)
4554 {
4555 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4556 bool isCallValid = (context->skipValidation() || ValidateRasterPos3fv(context, v));
4557 if (isCallValid)
4558 {
4559 context->rasterPos3fv(v);
4560 }
4561 ANGLE_CAPTURE(RasterPos3fv, isCallValid, context, v);
4562 }
4563 else
4564 {
4565 GenerateContextLostErrorOnCurrentGlobalContext();
4566 }
4567 }
4568
GL_RasterPos3i(GLint x,GLint y,GLint z)4569 void GL_APIENTRY GL_RasterPos3i(GLint x, GLint y, GLint z)
4570 {
4571 Context *context = GetValidGlobalContext();
4572 EVENT(context, GLRasterPos3i, "context = %d, x = %d, y = %d, z = %d", CID(context), x, y, z);
4573
4574 if (context)
4575 {
4576 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4577 bool isCallValid = (context->skipValidation() || ValidateRasterPos3i(context, x, y, z));
4578 if (isCallValid)
4579 {
4580 context->rasterPos3i(x, y, z);
4581 }
4582 ANGLE_CAPTURE(RasterPos3i, isCallValid, context, x, y, z);
4583 }
4584 else
4585 {
4586 GenerateContextLostErrorOnCurrentGlobalContext();
4587 }
4588 }
4589
GL_RasterPos3iv(const GLint * v)4590 void GL_APIENTRY GL_RasterPos3iv(const GLint *v)
4591 {
4592 Context *context = GetValidGlobalContext();
4593 EVENT(context, GLRasterPos3iv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
4594 (uintptr_t)v);
4595
4596 if (context)
4597 {
4598 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4599 bool isCallValid = (context->skipValidation() || ValidateRasterPos3iv(context, v));
4600 if (isCallValid)
4601 {
4602 context->rasterPos3iv(v);
4603 }
4604 ANGLE_CAPTURE(RasterPos3iv, isCallValid, context, v);
4605 }
4606 else
4607 {
4608 GenerateContextLostErrorOnCurrentGlobalContext();
4609 }
4610 }
4611
GL_RasterPos3s(GLshort x,GLshort y,GLshort z)4612 void GL_APIENTRY GL_RasterPos3s(GLshort x, GLshort y, GLshort z)
4613 {
4614 Context *context = GetValidGlobalContext();
4615 EVENT(context, GLRasterPos3s, "context = %d, x = %d, y = %d, z = %d", CID(context), x, y, z);
4616
4617 if (context)
4618 {
4619 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4620 bool isCallValid = (context->skipValidation() || ValidateRasterPos3s(context, x, y, z));
4621 if (isCallValid)
4622 {
4623 context->rasterPos3s(x, y, z);
4624 }
4625 ANGLE_CAPTURE(RasterPos3s, isCallValid, context, x, y, z);
4626 }
4627 else
4628 {
4629 GenerateContextLostErrorOnCurrentGlobalContext();
4630 }
4631 }
4632
GL_RasterPos3sv(const GLshort * v)4633 void GL_APIENTRY GL_RasterPos3sv(const GLshort *v)
4634 {
4635 Context *context = GetValidGlobalContext();
4636 EVENT(context, GLRasterPos3sv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
4637 (uintptr_t)v);
4638
4639 if (context)
4640 {
4641 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4642 bool isCallValid = (context->skipValidation() || ValidateRasterPos3sv(context, v));
4643 if (isCallValid)
4644 {
4645 context->rasterPos3sv(v);
4646 }
4647 ANGLE_CAPTURE(RasterPos3sv, isCallValid, context, v);
4648 }
4649 else
4650 {
4651 GenerateContextLostErrorOnCurrentGlobalContext();
4652 }
4653 }
4654
GL_RasterPos4d(GLdouble x,GLdouble y,GLdouble z,GLdouble w)4655 void GL_APIENTRY GL_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
4656 {
4657 Context *context = GetValidGlobalContext();
4658 EVENT(context, GLRasterPos4d, "context = %d, x = %f, y = %f, z = %f, w = %f", CID(context), x,
4659 y, z, w);
4660
4661 if (context)
4662 {
4663 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4664 bool isCallValid = (context->skipValidation() || ValidateRasterPos4d(context, x, y, z, w));
4665 if (isCallValid)
4666 {
4667 context->rasterPos4d(x, y, z, w);
4668 }
4669 ANGLE_CAPTURE(RasterPos4d, isCallValid, context, x, y, z, w);
4670 }
4671 else
4672 {
4673 GenerateContextLostErrorOnCurrentGlobalContext();
4674 }
4675 }
4676
GL_RasterPos4dv(const GLdouble * v)4677 void GL_APIENTRY GL_RasterPos4dv(const GLdouble *v)
4678 {
4679 Context *context = GetValidGlobalContext();
4680 EVENT(context, GLRasterPos4dv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
4681 (uintptr_t)v);
4682
4683 if (context)
4684 {
4685 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4686 bool isCallValid = (context->skipValidation() || ValidateRasterPos4dv(context, v));
4687 if (isCallValid)
4688 {
4689 context->rasterPos4dv(v);
4690 }
4691 ANGLE_CAPTURE(RasterPos4dv, isCallValid, context, v);
4692 }
4693 else
4694 {
4695 GenerateContextLostErrorOnCurrentGlobalContext();
4696 }
4697 }
4698
GL_RasterPos4f(GLfloat x,GLfloat y,GLfloat z,GLfloat w)4699 void GL_APIENTRY GL_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
4700 {
4701 Context *context = GetValidGlobalContext();
4702 EVENT(context, GLRasterPos4f, "context = %d, x = %f, y = %f, z = %f, w = %f", CID(context), x,
4703 y, z, w);
4704
4705 if (context)
4706 {
4707 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4708 bool isCallValid = (context->skipValidation() || ValidateRasterPos4f(context, x, y, z, w));
4709 if (isCallValid)
4710 {
4711 context->rasterPos4f(x, y, z, w);
4712 }
4713 ANGLE_CAPTURE(RasterPos4f, isCallValid, context, x, y, z, w);
4714 }
4715 else
4716 {
4717 GenerateContextLostErrorOnCurrentGlobalContext();
4718 }
4719 }
4720
GL_RasterPos4fv(const GLfloat * v)4721 void GL_APIENTRY GL_RasterPos4fv(const GLfloat *v)
4722 {
4723 Context *context = GetValidGlobalContext();
4724 EVENT(context, GLRasterPos4fv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
4725 (uintptr_t)v);
4726
4727 if (context)
4728 {
4729 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4730 bool isCallValid = (context->skipValidation() || ValidateRasterPos4fv(context, v));
4731 if (isCallValid)
4732 {
4733 context->rasterPos4fv(v);
4734 }
4735 ANGLE_CAPTURE(RasterPos4fv, isCallValid, context, v);
4736 }
4737 else
4738 {
4739 GenerateContextLostErrorOnCurrentGlobalContext();
4740 }
4741 }
4742
GL_RasterPos4i(GLint x,GLint y,GLint z,GLint w)4743 void GL_APIENTRY GL_RasterPos4i(GLint x, GLint y, GLint z, GLint w)
4744 {
4745 Context *context = GetValidGlobalContext();
4746 EVENT(context, GLRasterPos4i, "context = %d, x = %d, y = %d, z = %d, w = %d", CID(context), x,
4747 y, z, w);
4748
4749 if (context)
4750 {
4751 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4752 bool isCallValid = (context->skipValidation() || ValidateRasterPos4i(context, x, y, z, w));
4753 if (isCallValid)
4754 {
4755 context->rasterPos4i(x, y, z, w);
4756 }
4757 ANGLE_CAPTURE(RasterPos4i, isCallValid, context, x, y, z, w);
4758 }
4759 else
4760 {
4761 GenerateContextLostErrorOnCurrentGlobalContext();
4762 }
4763 }
4764
GL_RasterPos4iv(const GLint * v)4765 void GL_APIENTRY GL_RasterPos4iv(const GLint *v)
4766 {
4767 Context *context = GetValidGlobalContext();
4768 EVENT(context, GLRasterPos4iv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
4769 (uintptr_t)v);
4770
4771 if (context)
4772 {
4773 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4774 bool isCallValid = (context->skipValidation() || ValidateRasterPos4iv(context, v));
4775 if (isCallValid)
4776 {
4777 context->rasterPos4iv(v);
4778 }
4779 ANGLE_CAPTURE(RasterPos4iv, isCallValid, context, v);
4780 }
4781 else
4782 {
4783 GenerateContextLostErrorOnCurrentGlobalContext();
4784 }
4785 }
4786
GL_RasterPos4s(GLshort x,GLshort y,GLshort z,GLshort w)4787 void GL_APIENTRY GL_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
4788 {
4789 Context *context = GetValidGlobalContext();
4790 EVENT(context, GLRasterPos4s, "context = %d, x = %d, y = %d, z = %d, w = %d", CID(context), x,
4791 y, z, w);
4792
4793 if (context)
4794 {
4795 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4796 bool isCallValid = (context->skipValidation() || ValidateRasterPos4s(context, x, y, z, w));
4797 if (isCallValid)
4798 {
4799 context->rasterPos4s(x, y, z, w);
4800 }
4801 ANGLE_CAPTURE(RasterPos4s, isCallValid, context, x, y, z, w);
4802 }
4803 else
4804 {
4805 GenerateContextLostErrorOnCurrentGlobalContext();
4806 }
4807 }
4808
GL_RasterPos4sv(const GLshort * v)4809 void GL_APIENTRY GL_RasterPos4sv(const GLshort *v)
4810 {
4811 Context *context = GetValidGlobalContext();
4812 EVENT(context, GLRasterPos4sv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
4813 (uintptr_t)v);
4814
4815 if (context)
4816 {
4817 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4818 bool isCallValid = (context->skipValidation() || ValidateRasterPos4sv(context, v));
4819 if (isCallValid)
4820 {
4821 context->rasterPos4sv(v);
4822 }
4823 ANGLE_CAPTURE(RasterPos4sv, isCallValid, context, v);
4824 }
4825 else
4826 {
4827 GenerateContextLostErrorOnCurrentGlobalContext();
4828 }
4829 }
4830
GL_ReadBuffer(GLenum src)4831 void GL_APIENTRY GL_ReadBuffer(GLenum src)
4832 {
4833 Context *context = GetValidGlobalContext();
4834 EVENT(context, GLReadBuffer, "context = %d, src = %s", CID(context),
4835 GLenumToString(GLenumGroup::ReadBufferMode, src));
4836
4837 if (context)
4838 {
4839 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4840 bool isCallValid = (context->skipValidation() || ValidateReadBuffer(context, src));
4841 if (isCallValid)
4842 {
4843 context->readBuffer(src);
4844 }
4845 ANGLE_CAPTURE(ReadBuffer, isCallValid, context, src);
4846 }
4847 else
4848 {
4849 GenerateContextLostErrorOnCurrentGlobalContext();
4850 }
4851 }
4852
GL_ReadPixels(GLint x,GLint y,GLsizei width,GLsizei height,GLenum format,GLenum type,void * pixels)4853 void GL_APIENTRY GL_ReadPixels(GLint x,
4854 GLint y,
4855 GLsizei width,
4856 GLsizei height,
4857 GLenum format,
4858 GLenum type,
4859 void *pixels)
4860 {
4861 Context *context = GetValidGlobalContext();
4862 EVENT(context, GLReadPixels,
4863 "context = %d, x = %d, y = %d, width = %d, height = %d, format = %s, type = %s, pixels = "
4864 "0x%016" PRIxPTR "",
4865 CID(context), x, y, width, height, GLenumToString(GLenumGroup::PixelFormat, format),
4866 GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)pixels);
4867
4868 if (context)
4869 {
4870 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4871 bool isCallValid = (context->skipValidation() ||
4872 ValidateReadPixels(context, x, y, width, height, format, type, pixels));
4873 if (isCallValid)
4874 {
4875 context->readPixels(x, y, width, height, format, type, pixels);
4876 }
4877 ANGLE_CAPTURE(ReadPixels, isCallValid, context, x, y, width, height, format, type, pixels);
4878 }
4879 else
4880 {
4881 GenerateContextLostErrorOnCurrentGlobalContext();
4882 }
4883 }
4884
GL_Rectd(GLdouble x1,GLdouble y1,GLdouble x2,GLdouble y2)4885 void GL_APIENTRY GL_Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
4886 {
4887 Context *context = GetValidGlobalContext();
4888 EVENT(context, GLRectd, "context = %d, x1 = %f, y1 = %f, x2 = %f, y2 = %f", CID(context), x1,
4889 y1, x2, y2);
4890
4891 if (context)
4892 {
4893 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4894 bool isCallValid = (context->skipValidation() || ValidateRectd(context, x1, y1, x2, y2));
4895 if (isCallValid)
4896 {
4897 context->rectd(x1, y1, x2, y2);
4898 }
4899 ANGLE_CAPTURE(Rectd, isCallValid, context, x1, y1, x2, y2);
4900 }
4901 else
4902 {
4903 GenerateContextLostErrorOnCurrentGlobalContext();
4904 }
4905 }
4906
GL_Rectdv(const GLdouble * v1,const GLdouble * v2)4907 void GL_APIENTRY GL_Rectdv(const GLdouble *v1, const GLdouble *v2)
4908 {
4909 Context *context = GetValidGlobalContext();
4910 EVENT(context, GLRectdv, "context = %d, v1 = 0x%016" PRIxPTR ", v2 = 0x%016" PRIxPTR "",
4911 CID(context), (uintptr_t)v1, (uintptr_t)v2);
4912
4913 if (context)
4914 {
4915 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4916 bool isCallValid = (context->skipValidation() || ValidateRectdv(context, v1, v2));
4917 if (isCallValid)
4918 {
4919 context->rectdv(v1, v2);
4920 }
4921 ANGLE_CAPTURE(Rectdv, isCallValid, context, v1, v2);
4922 }
4923 else
4924 {
4925 GenerateContextLostErrorOnCurrentGlobalContext();
4926 }
4927 }
4928
GL_Rectf(GLfloat x1,GLfloat y1,GLfloat x2,GLfloat y2)4929 void GL_APIENTRY GL_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
4930 {
4931 Context *context = GetValidGlobalContext();
4932 EVENT(context, GLRectf, "context = %d, x1 = %f, y1 = %f, x2 = %f, y2 = %f", CID(context), x1,
4933 y1, x2, y2);
4934
4935 if (context)
4936 {
4937 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4938 bool isCallValid = (context->skipValidation() || ValidateRectf(context, x1, y1, x2, y2));
4939 if (isCallValid)
4940 {
4941 context->rectf(x1, y1, x2, y2);
4942 }
4943 ANGLE_CAPTURE(Rectf, isCallValid, context, x1, y1, x2, y2);
4944 }
4945 else
4946 {
4947 GenerateContextLostErrorOnCurrentGlobalContext();
4948 }
4949 }
4950
GL_Rectfv(const GLfloat * v1,const GLfloat * v2)4951 void GL_APIENTRY GL_Rectfv(const GLfloat *v1, const GLfloat *v2)
4952 {
4953 Context *context = GetValidGlobalContext();
4954 EVENT(context, GLRectfv, "context = %d, v1 = 0x%016" PRIxPTR ", v2 = 0x%016" PRIxPTR "",
4955 CID(context), (uintptr_t)v1, (uintptr_t)v2);
4956
4957 if (context)
4958 {
4959 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4960 bool isCallValid = (context->skipValidation() || ValidateRectfv(context, v1, v2));
4961 if (isCallValid)
4962 {
4963 context->rectfv(v1, v2);
4964 }
4965 ANGLE_CAPTURE(Rectfv, isCallValid, context, v1, v2);
4966 }
4967 else
4968 {
4969 GenerateContextLostErrorOnCurrentGlobalContext();
4970 }
4971 }
4972
GL_Recti(GLint x1,GLint y1,GLint x2,GLint y2)4973 void GL_APIENTRY GL_Recti(GLint x1, GLint y1, GLint x2, GLint y2)
4974 {
4975 Context *context = GetValidGlobalContext();
4976 EVENT(context, GLRecti, "context = %d, x1 = %d, y1 = %d, x2 = %d, y2 = %d", CID(context), x1,
4977 y1, x2, y2);
4978
4979 if (context)
4980 {
4981 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
4982 bool isCallValid = (context->skipValidation() || ValidateRecti(context, x1, y1, x2, y2));
4983 if (isCallValid)
4984 {
4985 context->recti(x1, y1, x2, y2);
4986 }
4987 ANGLE_CAPTURE(Recti, isCallValid, context, x1, y1, x2, y2);
4988 }
4989 else
4990 {
4991 GenerateContextLostErrorOnCurrentGlobalContext();
4992 }
4993 }
4994
GL_Rectiv(const GLint * v1,const GLint * v2)4995 void GL_APIENTRY GL_Rectiv(const GLint *v1, const GLint *v2)
4996 {
4997 Context *context = GetValidGlobalContext();
4998 EVENT(context, GLRectiv, "context = %d, v1 = 0x%016" PRIxPTR ", v2 = 0x%016" PRIxPTR "",
4999 CID(context), (uintptr_t)v1, (uintptr_t)v2);
5000
5001 if (context)
5002 {
5003 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5004 bool isCallValid = (context->skipValidation() || ValidateRectiv(context, v1, v2));
5005 if (isCallValid)
5006 {
5007 context->rectiv(v1, v2);
5008 }
5009 ANGLE_CAPTURE(Rectiv, isCallValid, context, v1, v2);
5010 }
5011 else
5012 {
5013 GenerateContextLostErrorOnCurrentGlobalContext();
5014 }
5015 }
5016
GL_Rects(GLshort x1,GLshort y1,GLshort x2,GLshort y2)5017 void GL_APIENTRY GL_Rects(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
5018 {
5019 Context *context = GetValidGlobalContext();
5020 EVENT(context, GLRects, "context = %d, x1 = %d, y1 = %d, x2 = %d, y2 = %d", CID(context), x1,
5021 y1, x2, y2);
5022
5023 if (context)
5024 {
5025 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5026 bool isCallValid = (context->skipValidation() || ValidateRects(context, x1, y1, x2, y2));
5027 if (isCallValid)
5028 {
5029 context->rects(x1, y1, x2, y2);
5030 }
5031 ANGLE_CAPTURE(Rects, isCallValid, context, x1, y1, x2, y2);
5032 }
5033 else
5034 {
5035 GenerateContextLostErrorOnCurrentGlobalContext();
5036 }
5037 }
5038
GL_Rectsv(const GLshort * v1,const GLshort * v2)5039 void GL_APIENTRY GL_Rectsv(const GLshort *v1, const GLshort *v2)
5040 {
5041 Context *context = GetValidGlobalContext();
5042 EVENT(context, GLRectsv, "context = %d, v1 = 0x%016" PRIxPTR ", v2 = 0x%016" PRIxPTR "",
5043 CID(context), (uintptr_t)v1, (uintptr_t)v2);
5044
5045 if (context)
5046 {
5047 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5048 bool isCallValid = (context->skipValidation() || ValidateRectsv(context, v1, v2));
5049 if (isCallValid)
5050 {
5051 context->rectsv(v1, v2);
5052 }
5053 ANGLE_CAPTURE(Rectsv, isCallValid, context, v1, v2);
5054 }
5055 else
5056 {
5057 GenerateContextLostErrorOnCurrentGlobalContext();
5058 }
5059 }
5060
GL_RenderMode(GLenum mode)5061 GLint GL_APIENTRY GL_RenderMode(GLenum mode)
5062 {
5063 Context *context = GetValidGlobalContext();
5064 EVENT(context, GLRenderMode, "context = %d, mode = %s", CID(context),
5065 GLenumToString(GLenumGroup::RenderingMode, mode));
5066
5067 GLint returnValue;
5068 if (context)
5069 {
5070 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5071 bool isCallValid = (context->skipValidation() || ValidateRenderMode(context, mode));
5072 if (isCallValid)
5073 {
5074 returnValue = context->renderMode(mode);
5075 }
5076 else
5077 {
5078 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLRenderMode, GLint>();
5079 }
5080 ANGLE_CAPTURE(RenderMode, isCallValid, context, mode, returnValue);
5081 }
5082 else
5083 {
5084 GenerateContextLostErrorOnCurrentGlobalContext();
5085 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLRenderMode, GLint>();
5086 }
5087 return returnValue;
5088 }
5089
GL_Rotated(GLdouble angle,GLdouble x,GLdouble y,GLdouble z)5090 void GL_APIENTRY GL_Rotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
5091 {
5092 Context *context = GetValidGlobalContext();
5093 EVENT(context, GLRotated, "context = %d, angle = %f, x = %f, y = %f, z = %f", CID(context),
5094 angle, x, y, z);
5095
5096 if (context)
5097 {
5098 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5099 bool isCallValid = (context->skipValidation() || ValidateRotated(context, angle, x, y, z));
5100 if (isCallValid)
5101 {
5102 context->rotated(angle, x, y, z);
5103 }
5104 ANGLE_CAPTURE(Rotated, isCallValid, context, angle, x, y, z);
5105 }
5106 else
5107 {
5108 GenerateContextLostErrorOnCurrentGlobalContext();
5109 }
5110 }
5111
GL_Rotatef(GLfloat angle,GLfloat x,GLfloat y,GLfloat z)5112 void GL_APIENTRY GL_Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
5113 {
5114 Context *context = GetValidGlobalContext();
5115 EVENT(context, GLRotatef, "context = %d, angle = %f, x = %f, y = %f, z = %f", CID(context),
5116 angle, x, y, z);
5117
5118 if (context)
5119 {
5120 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5121 bool isCallValid = (context->skipValidation() || ValidateRotatef(context, angle, x, y, z));
5122 if (isCallValid)
5123 {
5124 context->rotatef(angle, x, y, z);
5125 }
5126 ANGLE_CAPTURE(Rotatef, isCallValid, context, angle, x, y, z);
5127 }
5128 else
5129 {
5130 GenerateContextLostErrorOnCurrentGlobalContext();
5131 }
5132 }
5133
GL_Scaled(GLdouble x,GLdouble y,GLdouble z)5134 void GL_APIENTRY GL_Scaled(GLdouble x, GLdouble y, GLdouble z)
5135 {
5136 Context *context = GetValidGlobalContext();
5137 EVENT(context, GLScaled, "context = %d, x = %f, y = %f, z = %f", CID(context), x, y, z);
5138
5139 if (context)
5140 {
5141 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5142 bool isCallValid = (context->skipValidation() || ValidateScaled(context, x, y, z));
5143 if (isCallValid)
5144 {
5145 context->scaled(x, y, z);
5146 }
5147 ANGLE_CAPTURE(Scaled, isCallValid, context, x, y, z);
5148 }
5149 else
5150 {
5151 GenerateContextLostErrorOnCurrentGlobalContext();
5152 }
5153 }
5154
GL_Scalef(GLfloat x,GLfloat y,GLfloat z)5155 void GL_APIENTRY GL_Scalef(GLfloat x, GLfloat y, GLfloat z)
5156 {
5157 Context *context = GetValidGlobalContext();
5158 EVENT(context, GLScalef, "context = %d, x = %f, y = %f, z = %f", CID(context), x, y, z);
5159
5160 if (context)
5161 {
5162 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5163 bool isCallValid = (context->skipValidation() || ValidateScalef(context, x, y, z));
5164 if (isCallValid)
5165 {
5166 context->scalef(x, y, z);
5167 }
5168 ANGLE_CAPTURE(Scalef, isCallValid, context, x, y, z);
5169 }
5170 else
5171 {
5172 GenerateContextLostErrorOnCurrentGlobalContext();
5173 }
5174 }
5175
GL_Scissor(GLint x,GLint y,GLsizei width,GLsizei height)5176 void GL_APIENTRY GL_Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
5177 {
5178 Context *context = GetValidGlobalContext();
5179 EVENT(context, GLScissor, "context = %d, x = %d, y = %d, width = %d, height = %d", CID(context),
5180 x, y, width, height);
5181
5182 if (context)
5183 {
5184 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5185 bool isCallValid =
5186 (context->skipValidation() || ValidateScissor(context, x, y, width, height));
5187 if (isCallValid)
5188 {
5189 context->scissor(x, y, width, height);
5190 }
5191 ANGLE_CAPTURE(Scissor, isCallValid, context, x, y, width, height);
5192 }
5193 else
5194 {
5195 GenerateContextLostErrorOnCurrentGlobalContext();
5196 }
5197 }
5198
GL_SelectBuffer(GLsizei size,GLuint * buffer)5199 void GL_APIENTRY GL_SelectBuffer(GLsizei size, GLuint *buffer)
5200 {
5201 Context *context = GetValidGlobalContext();
5202 EVENT(context, GLSelectBuffer, "context = %d, size = %d, buffer = 0x%016" PRIxPTR "",
5203 CID(context), size, (uintptr_t)buffer);
5204
5205 if (context)
5206 {
5207 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5208 bool isCallValid =
5209 (context->skipValidation() || ValidateSelectBuffer(context, size, buffer));
5210 if (isCallValid)
5211 {
5212 context->selectBuffer(size, buffer);
5213 }
5214 ANGLE_CAPTURE(SelectBuffer, isCallValid, context, size, buffer);
5215 }
5216 else
5217 {
5218 GenerateContextLostErrorOnCurrentGlobalContext();
5219 }
5220 }
5221
GL_ShadeModel(GLenum mode)5222 void GL_APIENTRY GL_ShadeModel(GLenum mode)
5223 {
5224 Context *context = GetValidGlobalContext();
5225 EVENT(context, GLShadeModel, "context = %d, mode = %s", CID(context),
5226 GLenumToString(GLenumGroup::ShadingModel, mode));
5227
5228 if (context)
5229 {
5230 ShadingModel modePacked = PackParam<ShadingModel>(mode);
5231 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5232 bool isCallValid = (context->skipValidation() || ValidateShadeModel(context, modePacked));
5233 if (isCallValid)
5234 {
5235 context->shadeModel(modePacked);
5236 }
5237 ANGLE_CAPTURE(ShadeModel, isCallValid, context, modePacked);
5238 }
5239 else
5240 {
5241 GenerateContextLostErrorOnCurrentGlobalContext();
5242 }
5243 }
5244
GL_StencilFunc(GLenum func,GLint ref,GLuint mask)5245 void GL_APIENTRY GL_StencilFunc(GLenum func, GLint ref, GLuint mask)
5246 {
5247 Context *context = GetValidGlobalContext();
5248 EVENT(context, GLStencilFunc, "context = %d, func = %s, ref = %d, mask = %u", CID(context),
5249 GLenumToString(GLenumGroup::StencilFunction, func), ref, mask);
5250
5251 if (context)
5252 {
5253 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5254 bool isCallValid =
5255 (context->skipValidation() || ValidateStencilFunc(context, func, ref, mask));
5256 if (isCallValid)
5257 {
5258 context->stencilFunc(func, ref, mask);
5259 }
5260 ANGLE_CAPTURE(StencilFunc, isCallValid, context, func, ref, mask);
5261 }
5262 else
5263 {
5264 GenerateContextLostErrorOnCurrentGlobalContext();
5265 }
5266 }
5267
GL_StencilMask(GLuint mask)5268 void GL_APIENTRY GL_StencilMask(GLuint mask)
5269 {
5270 Context *context = GetValidGlobalContext();
5271 EVENT(context, GLStencilMask, "context = %d, mask = %u", CID(context), mask);
5272
5273 if (context)
5274 {
5275 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5276 bool isCallValid = (context->skipValidation() || ValidateStencilMask(context, mask));
5277 if (isCallValid)
5278 {
5279 context->stencilMask(mask);
5280 }
5281 ANGLE_CAPTURE(StencilMask, isCallValid, context, mask);
5282 }
5283 else
5284 {
5285 GenerateContextLostErrorOnCurrentGlobalContext();
5286 }
5287 }
5288
GL_StencilOp(GLenum fail,GLenum zfail,GLenum zpass)5289 void GL_APIENTRY GL_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
5290 {
5291 Context *context = GetValidGlobalContext();
5292 EVENT(context, GLStencilOp, "context = %d, fail = %s, zfail = %s, zpass = %s", CID(context),
5293 GLenumToString(GLenumGroup::StencilOp, fail),
5294 GLenumToString(GLenumGroup::StencilOp, zfail),
5295 GLenumToString(GLenumGroup::StencilOp, zpass));
5296
5297 if (context)
5298 {
5299 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5300 bool isCallValid =
5301 (context->skipValidation() || ValidateStencilOp(context, fail, zfail, zpass));
5302 if (isCallValid)
5303 {
5304 context->stencilOp(fail, zfail, zpass);
5305 }
5306 ANGLE_CAPTURE(StencilOp, isCallValid, context, fail, zfail, zpass);
5307 }
5308 else
5309 {
5310 GenerateContextLostErrorOnCurrentGlobalContext();
5311 }
5312 }
5313
GL_TexCoord1d(GLdouble s)5314 void GL_APIENTRY GL_TexCoord1d(GLdouble s)
5315 {
5316 Context *context = GetValidGlobalContext();
5317 EVENT(context, GLTexCoord1d, "context = %d, s = %f", CID(context), s);
5318
5319 if (context)
5320 {
5321 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5322 bool isCallValid = (context->skipValidation() || ValidateTexCoord1d(context, s));
5323 if (isCallValid)
5324 {
5325 context->texCoord1d(s);
5326 }
5327 ANGLE_CAPTURE(TexCoord1d, isCallValid, context, s);
5328 }
5329 else
5330 {
5331 GenerateContextLostErrorOnCurrentGlobalContext();
5332 }
5333 }
5334
GL_TexCoord1dv(const GLdouble * v)5335 void GL_APIENTRY GL_TexCoord1dv(const GLdouble *v)
5336 {
5337 Context *context = GetValidGlobalContext();
5338 EVENT(context, GLTexCoord1dv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
5339 (uintptr_t)v);
5340
5341 if (context)
5342 {
5343 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5344 bool isCallValid = (context->skipValidation() || ValidateTexCoord1dv(context, v));
5345 if (isCallValid)
5346 {
5347 context->texCoord1dv(v);
5348 }
5349 ANGLE_CAPTURE(TexCoord1dv, isCallValid, context, v);
5350 }
5351 else
5352 {
5353 GenerateContextLostErrorOnCurrentGlobalContext();
5354 }
5355 }
5356
GL_TexCoord1f(GLfloat s)5357 void GL_APIENTRY GL_TexCoord1f(GLfloat s)
5358 {
5359 Context *context = GetValidGlobalContext();
5360 EVENT(context, GLTexCoord1f, "context = %d, s = %f", CID(context), s);
5361
5362 if (context)
5363 {
5364 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5365 bool isCallValid = (context->skipValidation() || ValidateTexCoord1f(context, s));
5366 if (isCallValid)
5367 {
5368 context->texCoord1f(s);
5369 }
5370 ANGLE_CAPTURE(TexCoord1f, isCallValid, context, s);
5371 }
5372 else
5373 {
5374 GenerateContextLostErrorOnCurrentGlobalContext();
5375 }
5376 }
5377
GL_TexCoord1fv(const GLfloat * v)5378 void GL_APIENTRY GL_TexCoord1fv(const GLfloat *v)
5379 {
5380 Context *context = GetValidGlobalContext();
5381 EVENT(context, GLTexCoord1fv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
5382 (uintptr_t)v);
5383
5384 if (context)
5385 {
5386 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5387 bool isCallValid = (context->skipValidation() || ValidateTexCoord1fv(context, v));
5388 if (isCallValid)
5389 {
5390 context->texCoord1fv(v);
5391 }
5392 ANGLE_CAPTURE(TexCoord1fv, isCallValid, context, v);
5393 }
5394 else
5395 {
5396 GenerateContextLostErrorOnCurrentGlobalContext();
5397 }
5398 }
5399
GL_TexCoord1i(GLint s)5400 void GL_APIENTRY GL_TexCoord1i(GLint s)
5401 {
5402 Context *context = GetValidGlobalContext();
5403 EVENT(context, GLTexCoord1i, "context = %d, s = %d", CID(context), s);
5404
5405 if (context)
5406 {
5407 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5408 bool isCallValid = (context->skipValidation() || ValidateTexCoord1i(context, s));
5409 if (isCallValid)
5410 {
5411 context->texCoord1i(s);
5412 }
5413 ANGLE_CAPTURE(TexCoord1i, isCallValid, context, s);
5414 }
5415 else
5416 {
5417 GenerateContextLostErrorOnCurrentGlobalContext();
5418 }
5419 }
5420
GL_TexCoord1iv(const GLint * v)5421 void GL_APIENTRY GL_TexCoord1iv(const GLint *v)
5422 {
5423 Context *context = GetValidGlobalContext();
5424 EVENT(context, GLTexCoord1iv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
5425 (uintptr_t)v);
5426
5427 if (context)
5428 {
5429 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5430 bool isCallValid = (context->skipValidation() || ValidateTexCoord1iv(context, v));
5431 if (isCallValid)
5432 {
5433 context->texCoord1iv(v);
5434 }
5435 ANGLE_CAPTURE(TexCoord1iv, isCallValid, context, v);
5436 }
5437 else
5438 {
5439 GenerateContextLostErrorOnCurrentGlobalContext();
5440 }
5441 }
5442
GL_TexCoord1s(GLshort s)5443 void GL_APIENTRY GL_TexCoord1s(GLshort s)
5444 {
5445 Context *context = GetValidGlobalContext();
5446 EVENT(context, GLTexCoord1s, "context = %d, s = %d", CID(context), s);
5447
5448 if (context)
5449 {
5450 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5451 bool isCallValid = (context->skipValidation() || ValidateTexCoord1s(context, s));
5452 if (isCallValid)
5453 {
5454 context->texCoord1s(s);
5455 }
5456 ANGLE_CAPTURE(TexCoord1s, isCallValid, context, s);
5457 }
5458 else
5459 {
5460 GenerateContextLostErrorOnCurrentGlobalContext();
5461 }
5462 }
5463
GL_TexCoord1sv(const GLshort * v)5464 void GL_APIENTRY GL_TexCoord1sv(const GLshort *v)
5465 {
5466 Context *context = GetValidGlobalContext();
5467 EVENT(context, GLTexCoord1sv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
5468 (uintptr_t)v);
5469
5470 if (context)
5471 {
5472 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5473 bool isCallValid = (context->skipValidation() || ValidateTexCoord1sv(context, v));
5474 if (isCallValid)
5475 {
5476 context->texCoord1sv(v);
5477 }
5478 ANGLE_CAPTURE(TexCoord1sv, isCallValid, context, v);
5479 }
5480 else
5481 {
5482 GenerateContextLostErrorOnCurrentGlobalContext();
5483 }
5484 }
5485
GL_TexCoord2d(GLdouble s,GLdouble t)5486 void GL_APIENTRY GL_TexCoord2d(GLdouble s, GLdouble t)
5487 {
5488 Context *context = GetValidGlobalContext();
5489 EVENT(context, GLTexCoord2d, "context = %d, s = %f, t = %f", CID(context), s, t);
5490
5491 if (context)
5492 {
5493 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5494 bool isCallValid = (context->skipValidation() || ValidateTexCoord2d(context, s, t));
5495 if (isCallValid)
5496 {
5497 context->texCoord2d(s, t);
5498 }
5499 ANGLE_CAPTURE(TexCoord2d, isCallValid, context, s, t);
5500 }
5501 else
5502 {
5503 GenerateContextLostErrorOnCurrentGlobalContext();
5504 }
5505 }
5506
GL_TexCoord2dv(const GLdouble * v)5507 void GL_APIENTRY GL_TexCoord2dv(const GLdouble *v)
5508 {
5509 Context *context = GetValidGlobalContext();
5510 EVENT(context, GLTexCoord2dv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
5511 (uintptr_t)v);
5512
5513 if (context)
5514 {
5515 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5516 bool isCallValid = (context->skipValidation() || ValidateTexCoord2dv(context, v));
5517 if (isCallValid)
5518 {
5519 context->texCoord2dv(v);
5520 }
5521 ANGLE_CAPTURE(TexCoord2dv, isCallValid, context, v);
5522 }
5523 else
5524 {
5525 GenerateContextLostErrorOnCurrentGlobalContext();
5526 }
5527 }
5528
GL_TexCoord2f(GLfloat s,GLfloat t)5529 void GL_APIENTRY GL_TexCoord2f(GLfloat s, GLfloat t)
5530 {
5531 Context *context = GetValidGlobalContext();
5532 EVENT(context, GLTexCoord2f, "context = %d, s = %f, t = %f", CID(context), s, t);
5533
5534 if (context)
5535 {
5536 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5537 bool isCallValid = (context->skipValidation() || ValidateTexCoord2f(context, s, t));
5538 if (isCallValid)
5539 {
5540 context->texCoord2f(s, t);
5541 }
5542 ANGLE_CAPTURE(TexCoord2f, isCallValid, context, s, t);
5543 }
5544 else
5545 {
5546 GenerateContextLostErrorOnCurrentGlobalContext();
5547 }
5548 }
5549
GL_TexCoord2fv(const GLfloat * v)5550 void GL_APIENTRY GL_TexCoord2fv(const GLfloat *v)
5551 {
5552 Context *context = GetValidGlobalContext();
5553 EVENT(context, GLTexCoord2fv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
5554 (uintptr_t)v);
5555
5556 if (context)
5557 {
5558 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5559 bool isCallValid = (context->skipValidation() || ValidateTexCoord2fv(context, v));
5560 if (isCallValid)
5561 {
5562 context->texCoord2fv(v);
5563 }
5564 ANGLE_CAPTURE(TexCoord2fv, isCallValid, context, v);
5565 }
5566 else
5567 {
5568 GenerateContextLostErrorOnCurrentGlobalContext();
5569 }
5570 }
5571
GL_TexCoord2i(GLint s,GLint t)5572 void GL_APIENTRY GL_TexCoord2i(GLint s, GLint t)
5573 {
5574 Context *context = GetValidGlobalContext();
5575 EVENT(context, GLTexCoord2i, "context = %d, s = %d, t = %d", CID(context), s, t);
5576
5577 if (context)
5578 {
5579 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5580 bool isCallValid = (context->skipValidation() || ValidateTexCoord2i(context, s, t));
5581 if (isCallValid)
5582 {
5583 context->texCoord2i(s, t);
5584 }
5585 ANGLE_CAPTURE(TexCoord2i, isCallValid, context, s, t);
5586 }
5587 else
5588 {
5589 GenerateContextLostErrorOnCurrentGlobalContext();
5590 }
5591 }
5592
GL_TexCoord2iv(const GLint * v)5593 void GL_APIENTRY GL_TexCoord2iv(const GLint *v)
5594 {
5595 Context *context = GetValidGlobalContext();
5596 EVENT(context, GLTexCoord2iv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
5597 (uintptr_t)v);
5598
5599 if (context)
5600 {
5601 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5602 bool isCallValid = (context->skipValidation() || ValidateTexCoord2iv(context, v));
5603 if (isCallValid)
5604 {
5605 context->texCoord2iv(v);
5606 }
5607 ANGLE_CAPTURE(TexCoord2iv, isCallValid, context, v);
5608 }
5609 else
5610 {
5611 GenerateContextLostErrorOnCurrentGlobalContext();
5612 }
5613 }
5614
GL_TexCoord2s(GLshort s,GLshort t)5615 void GL_APIENTRY GL_TexCoord2s(GLshort s, GLshort t)
5616 {
5617 Context *context = GetValidGlobalContext();
5618 EVENT(context, GLTexCoord2s, "context = %d, s = %d, t = %d", CID(context), s, t);
5619
5620 if (context)
5621 {
5622 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5623 bool isCallValid = (context->skipValidation() || ValidateTexCoord2s(context, s, t));
5624 if (isCallValid)
5625 {
5626 context->texCoord2s(s, t);
5627 }
5628 ANGLE_CAPTURE(TexCoord2s, isCallValid, context, s, t);
5629 }
5630 else
5631 {
5632 GenerateContextLostErrorOnCurrentGlobalContext();
5633 }
5634 }
5635
GL_TexCoord2sv(const GLshort * v)5636 void GL_APIENTRY GL_TexCoord2sv(const GLshort *v)
5637 {
5638 Context *context = GetValidGlobalContext();
5639 EVENT(context, GLTexCoord2sv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
5640 (uintptr_t)v);
5641
5642 if (context)
5643 {
5644 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5645 bool isCallValid = (context->skipValidation() || ValidateTexCoord2sv(context, v));
5646 if (isCallValid)
5647 {
5648 context->texCoord2sv(v);
5649 }
5650 ANGLE_CAPTURE(TexCoord2sv, isCallValid, context, v);
5651 }
5652 else
5653 {
5654 GenerateContextLostErrorOnCurrentGlobalContext();
5655 }
5656 }
5657
GL_TexCoord3d(GLdouble s,GLdouble t,GLdouble r)5658 void GL_APIENTRY GL_TexCoord3d(GLdouble s, GLdouble t, GLdouble r)
5659 {
5660 Context *context = GetValidGlobalContext();
5661 EVENT(context, GLTexCoord3d, "context = %d, s = %f, t = %f, r = %f", CID(context), s, t, r);
5662
5663 if (context)
5664 {
5665 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5666 bool isCallValid = (context->skipValidation() || ValidateTexCoord3d(context, s, t, r));
5667 if (isCallValid)
5668 {
5669 context->texCoord3d(s, t, r);
5670 }
5671 ANGLE_CAPTURE(TexCoord3d, isCallValid, context, s, t, r);
5672 }
5673 else
5674 {
5675 GenerateContextLostErrorOnCurrentGlobalContext();
5676 }
5677 }
5678
GL_TexCoord3dv(const GLdouble * v)5679 void GL_APIENTRY GL_TexCoord3dv(const GLdouble *v)
5680 {
5681 Context *context = GetValidGlobalContext();
5682 EVENT(context, GLTexCoord3dv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
5683 (uintptr_t)v);
5684
5685 if (context)
5686 {
5687 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5688 bool isCallValid = (context->skipValidation() || ValidateTexCoord3dv(context, v));
5689 if (isCallValid)
5690 {
5691 context->texCoord3dv(v);
5692 }
5693 ANGLE_CAPTURE(TexCoord3dv, isCallValid, context, v);
5694 }
5695 else
5696 {
5697 GenerateContextLostErrorOnCurrentGlobalContext();
5698 }
5699 }
5700
GL_TexCoord3f(GLfloat s,GLfloat t,GLfloat r)5701 void GL_APIENTRY GL_TexCoord3f(GLfloat s, GLfloat t, GLfloat r)
5702 {
5703 Context *context = GetValidGlobalContext();
5704 EVENT(context, GLTexCoord3f, "context = %d, s = %f, t = %f, r = %f", CID(context), s, t, r);
5705
5706 if (context)
5707 {
5708 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5709 bool isCallValid = (context->skipValidation() || ValidateTexCoord3f(context, s, t, r));
5710 if (isCallValid)
5711 {
5712 context->texCoord3f(s, t, r);
5713 }
5714 ANGLE_CAPTURE(TexCoord3f, isCallValid, context, s, t, r);
5715 }
5716 else
5717 {
5718 GenerateContextLostErrorOnCurrentGlobalContext();
5719 }
5720 }
5721
GL_TexCoord3fv(const GLfloat * v)5722 void GL_APIENTRY GL_TexCoord3fv(const GLfloat *v)
5723 {
5724 Context *context = GetValidGlobalContext();
5725 EVENT(context, GLTexCoord3fv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
5726 (uintptr_t)v);
5727
5728 if (context)
5729 {
5730 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5731 bool isCallValid = (context->skipValidation() || ValidateTexCoord3fv(context, v));
5732 if (isCallValid)
5733 {
5734 context->texCoord3fv(v);
5735 }
5736 ANGLE_CAPTURE(TexCoord3fv, isCallValid, context, v);
5737 }
5738 else
5739 {
5740 GenerateContextLostErrorOnCurrentGlobalContext();
5741 }
5742 }
5743
GL_TexCoord3i(GLint s,GLint t,GLint r)5744 void GL_APIENTRY GL_TexCoord3i(GLint s, GLint t, GLint r)
5745 {
5746 Context *context = GetValidGlobalContext();
5747 EVENT(context, GLTexCoord3i, "context = %d, s = %d, t = %d, r = %d", CID(context), s, t, r);
5748
5749 if (context)
5750 {
5751 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5752 bool isCallValid = (context->skipValidation() || ValidateTexCoord3i(context, s, t, r));
5753 if (isCallValid)
5754 {
5755 context->texCoord3i(s, t, r);
5756 }
5757 ANGLE_CAPTURE(TexCoord3i, isCallValid, context, s, t, r);
5758 }
5759 else
5760 {
5761 GenerateContextLostErrorOnCurrentGlobalContext();
5762 }
5763 }
5764
GL_TexCoord3iv(const GLint * v)5765 void GL_APIENTRY GL_TexCoord3iv(const GLint *v)
5766 {
5767 Context *context = GetValidGlobalContext();
5768 EVENT(context, GLTexCoord3iv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
5769 (uintptr_t)v);
5770
5771 if (context)
5772 {
5773 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5774 bool isCallValid = (context->skipValidation() || ValidateTexCoord3iv(context, v));
5775 if (isCallValid)
5776 {
5777 context->texCoord3iv(v);
5778 }
5779 ANGLE_CAPTURE(TexCoord3iv, isCallValid, context, v);
5780 }
5781 else
5782 {
5783 GenerateContextLostErrorOnCurrentGlobalContext();
5784 }
5785 }
5786
GL_TexCoord3s(GLshort s,GLshort t,GLshort r)5787 void GL_APIENTRY GL_TexCoord3s(GLshort s, GLshort t, GLshort r)
5788 {
5789 Context *context = GetValidGlobalContext();
5790 EVENT(context, GLTexCoord3s, "context = %d, s = %d, t = %d, r = %d", CID(context), s, t, r);
5791
5792 if (context)
5793 {
5794 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5795 bool isCallValid = (context->skipValidation() || ValidateTexCoord3s(context, s, t, r));
5796 if (isCallValid)
5797 {
5798 context->texCoord3s(s, t, r);
5799 }
5800 ANGLE_CAPTURE(TexCoord3s, isCallValid, context, s, t, r);
5801 }
5802 else
5803 {
5804 GenerateContextLostErrorOnCurrentGlobalContext();
5805 }
5806 }
5807
GL_TexCoord3sv(const GLshort * v)5808 void GL_APIENTRY GL_TexCoord3sv(const GLshort *v)
5809 {
5810 Context *context = GetValidGlobalContext();
5811 EVENT(context, GLTexCoord3sv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
5812 (uintptr_t)v);
5813
5814 if (context)
5815 {
5816 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5817 bool isCallValid = (context->skipValidation() || ValidateTexCoord3sv(context, v));
5818 if (isCallValid)
5819 {
5820 context->texCoord3sv(v);
5821 }
5822 ANGLE_CAPTURE(TexCoord3sv, isCallValid, context, v);
5823 }
5824 else
5825 {
5826 GenerateContextLostErrorOnCurrentGlobalContext();
5827 }
5828 }
5829
GL_TexCoord4d(GLdouble s,GLdouble t,GLdouble r,GLdouble q)5830 void GL_APIENTRY GL_TexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q)
5831 {
5832 Context *context = GetValidGlobalContext();
5833 EVENT(context, GLTexCoord4d, "context = %d, s = %f, t = %f, r = %f, q = %f", CID(context), s, t,
5834 r, q);
5835
5836 if (context)
5837 {
5838 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5839 bool isCallValid = (context->skipValidation() || ValidateTexCoord4d(context, s, t, r, q));
5840 if (isCallValid)
5841 {
5842 context->texCoord4d(s, t, r, q);
5843 }
5844 ANGLE_CAPTURE(TexCoord4d, isCallValid, context, s, t, r, q);
5845 }
5846 else
5847 {
5848 GenerateContextLostErrorOnCurrentGlobalContext();
5849 }
5850 }
5851
GL_TexCoord4dv(const GLdouble * v)5852 void GL_APIENTRY GL_TexCoord4dv(const GLdouble *v)
5853 {
5854 Context *context = GetValidGlobalContext();
5855 EVENT(context, GLTexCoord4dv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
5856 (uintptr_t)v);
5857
5858 if (context)
5859 {
5860 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5861 bool isCallValid = (context->skipValidation() || ValidateTexCoord4dv(context, v));
5862 if (isCallValid)
5863 {
5864 context->texCoord4dv(v);
5865 }
5866 ANGLE_CAPTURE(TexCoord4dv, isCallValid, context, v);
5867 }
5868 else
5869 {
5870 GenerateContextLostErrorOnCurrentGlobalContext();
5871 }
5872 }
5873
GL_TexCoord4f(GLfloat s,GLfloat t,GLfloat r,GLfloat q)5874 void GL_APIENTRY GL_TexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
5875 {
5876 Context *context = GetValidGlobalContext();
5877 EVENT(context, GLTexCoord4f, "context = %d, s = %f, t = %f, r = %f, q = %f", CID(context), s, t,
5878 r, q);
5879
5880 if (context)
5881 {
5882 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5883 bool isCallValid = (context->skipValidation() || ValidateTexCoord4f(context, s, t, r, q));
5884 if (isCallValid)
5885 {
5886 context->texCoord4f(s, t, r, q);
5887 }
5888 ANGLE_CAPTURE(TexCoord4f, isCallValid, context, s, t, r, q);
5889 }
5890 else
5891 {
5892 GenerateContextLostErrorOnCurrentGlobalContext();
5893 }
5894 }
5895
GL_TexCoord4fv(const GLfloat * v)5896 void GL_APIENTRY GL_TexCoord4fv(const GLfloat *v)
5897 {
5898 Context *context = GetValidGlobalContext();
5899 EVENT(context, GLTexCoord4fv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
5900 (uintptr_t)v);
5901
5902 if (context)
5903 {
5904 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5905 bool isCallValid = (context->skipValidation() || ValidateTexCoord4fv(context, v));
5906 if (isCallValid)
5907 {
5908 context->texCoord4fv(v);
5909 }
5910 ANGLE_CAPTURE(TexCoord4fv, isCallValid, context, v);
5911 }
5912 else
5913 {
5914 GenerateContextLostErrorOnCurrentGlobalContext();
5915 }
5916 }
5917
GL_TexCoord4i(GLint s,GLint t,GLint r,GLint q)5918 void GL_APIENTRY GL_TexCoord4i(GLint s, GLint t, GLint r, GLint q)
5919 {
5920 Context *context = GetValidGlobalContext();
5921 EVENT(context, GLTexCoord4i, "context = %d, s = %d, t = %d, r = %d, q = %d", CID(context), s, t,
5922 r, q);
5923
5924 if (context)
5925 {
5926 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5927 bool isCallValid = (context->skipValidation() || ValidateTexCoord4i(context, s, t, r, q));
5928 if (isCallValid)
5929 {
5930 context->texCoord4i(s, t, r, q);
5931 }
5932 ANGLE_CAPTURE(TexCoord4i, isCallValid, context, s, t, r, q);
5933 }
5934 else
5935 {
5936 GenerateContextLostErrorOnCurrentGlobalContext();
5937 }
5938 }
5939
GL_TexCoord4iv(const GLint * v)5940 void GL_APIENTRY GL_TexCoord4iv(const GLint *v)
5941 {
5942 Context *context = GetValidGlobalContext();
5943 EVENT(context, GLTexCoord4iv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
5944 (uintptr_t)v);
5945
5946 if (context)
5947 {
5948 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5949 bool isCallValid = (context->skipValidation() || ValidateTexCoord4iv(context, v));
5950 if (isCallValid)
5951 {
5952 context->texCoord4iv(v);
5953 }
5954 ANGLE_CAPTURE(TexCoord4iv, isCallValid, context, v);
5955 }
5956 else
5957 {
5958 GenerateContextLostErrorOnCurrentGlobalContext();
5959 }
5960 }
5961
GL_TexCoord4s(GLshort s,GLshort t,GLshort r,GLshort q)5962 void GL_APIENTRY GL_TexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q)
5963 {
5964 Context *context = GetValidGlobalContext();
5965 EVENT(context, GLTexCoord4s, "context = %d, s = %d, t = %d, r = %d, q = %d", CID(context), s, t,
5966 r, q);
5967
5968 if (context)
5969 {
5970 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5971 bool isCallValid = (context->skipValidation() || ValidateTexCoord4s(context, s, t, r, q));
5972 if (isCallValid)
5973 {
5974 context->texCoord4s(s, t, r, q);
5975 }
5976 ANGLE_CAPTURE(TexCoord4s, isCallValid, context, s, t, r, q);
5977 }
5978 else
5979 {
5980 GenerateContextLostErrorOnCurrentGlobalContext();
5981 }
5982 }
5983
GL_TexCoord4sv(const GLshort * v)5984 void GL_APIENTRY GL_TexCoord4sv(const GLshort *v)
5985 {
5986 Context *context = GetValidGlobalContext();
5987 EVENT(context, GLTexCoord4sv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
5988 (uintptr_t)v);
5989
5990 if (context)
5991 {
5992 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
5993 bool isCallValid = (context->skipValidation() || ValidateTexCoord4sv(context, v));
5994 if (isCallValid)
5995 {
5996 context->texCoord4sv(v);
5997 }
5998 ANGLE_CAPTURE(TexCoord4sv, isCallValid, context, v);
5999 }
6000 else
6001 {
6002 GenerateContextLostErrorOnCurrentGlobalContext();
6003 }
6004 }
6005
GL_TexEnvf(GLenum target,GLenum pname,GLfloat param)6006 void GL_APIENTRY GL_TexEnvf(GLenum target, GLenum pname, GLfloat param)
6007 {
6008 Context *context = GetValidGlobalContext();
6009 EVENT(context, GLTexEnvf, "context = %d, target = %s, pname = %s, param = %f", CID(context),
6010 GLenumToString(GLenumGroup::TextureEnvTarget, target),
6011 GLenumToString(GLenumGroup::TextureEnvParameter, pname), param);
6012
6013 if (context)
6014 {
6015 TextureEnvTarget targetPacked = PackParam<TextureEnvTarget>(target);
6016 TextureEnvParameter pnamePacked = PackParam<TextureEnvParameter>(pname);
6017 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6018 bool isCallValid = (context->skipValidation() ||
6019 ValidateTexEnvf(context, targetPacked, pnamePacked, param));
6020 if (isCallValid)
6021 {
6022 context->texEnvf(targetPacked, pnamePacked, param);
6023 }
6024 ANGLE_CAPTURE(TexEnvf, isCallValid, context, targetPacked, pnamePacked, param);
6025 }
6026 else
6027 {
6028 GenerateContextLostErrorOnCurrentGlobalContext();
6029 }
6030 }
6031
GL_TexEnvfv(GLenum target,GLenum pname,const GLfloat * params)6032 void GL_APIENTRY GL_TexEnvfv(GLenum target, GLenum pname, const GLfloat *params)
6033 {
6034 Context *context = GetValidGlobalContext();
6035 EVENT(context, GLTexEnvfv, "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "",
6036 CID(context), GLenumToString(GLenumGroup::TextureEnvTarget, target),
6037 GLenumToString(GLenumGroup::TextureEnvParameter, pname), (uintptr_t)params);
6038
6039 if (context)
6040 {
6041 TextureEnvTarget targetPacked = PackParam<TextureEnvTarget>(target);
6042 TextureEnvParameter pnamePacked = PackParam<TextureEnvParameter>(pname);
6043 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6044 bool isCallValid = (context->skipValidation() ||
6045 ValidateTexEnvfv(context, targetPacked, pnamePacked, params));
6046 if (isCallValid)
6047 {
6048 context->texEnvfv(targetPacked, pnamePacked, params);
6049 }
6050 ANGLE_CAPTURE(TexEnvfv, isCallValid, context, targetPacked, pnamePacked, params);
6051 }
6052 else
6053 {
6054 GenerateContextLostErrorOnCurrentGlobalContext();
6055 }
6056 }
6057
GL_TexEnvi(GLenum target,GLenum pname,GLint param)6058 void GL_APIENTRY GL_TexEnvi(GLenum target, GLenum pname, GLint param)
6059 {
6060 Context *context = GetValidGlobalContext();
6061 EVENT(context, GLTexEnvi, "context = %d, target = %s, pname = %s, param = %d", CID(context),
6062 GLenumToString(GLenumGroup::TextureEnvTarget, target),
6063 GLenumToString(GLenumGroup::TextureEnvParameter, pname), param);
6064
6065 if (context)
6066 {
6067 TextureEnvTarget targetPacked = PackParam<TextureEnvTarget>(target);
6068 TextureEnvParameter pnamePacked = PackParam<TextureEnvParameter>(pname);
6069 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6070 bool isCallValid = (context->skipValidation() ||
6071 ValidateTexEnvi(context, targetPacked, pnamePacked, param));
6072 if (isCallValid)
6073 {
6074 context->texEnvi(targetPacked, pnamePacked, param);
6075 }
6076 ANGLE_CAPTURE(TexEnvi, isCallValid, context, targetPacked, pnamePacked, param);
6077 }
6078 else
6079 {
6080 GenerateContextLostErrorOnCurrentGlobalContext();
6081 }
6082 }
6083
GL_TexEnviv(GLenum target,GLenum pname,const GLint * params)6084 void GL_APIENTRY GL_TexEnviv(GLenum target, GLenum pname, const GLint *params)
6085 {
6086 Context *context = GetValidGlobalContext();
6087 EVENT(context, GLTexEnviv, "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "",
6088 CID(context), GLenumToString(GLenumGroup::TextureEnvTarget, target),
6089 GLenumToString(GLenumGroup::TextureEnvParameter, pname), (uintptr_t)params);
6090
6091 if (context)
6092 {
6093 TextureEnvTarget targetPacked = PackParam<TextureEnvTarget>(target);
6094 TextureEnvParameter pnamePacked = PackParam<TextureEnvParameter>(pname);
6095 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6096 bool isCallValid = (context->skipValidation() ||
6097 ValidateTexEnviv(context, targetPacked, pnamePacked, params));
6098 if (isCallValid)
6099 {
6100 context->texEnviv(targetPacked, pnamePacked, params);
6101 }
6102 ANGLE_CAPTURE(TexEnviv, isCallValid, context, targetPacked, pnamePacked, params);
6103 }
6104 else
6105 {
6106 GenerateContextLostErrorOnCurrentGlobalContext();
6107 }
6108 }
6109
GL_TexGend(GLenum coord,GLenum pname,GLdouble param)6110 void GL_APIENTRY GL_TexGend(GLenum coord, GLenum pname, GLdouble param)
6111 {
6112 Context *context = GetValidGlobalContext();
6113 EVENT(context, GLTexGend, "context = %d, coord = %s, pname = %s, param = %f", CID(context),
6114 GLenumToString(GLenumGroup::TextureCoordName, coord),
6115 GLenumToString(GLenumGroup::TextureGenParameter, pname), param);
6116
6117 if (context)
6118 {
6119 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6120 bool isCallValid =
6121 (context->skipValidation() || ValidateTexGend(context, coord, pname, param));
6122 if (isCallValid)
6123 {
6124 context->texGend(coord, pname, param);
6125 }
6126 ANGLE_CAPTURE(TexGend, isCallValid, context, coord, pname, param);
6127 }
6128 else
6129 {
6130 GenerateContextLostErrorOnCurrentGlobalContext();
6131 }
6132 }
6133
GL_TexGendv(GLenum coord,GLenum pname,const GLdouble * params)6134 void GL_APIENTRY GL_TexGendv(GLenum coord, GLenum pname, const GLdouble *params)
6135 {
6136 Context *context = GetValidGlobalContext();
6137 EVENT(context, GLTexGendv, "context = %d, coord = %s, pname = %s, params = 0x%016" PRIxPTR "",
6138 CID(context), GLenumToString(GLenumGroup::TextureCoordName, coord),
6139 GLenumToString(GLenumGroup::TextureGenParameter, pname), (uintptr_t)params);
6140
6141 if (context)
6142 {
6143 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6144 bool isCallValid =
6145 (context->skipValidation() || ValidateTexGendv(context, coord, pname, params));
6146 if (isCallValid)
6147 {
6148 context->texGendv(coord, pname, params);
6149 }
6150 ANGLE_CAPTURE(TexGendv, isCallValid, context, coord, pname, params);
6151 }
6152 else
6153 {
6154 GenerateContextLostErrorOnCurrentGlobalContext();
6155 }
6156 }
6157
GL_TexGenf(GLenum coord,GLenum pname,GLfloat param)6158 void GL_APIENTRY GL_TexGenf(GLenum coord, GLenum pname, GLfloat param)
6159 {
6160 Context *context = GetValidGlobalContext();
6161 EVENT(context, GLTexGenf, "context = %d, coord = %s, pname = %s, param = %f", CID(context),
6162 GLenumToString(GLenumGroup::TextureCoordName, coord),
6163 GLenumToString(GLenumGroup::TextureGenParameter, pname), param);
6164
6165 if (context)
6166 {
6167 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6168 bool isCallValid =
6169 (context->skipValidation() || ValidateTexGenf(context, coord, pname, param));
6170 if (isCallValid)
6171 {
6172 context->texGenf(coord, pname, param);
6173 }
6174 ANGLE_CAPTURE(TexGenf, isCallValid, context, coord, pname, param);
6175 }
6176 else
6177 {
6178 GenerateContextLostErrorOnCurrentGlobalContext();
6179 }
6180 }
6181
GL_TexGenfv(GLenum coord,GLenum pname,const GLfloat * params)6182 void GL_APIENTRY GL_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params)
6183 {
6184 Context *context = GetValidGlobalContext();
6185 EVENT(context, GLTexGenfv, "context = %d, coord = %s, pname = %s, params = 0x%016" PRIxPTR "",
6186 CID(context), GLenumToString(GLenumGroup::TextureCoordName, coord),
6187 GLenumToString(GLenumGroup::TextureGenParameter, pname), (uintptr_t)params);
6188
6189 if (context)
6190 {
6191 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6192 bool isCallValid =
6193 (context->skipValidation() || ValidateTexGenfv(context, coord, pname, params));
6194 if (isCallValid)
6195 {
6196 context->texGenfv(coord, pname, params);
6197 }
6198 ANGLE_CAPTURE(TexGenfv, isCallValid, context, coord, pname, params);
6199 }
6200 else
6201 {
6202 GenerateContextLostErrorOnCurrentGlobalContext();
6203 }
6204 }
6205
GL_TexGeni(GLenum coord,GLenum pname,GLint param)6206 void GL_APIENTRY GL_TexGeni(GLenum coord, GLenum pname, GLint param)
6207 {
6208 Context *context = GetValidGlobalContext();
6209 EVENT(context, GLTexGeni, "context = %d, coord = %s, pname = %s, param = %d", CID(context),
6210 GLenumToString(GLenumGroup::TextureCoordName, coord),
6211 GLenumToString(GLenumGroup::TextureGenParameter, pname), param);
6212
6213 if (context)
6214 {
6215 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6216 bool isCallValid =
6217 (context->skipValidation() || ValidateTexGeni(context, coord, pname, param));
6218 if (isCallValid)
6219 {
6220 context->texGeni(coord, pname, param);
6221 }
6222 ANGLE_CAPTURE(TexGeni, isCallValid, context, coord, pname, param);
6223 }
6224 else
6225 {
6226 GenerateContextLostErrorOnCurrentGlobalContext();
6227 }
6228 }
6229
GL_TexGeniv(GLenum coord,GLenum pname,const GLint * params)6230 void GL_APIENTRY GL_TexGeniv(GLenum coord, GLenum pname, const GLint *params)
6231 {
6232 Context *context = GetValidGlobalContext();
6233 EVENT(context, GLTexGeniv, "context = %d, coord = %s, pname = %s, params = 0x%016" PRIxPTR "",
6234 CID(context), GLenumToString(GLenumGroup::TextureCoordName, coord),
6235 GLenumToString(GLenumGroup::TextureGenParameter, pname), (uintptr_t)params);
6236
6237 if (context)
6238 {
6239 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6240 bool isCallValid =
6241 (context->skipValidation() || ValidateTexGeniv(context, coord, pname, params));
6242 if (isCallValid)
6243 {
6244 context->texGeniv(coord, pname, params);
6245 }
6246 ANGLE_CAPTURE(TexGeniv, isCallValid, context, coord, pname, params);
6247 }
6248 else
6249 {
6250 GenerateContextLostErrorOnCurrentGlobalContext();
6251 }
6252 }
6253
GL_TexImage1D(GLenum target,GLint level,GLint internalformat,GLsizei width,GLint border,GLenum format,GLenum type,const void * pixels)6254 void GL_APIENTRY GL_TexImage1D(GLenum target,
6255 GLint level,
6256 GLint internalformat,
6257 GLsizei width,
6258 GLint border,
6259 GLenum format,
6260 GLenum type,
6261 const void *pixels)
6262 {
6263 Context *context = GetValidGlobalContext();
6264 EVENT(context, GLTexImage1D,
6265 "context = %d, target = %s, level = %d, internalformat = %d, width = %d, border = %d, "
6266 "format = %s, type = %s, pixels = 0x%016" PRIxPTR "",
6267 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, internalformat,
6268 width, border, GLenumToString(GLenumGroup::PixelFormat, format),
6269 GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)pixels);
6270
6271 if (context)
6272 {
6273 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6274 bool isCallValid =
6275 (context->skipValidation() || ValidateTexImage1D(context, target, level, internalformat,
6276 width, border, format, type, pixels));
6277 if (isCallValid)
6278 {
6279 context->texImage1D(target, level, internalformat, width, border, format, type, pixels);
6280 }
6281 ANGLE_CAPTURE(TexImage1D, isCallValid, context, target, level, internalformat, width,
6282 border, format, type, pixels);
6283 }
6284 else
6285 {
6286 GenerateContextLostErrorOnCurrentGlobalContext();
6287 }
6288 }
6289
GL_TexImage2D(GLenum target,GLint level,GLint internalformat,GLsizei width,GLsizei height,GLint border,GLenum format,GLenum type,const void * pixels)6290 void GL_APIENTRY GL_TexImage2D(GLenum target,
6291 GLint level,
6292 GLint internalformat,
6293 GLsizei width,
6294 GLsizei height,
6295 GLint border,
6296 GLenum format,
6297 GLenum type,
6298 const void *pixels)
6299 {
6300 Context *context = GetValidGlobalContext();
6301 EVENT(context, GLTexImage2D,
6302 "context = %d, target = %s, level = %d, internalformat = %d, width = %d, height = %d, "
6303 "border = %d, format = %s, type = %s, pixels = 0x%016" PRIxPTR "",
6304 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, internalformat,
6305 width, height, border, GLenumToString(GLenumGroup::PixelFormat, format),
6306 GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)pixels);
6307
6308 if (context)
6309 {
6310 TextureTarget targetPacked = PackParam<TextureTarget>(target);
6311 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6312 bool isCallValid = (context->skipValidation() ||
6313 ValidateTexImage2D(context, targetPacked, level, internalformat, width,
6314 height, border, format, type, pixels));
6315 if (isCallValid)
6316 {
6317 context->texImage2D(targetPacked, level, internalformat, width, height, border, format,
6318 type, pixels);
6319 }
6320 ANGLE_CAPTURE(TexImage2D, isCallValid, context, targetPacked, level, internalformat, width,
6321 height, border, format, type, pixels);
6322 }
6323 else
6324 {
6325 GenerateContextLostErrorOnCurrentGlobalContext();
6326 }
6327 }
6328
GL_TexParameterf(GLenum target,GLenum pname,GLfloat param)6329 void GL_APIENTRY GL_TexParameterf(GLenum target, GLenum pname, GLfloat param)
6330 {
6331 Context *context = GetValidGlobalContext();
6332 EVENT(context, GLTexParameterf, "context = %d, target = %s, pname = %s, param = %f",
6333 CID(context), GLenumToString(GLenumGroup::TextureTarget, target),
6334 GLenumToString(GLenumGroup::TextureParameterName, pname), param);
6335
6336 if (context)
6337 {
6338 TextureType targetPacked = PackParam<TextureType>(target);
6339 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6340 bool isCallValid = (context->skipValidation() ||
6341 ValidateTexParameterf(context, targetPacked, pname, param));
6342 if (isCallValid)
6343 {
6344 context->texParameterf(targetPacked, pname, param);
6345 }
6346 ANGLE_CAPTURE(TexParameterf, isCallValid, context, targetPacked, pname, param);
6347 }
6348 else
6349 {
6350 GenerateContextLostErrorOnCurrentGlobalContext();
6351 }
6352 }
6353
GL_TexParameterfv(GLenum target,GLenum pname,const GLfloat * params)6354 void GL_APIENTRY GL_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
6355 {
6356 Context *context = GetValidGlobalContext();
6357 EVENT(context, GLTexParameterfv,
6358 "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
6359 GLenumToString(GLenumGroup::TextureTarget, target),
6360 GLenumToString(GLenumGroup::TextureParameterName, pname), (uintptr_t)params);
6361
6362 if (context)
6363 {
6364 TextureType targetPacked = PackParam<TextureType>(target);
6365 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6366 bool isCallValid = (context->skipValidation() ||
6367 ValidateTexParameterfv(context, targetPacked, pname, params));
6368 if (isCallValid)
6369 {
6370 context->texParameterfv(targetPacked, pname, params);
6371 }
6372 ANGLE_CAPTURE(TexParameterfv, isCallValid, context, targetPacked, pname, params);
6373 }
6374 else
6375 {
6376 GenerateContextLostErrorOnCurrentGlobalContext();
6377 }
6378 }
6379
GL_TexParameteri(GLenum target,GLenum pname,GLint param)6380 void GL_APIENTRY GL_TexParameteri(GLenum target, GLenum pname, GLint param)
6381 {
6382 Context *context = GetValidGlobalContext();
6383 EVENT(context, GLTexParameteri, "context = %d, target = %s, pname = %s, param = %d",
6384 CID(context), GLenumToString(GLenumGroup::TextureTarget, target),
6385 GLenumToString(GLenumGroup::TextureParameterName, pname), param);
6386
6387 if (context)
6388 {
6389 TextureType targetPacked = PackParam<TextureType>(target);
6390 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6391 bool isCallValid = (context->skipValidation() ||
6392 ValidateTexParameteri(context, targetPacked, pname, param));
6393 if (isCallValid)
6394 {
6395 context->texParameteri(targetPacked, pname, param);
6396 }
6397 ANGLE_CAPTURE(TexParameteri, isCallValid, context, targetPacked, pname, param);
6398 }
6399 else
6400 {
6401 GenerateContextLostErrorOnCurrentGlobalContext();
6402 }
6403 }
6404
GL_TexParameteriv(GLenum target,GLenum pname,const GLint * params)6405 void GL_APIENTRY GL_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
6406 {
6407 Context *context = GetValidGlobalContext();
6408 EVENT(context, GLTexParameteriv,
6409 "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
6410 GLenumToString(GLenumGroup::TextureTarget, target),
6411 GLenumToString(GLenumGroup::TextureParameterName, pname), (uintptr_t)params);
6412
6413 if (context)
6414 {
6415 TextureType targetPacked = PackParam<TextureType>(target);
6416 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6417 bool isCallValid = (context->skipValidation() ||
6418 ValidateTexParameteriv(context, targetPacked, pname, params));
6419 if (isCallValid)
6420 {
6421 context->texParameteriv(targetPacked, pname, params);
6422 }
6423 ANGLE_CAPTURE(TexParameteriv, isCallValid, context, targetPacked, pname, params);
6424 }
6425 else
6426 {
6427 GenerateContextLostErrorOnCurrentGlobalContext();
6428 }
6429 }
6430
GL_Translated(GLdouble x,GLdouble y,GLdouble z)6431 void GL_APIENTRY GL_Translated(GLdouble x, GLdouble y, GLdouble z)
6432 {
6433 Context *context = GetValidGlobalContext();
6434 EVENT(context, GLTranslated, "context = %d, x = %f, y = %f, z = %f", CID(context), x, y, z);
6435
6436 if (context)
6437 {
6438 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6439 bool isCallValid = (context->skipValidation() || ValidateTranslated(context, x, y, z));
6440 if (isCallValid)
6441 {
6442 context->translated(x, y, z);
6443 }
6444 ANGLE_CAPTURE(Translated, isCallValid, context, x, y, z);
6445 }
6446 else
6447 {
6448 GenerateContextLostErrorOnCurrentGlobalContext();
6449 }
6450 }
6451
GL_Translatef(GLfloat x,GLfloat y,GLfloat z)6452 void GL_APIENTRY GL_Translatef(GLfloat x, GLfloat y, GLfloat z)
6453 {
6454 Context *context = GetValidGlobalContext();
6455 EVENT(context, GLTranslatef, "context = %d, x = %f, y = %f, z = %f", CID(context), x, y, z);
6456
6457 if (context)
6458 {
6459 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6460 bool isCallValid = (context->skipValidation() || ValidateTranslatef(context, x, y, z));
6461 if (isCallValid)
6462 {
6463 context->translatef(x, y, z);
6464 }
6465 ANGLE_CAPTURE(Translatef, isCallValid, context, x, y, z);
6466 }
6467 else
6468 {
6469 GenerateContextLostErrorOnCurrentGlobalContext();
6470 }
6471 }
6472
GL_Vertex2d(GLdouble x,GLdouble y)6473 void GL_APIENTRY GL_Vertex2d(GLdouble x, GLdouble y)
6474 {
6475 Context *context = GetValidGlobalContext();
6476 EVENT(context, GLVertex2d, "context = %d, x = %f, y = %f", CID(context), x, y);
6477
6478 if (context)
6479 {
6480 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6481 bool isCallValid = (context->skipValidation() || ValidateVertex2d(context, x, y));
6482 if (isCallValid)
6483 {
6484 context->vertex2d(x, y);
6485 }
6486 ANGLE_CAPTURE(Vertex2d, isCallValid, context, x, y);
6487 }
6488 else
6489 {
6490 GenerateContextLostErrorOnCurrentGlobalContext();
6491 }
6492 }
6493
GL_Vertex2dv(const GLdouble * v)6494 void GL_APIENTRY GL_Vertex2dv(const GLdouble *v)
6495 {
6496 Context *context = GetValidGlobalContext();
6497 EVENT(context, GLVertex2dv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
6498
6499 if (context)
6500 {
6501 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6502 bool isCallValid = (context->skipValidation() || ValidateVertex2dv(context, v));
6503 if (isCallValid)
6504 {
6505 context->vertex2dv(v);
6506 }
6507 ANGLE_CAPTURE(Vertex2dv, isCallValid, context, v);
6508 }
6509 else
6510 {
6511 GenerateContextLostErrorOnCurrentGlobalContext();
6512 }
6513 }
6514
GL_Vertex2f(GLfloat x,GLfloat y)6515 void GL_APIENTRY GL_Vertex2f(GLfloat x, GLfloat y)
6516 {
6517 Context *context = GetValidGlobalContext();
6518 EVENT(context, GLVertex2f, "context = %d, x = %f, y = %f", CID(context), x, y);
6519
6520 if (context)
6521 {
6522 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6523 bool isCallValid = (context->skipValidation() || ValidateVertex2f(context, x, y));
6524 if (isCallValid)
6525 {
6526 context->vertex2f(x, y);
6527 }
6528 ANGLE_CAPTURE(Vertex2f, isCallValid, context, x, y);
6529 }
6530 else
6531 {
6532 GenerateContextLostErrorOnCurrentGlobalContext();
6533 }
6534 }
6535
GL_Vertex2fv(const GLfloat * v)6536 void GL_APIENTRY GL_Vertex2fv(const GLfloat *v)
6537 {
6538 Context *context = GetValidGlobalContext();
6539 EVENT(context, GLVertex2fv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
6540
6541 if (context)
6542 {
6543 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6544 bool isCallValid = (context->skipValidation() || ValidateVertex2fv(context, v));
6545 if (isCallValid)
6546 {
6547 context->vertex2fv(v);
6548 }
6549 ANGLE_CAPTURE(Vertex2fv, isCallValid, context, v);
6550 }
6551 else
6552 {
6553 GenerateContextLostErrorOnCurrentGlobalContext();
6554 }
6555 }
6556
GL_Vertex2i(GLint x,GLint y)6557 void GL_APIENTRY GL_Vertex2i(GLint x, GLint y)
6558 {
6559 Context *context = GetValidGlobalContext();
6560 EVENT(context, GLVertex2i, "context = %d, x = %d, y = %d", CID(context), x, y);
6561
6562 if (context)
6563 {
6564 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6565 bool isCallValid = (context->skipValidation() || ValidateVertex2i(context, x, y));
6566 if (isCallValid)
6567 {
6568 context->vertex2i(x, y);
6569 }
6570 ANGLE_CAPTURE(Vertex2i, isCallValid, context, x, y);
6571 }
6572 else
6573 {
6574 GenerateContextLostErrorOnCurrentGlobalContext();
6575 }
6576 }
6577
GL_Vertex2iv(const GLint * v)6578 void GL_APIENTRY GL_Vertex2iv(const GLint *v)
6579 {
6580 Context *context = GetValidGlobalContext();
6581 EVENT(context, GLVertex2iv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
6582
6583 if (context)
6584 {
6585 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6586 bool isCallValid = (context->skipValidation() || ValidateVertex2iv(context, v));
6587 if (isCallValid)
6588 {
6589 context->vertex2iv(v);
6590 }
6591 ANGLE_CAPTURE(Vertex2iv, isCallValid, context, v);
6592 }
6593 else
6594 {
6595 GenerateContextLostErrorOnCurrentGlobalContext();
6596 }
6597 }
6598
GL_Vertex2s(GLshort x,GLshort y)6599 void GL_APIENTRY GL_Vertex2s(GLshort x, GLshort y)
6600 {
6601 Context *context = GetValidGlobalContext();
6602 EVENT(context, GLVertex2s, "context = %d, x = %d, y = %d", CID(context), x, y);
6603
6604 if (context)
6605 {
6606 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6607 bool isCallValid = (context->skipValidation() || ValidateVertex2s(context, x, y));
6608 if (isCallValid)
6609 {
6610 context->vertex2s(x, y);
6611 }
6612 ANGLE_CAPTURE(Vertex2s, isCallValid, context, x, y);
6613 }
6614 else
6615 {
6616 GenerateContextLostErrorOnCurrentGlobalContext();
6617 }
6618 }
6619
GL_Vertex2sv(const GLshort * v)6620 void GL_APIENTRY GL_Vertex2sv(const GLshort *v)
6621 {
6622 Context *context = GetValidGlobalContext();
6623 EVENT(context, GLVertex2sv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
6624
6625 if (context)
6626 {
6627 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6628 bool isCallValid = (context->skipValidation() || ValidateVertex2sv(context, v));
6629 if (isCallValid)
6630 {
6631 context->vertex2sv(v);
6632 }
6633 ANGLE_CAPTURE(Vertex2sv, isCallValid, context, v);
6634 }
6635 else
6636 {
6637 GenerateContextLostErrorOnCurrentGlobalContext();
6638 }
6639 }
6640
GL_Vertex3d(GLdouble x,GLdouble y,GLdouble z)6641 void GL_APIENTRY GL_Vertex3d(GLdouble x, GLdouble y, GLdouble z)
6642 {
6643 Context *context = GetValidGlobalContext();
6644 EVENT(context, GLVertex3d, "context = %d, x = %f, y = %f, z = %f", CID(context), x, y, z);
6645
6646 if (context)
6647 {
6648 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6649 bool isCallValid = (context->skipValidation() || ValidateVertex3d(context, x, y, z));
6650 if (isCallValid)
6651 {
6652 context->vertex3d(x, y, z);
6653 }
6654 ANGLE_CAPTURE(Vertex3d, isCallValid, context, x, y, z);
6655 }
6656 else
6657 {
6658 GenerateContextLostErrorOnCurrentGlobalContext();
6659 }
6660 }
6661
GL_Vertex3dv(const GLdouble * v)6662 void GL_APIENTRY GL_Vertex3dv(const GLdouble *v)
6663 {
6664 Context *context = GetValidGlobalContext();
6665 EVENT(context, GLVertex3dv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
6666
6667 if (context)
6668 {
6669 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6670 bool isCallValid = (context->skipValidation() || ValidateVertex3dv(context, v));
6671 if (isCallValid)
6672 {
6673 context->vertex3dv(v);
6674 }
6675 ANGLE_CAPTURE(Vertex3dv, isCallValid, context, v);
6676 }
6677 else
6678 {
6679 GenerateContextLostErrorOnCurrentGlobalContext();
6680 }
6681 }
6682
GL_Vertex3f(GLfloat x,GLfloat y,GLfloat z)6683 void GL_APIENTRY GL_Vertex3f(GLfloat x, GLfloat y, GLfloat z)
6684 {
6685 Context *context = GetValidGlobalContext();
6686 EVENT(context, GLVertex3f, "context = %d, x = %f, y = %f, z = %f", CID(context), x, y, z);
6687
6688 if (context)
6689 {
6690 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6691 bool isCallValid = (context->skipValidation() || ValidateVertex3f(context, x, y, z));
6692 if (isCallValid)
6693 {
6694 context->vertex3f(x, y, z);
6695 }
6696 ANGLE_CAPTURE(Vertex3f, isCallValid, context, x, y, z);
6697 }
6698 else
6699 {
6700 GenerateContextLostErrorOnCurrentGlobalContext();
6701 }
6702 }
6703
GL_Vertex3fv(const GLfloat * v)6704 void GL_APIENTRY GL_Vertex3fv(const GLfloat *v)
6705 {
6706 Context *context = GetValidGlobalContext();
6707 EVENT(context, GLVertex3fv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
6708
6709 if (context)
6710 {
6711 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6712 bool isCallValid = (context->skipValidation() || ValidateVertex3fv(context, v));
6713 if (isCallValid)
6714 {
6715 context->vertex3fv(v);
6716 }
6717 ANGLE_CAPTURE(Vertex3fv, isCallValid, context, v);
6718 }
6719 else
6720 {
6721 GenerateContextLostErrorOnCurrentGlobalContext();
6722 }
6723 }
6724
GL_Vertex3i(GLint x,GLint y,GLint z)6725 void GL_APIENTRY GL_Vertex3i(GLint x, GLint y, GLint z)
6726 {
6727 Context *context = GetValidGlobalContext();
6728 EVENT(context, GLVertex3i, "context = %d, x = %d, y = %d, z = %d", CID(context), x, y, z);
6729
6730 if (context)
6731 {
6732 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6733 bool isCallValid = (context->skipValidation() || ValidateVertex3i(context, x, y, z));
6734 if (isCallValid)
6735 {
6736 context->vertex3i(x, y, z);
6737 }
6738 ANGLE_CAPTURE(Vertex3i, isCallValid, context, x, y, z);
6739 }
6740 else
6741 {
6742 GenerateContextLostErrorOnCurrentGlobalContext();
6743 }
6744 }
6745
GL_Vertex3iv(const GLint * v)6746 void GL_APIENTRY GL_Vertex3iv(const GLint *v)
6747 {
6748 Context *context = GetValidGlobalContext();
6749 EVENT(context, GLVertex3iv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
6750
6751 if (context)
6752 {
6753 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6754 bool isCallValid = (context->skipValidation() || ValidateVertex3iv(context, v));
6755 if (isCallValid)
6756 {
6757 context->vertex3iv(v);
6758 }
6759 ANGLE_CAPTURE(Vertex3iv, isCallValid, context, v);
6760 }
6761 else
6762 {
6763 GenerateContextLostErrorOnCurrentGlobalContext();
6764 }
6765 }
6766
GL_Vertex3s(GLshort x,GLshort y,GLshort z)6767 void GL_APIENTRY GL_Vertex3s(GLshort x, GLshort y, GLshort z)
6768 {
6769 Context *context = GetValidGlobalContext();
6770 EVENT(context, GLVertex3s, "context = %d, x = %d, y = %d, z = %d", CID(context), x, y, z);
6771
6772 if (context)
6773 {
6774 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6775 bool isCallValid = (context->skipValidation() || ValidateVertex3s(context, x, y, z));
6776 if (isCallValid)
6777 {
6778 context->vertex3s(x, y, z);
6779 }
6780 ANGLE_CAPTURE(Vertex3s, isCallValid, context, x, y, z);
6781 }
6782 else
6783 {
6784 GenerateContextLostErrorOnCurrentGlobalContext();
6785 }
6786 }
6787
GL_Vertex3sv(const GLshort * v)6788 void GL_APIENTRY GL_Vertex3sv(const GLshort *v)
6789 {
6790 Context *context = GetValidGlobalContext();
6791 EVENT(context, GLVertex3sv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
6792
6793 if (context)
6794 {
6795 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6796 bool isCallValid = (context->skipValidation() || ValidateVertex3sv(context, v));
6797 if (isCallValid)
6798 {
6799 context->vertex3sv(v);
6800 }
6801 ANGLE_CAPTURE(Vertex3sv, isCallValid, context, v);
6802 }
6803 else
6804 {
6805 GenerateContextLostErrorOnCurrentGlobalContext();
6806 }
6807 }
6808
GL_Vertex4d(GLdouble x,GLdouble y,GLdouble z,GLdouble w)6809 void GL_APIENTRY GL_Vertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
6810 {
6811 Context *context = GetValidGlobalContext();
6812 EVENT(context, GLVertex4d, "context = %d, x = %f, y = %f, z = %f, w = %f", CID(context), x, y,
6813 z, w);
6814
6815 if (context)
6816 {
6817 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6818 bool isCallValid = (context->skipValidation() || ValidateVertex4d(context, x, y, z, w));
6819 if (isCallValid)
6820 {
6821 context->vertex4d(x, y, z, w);
6822 }
6823 ANGLE_CAPTURE(Vertex4d, isCallValid, context, x, y, z, w);
6824 }
6825 else
6826 {
6827 GenerateContextLostErrorOnCurrentGlobalContext();
6828 }
6829 }
6830
GL_Vertex4dv(const GLdouble * v)6831 void GL_APIENTRY GL_Vertex4dv(const GLdouble *v)
6832 {
6833 Context *context = GetValidGlobalContext();
6834 EVENT(context, GLVertex4dv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
6835
6836 if (context)
6837 {
6838 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6839 bool isCallValid = (context->skipValidation() || ValidateVertex4dv(context, v));
6840 if (isCallValid)
6841 {
6842 context->vertex4dv(v);
6843 }
6844 ANGLE_CAPTURE(Vertex4dv, isCallValid, context, v);
6845 }
6846 else
6847 {
6848 GenerateContextLostErrorOnCurrentGlobalContext();
6849 }
6850 }
6851
GL_Vertex4f(GLfloat x,GLfloat y,GLfloat z,GLfloat w)6852 void GL_APIENTRY GL_Vertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
6853 {
6854 Context *context = GetValidGlobalContext();
6855 EVENT(context, GLVertex4f, "context = %d, x = %f, y = %f, z = %f, w = %f", CID(context), x, y,
6856 z, w);
6857
6858 if (context)
6859 {
6860 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6861 bool isCallValid = (context->skipValidation() || ValidateVertex4f(context, x, y, z, w));
6862 if (isCallValid)
6863 {
6864 context->vertex4f(x, y, z, w);
6865 }
6866 ANGLE_CAPTURE(Vertex4f, isCallValid, context, x, y, z, w);
6867 }
6868 else
6869 {
6870 GenerateContextLostErrorOnCurrentGlobalContext();
6871 }
6872 }
6873
GL_Vertex4fv(const GLfloat * v)6874 void GL_APIENTRY GL_Vertex4fv(const GLfloat *v)
6875 {
6876 Context *context = GetValidGlobalContext();
6877 EVENT(context, GLVertex4fv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
6878
6879 if (context)
6880 {
6881 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6882 bool isCallValid = (context->skipValidation() || ValidateVertex4fv(context, v));
6883 if (isCallValid)
6884 {
6885 context->vertex4fv(v);
6886 }
6887 ANGLE_CAPTURE(Vertex4fv, isCallValid, context, v);
6888 }
6889 else
6890 {
6891 GenerateContextLostErrorOnCurrentGlobalContext();
6892 }
6893 }
6894
GL_Vertex4i(GLint x,GLint y,GLint z,GLint w)6895 void GL_APIENTRY GL_Vertex4i(GLint x, GLint y, GLint z, GLint w)
6896 {
6897 Context *context = GetValidGlobalContext();
6898 EVENT(context, GLVertex4i, "context = %d, x = %d, y = %d, z = %d, w = %d", CID(context), x, y,
6899 z, w);
6900
6901 if (context)
6902 {
6903 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6904 bool isCallValid = (context->skipValidation() || ValidateVertex4i(context, x, y, z, w));
6905 if (isCallValid)
6906 {
6907 context->vertex4i(x, y, z, w);
6908 }
6909 ANGLE_CAPTURE(Vertex4i, isCallValid, context, x, y, z, w);
6910 }
6911 else
6912 {
6913 GenerateContextLostErrorOnCurrentGlobalContext();
6914 }
6915 }
6916
GL_Vertex4iv(const GLint * v)6917 void GL_APIENTRY GL_Vertex4iv(const GLint *v)
6918 {
6919 Context *context = GetValidGlobalContext();
6920 EVENT(context, GLVertex4iv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
6921
6922 if (context)
6923 {
6924 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6925 bool isCallValid = (context->skipValidation() || ValidateVertex4iv(context, v));
6926 if (isCallValid)
6927 {
6928 context->vertex4iv(v);
6929 }
6930 ANGLE_CAPTURE(Vertex4iv, isCallValid, context, v);
6931 }
6932 else
6933 {
6934 GenerateContextLostErrorOnCurrentGlobalContext();
6935 }
6936 }
6937
GL_Vertex4s(GLshort x,GLshort y,GLshort z,GLshort w)6938 void GL_APIENTRY GL_Vertex4s(GLshort x, GLshort y, GLshort z, GLshort w)
6939 {
6940 Context *context = GetValidGlobalContext();
6941 EVENT(context, GLVertex4s, "context = %d, x = %d, y = %d, z = %d, w = %d", CID(context), x, y,
6942 z, w);
6943
6944 if (context)
6945 {
6946 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6947 bool isCallValid = (context->skipValidation() || ValidateVertex4s(context, x, y, z, w));
6948 if (isCallValid)
6949 {
6950 context->vertex4s(x, y, z, w);
6951 }
6952 ANGLE_CAPTURE(Vertex4s, isCallValid, context, x, y, z, w);
6953 }
6954 else
6955 {
6956 GenerateContextLostErrorOnCurrentGlobalContext();
6957 }
6958 }
6959
GL_Vertex4sv(const GLshort * v)6960 void GL_APIENTRY GL_Vertex4sv(const GLshort *v)
6961 {
6962 Context *context = GetValidGlobalContext();
6963 EVENT(context, GLVertex4sv, "context = %d, v = 0x%016" PRIxPTR "", CID(context), (uintptr_t)v);
6964
6965 if (context)
6966 {
6967 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6968 bool isCallValid = (context->skipValidation() || ValidateVertex4sv(context, v));
6969 if (isCallValid)
6970 {
6971 context->vertex4sv(v);
6972 }
6973 ANGLE_CAPTURE(Vertex4sv, isCallValid, context, v);
6974 }
6975 else
6976 {
6977 GenerateContextLostErrorOnCurrentGlobalContext();
6978 }
6979 }
6980
GL_Viewport(GLint x,GLint y,GLsizei width,GLsizei height)6981 void GL_APIENTRY GL_Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
6982 {
6983 Context *context = GetValidGlobalContext();
6984 EVENT(context, GLViewport, "context = %d, x = %d, y = %d, width = %d, height = %d",
6985 CID(context), x, y, width, height);
6986
6987 if (context)
6988 {
6989 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
6990 bool isCallValid =
6991 (context->skipValidation() || ValidateViewport(context, x, y, width, height));
6992 if (isCallValid)
6993 {
6994 context->viewport(x, y, width, height);
6995 }
6996 ANGLE_CAPTURE(Viewport, isCallValid, context, x, y, width, height);
6997 }
6998 else
6999 {
7000 GenerateContextLostErrorOnCurrentGlobalContext();
7001 }
7002 }
7003
7004 // GL 1.1
GL_AreTexturesResident(GLsizei n,const GLuint * textures,GLboolean * residences)7005 GLboolean GL_APIENTRY GL_AreTexturesResident(GLsizei n,
7006 const GLuint *textures,
7007 GLboolean *residences)
7008 {
7009 Context *context = GetValidGlobalContext();
7010 EVENT(context, GLAreTexturesResident,
7011 "context = %d, n = %d, textures = 0x%016" PRIxPTR ", residences = 0x%016" PRIxPTR "",
7012 CID(context), n, (uintptr_t)textures, (uintptr_t)residences);
7013
7014 GLboolean returnValue;
7015 if (context)
7016 {
7017 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7018 bool isCallValid = (context->skipValidation() ||
7019 ValidateAreTexturesResident(context, n, textures, residences));
7020 if (isCallValid)
7021 {
7022 returnValue = context->areTexturesResident(n, textures, residences);
7023 }
7024 else
7025 {
7026 returnValue =
7027 GetDefaultReturnValue<angle::EntryPoint::GLAreTexturesResident, GLboolean>();
7028 }
7029 ANGLE_CAPTURE(AreTexturesResident, isCallValid, context, n, textures, residences,
7030 returnValue);
7031 }
7032 else
7033 {
7034 GenerateContextLostErrorOnCurrentGlobalContext();
7035 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLAreTexturesResident, GLboolean>();
7036 }
7037 return returnValue;
7038 }
7039
GL_ArrayElement(GLint i)7040 void GL_APIENTRY GL_ArrayElement(GLint i)
7041 {
7042 Context *context = GetValidGlobalContext();
7043 EVENT(context, GLArrayElement, "context = %d, i = %d", CID(context), i);
7044
7045 if (context)
7046 {
7047 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7048 bool isCallValid = (context->skipValidation() || ValidateArrayElement(context, i));
7049 if (isCallValid)
7050 {
7051 context->arrayElement(i);
7052 }
7053 ANGLE_CAPTURE(ArrayElement, isCallValid, context, i);
7054 }
7055 else
7056 {
7057 GenerateContextLostErrorOnCurrentGlobalContext();
7058 }
7059 }
7060
GL_BindTexture(GLenum target,GLuint texture)7061 void GL_APIENTRY GL_BindTexture(GLenum target, GLuint texture)
7062 {
7063 Context *context = GetValidGlobalContext();
7064 EVENT(context, GLBindTexture, "context = %d, target = %s, texture = %u", CID(context),
7065 GLenumToString(GLenumGroup::TextureTarget, target), texture);
7066
7067 if (context)
7068 {
7069 TextureType targetPacked = PackParam<TextureType>(target);
7070 TextureID texturePacked = PackParam<TextureID>(texture);
7071 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7072 bool isCallValid = (context->skipValidation() ||
7073 ValidateBindTexture(context, targetPacked, texturePacked));
7074 if (isCallValid)
7075 {
7076 context->bindTexture(targetPacked, texturePacked);
7077 }
7078 ANGLE_CAPTURE(BindTexture, isCallValid, context, targetPacked, texturePacked);
7079 }
7080 else
7081 {
7082 GenerateContextLostErrorOnCurrentGlobalContext();
7083 }
7084 }
7085
GL_ColorPointer(GLint size,GLenum type,GLsizei stride,const void * pointer)7086 void GL_APIENTRY GL_ColorPointer(GLint size, GLenum type, GLsizei stride, const void *pointer)
7087 {
7088 Context *context = GetValidGlobalContext();
7089 EVENT(context, GLColorPointer,
7090 "context = %d, size = %d, type = %s, stride = %d, pointer = 0x%016" PRIxPTR "",
7091 CID(context), size, GLenumToString(GLenumGroup::ColorPointerType, type), stride,
7092 (uintptr_t)pointer);
7093
7094 if (context)
7095 {
7096 VertexAttribType typePacked = PackParam<VertexAttribType>(type);
7097 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7098 bool isCallValid = (context->skipValidation() ||
7099 ValidateColorPointer(context, size, typePacked, stride, pointer));
7100 if (isCallValid)
7101 {
7102 context->colorPointer(size, typePacked, stride, pointer);
7103 }
7104 ANGLE_CAPTURE(ColorPointer, isCallValid, context, size, typePacked, stride, pointer);
7105 }
7106 else
7107 {
7108 GenerateContextLostErrorOnCurrentGlobalContext();
7109 }
7110 }
7111
GL_CopyTexImage1D(GLenum target,GLint level,GLenum internalformat,GLint x,GLint y,GLsizei width,GLint border)7112 void GL_APIENTRY GL_CopyTexImage1D(GLenum target,
7113 GLint level,
7114 GLenum internalformat,
7115 GLint x,
7116 GLint y,
7117 GLsizei width,
7118 GLint border)
7119 {
7120 Context *context = GetValidGlobalContext();
7121 EVENT(context, GLCopyTexImage1D,
7122 "context = %d, target = %s, level = %d, internalformat = %s, x = %d, y = %d, width = %d, "
7123 "border = %d",
7124 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level,
7125 GLenumToString(GLenumGroup::InternalFormat, internalformat), x, y, width, border);
7126
7127 if (context)
7128 {
7129 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7130 bool isCallValid =
7131 (context->skipValidation() ||
7132 ValidateCopyTexImage1D(context, target, level, internalformat, x, y, width, border));
7133 if (isCallValid)
7134 {
7135 context->copyTexImage1D(target, level, internalformat, x, y, width, border);
7136 }
7137 ANGLE_CAPTURE(CopyTexImage1D, isCallValid, context, target, level, internalformat, x, y,
7138 width, border);
7139 }
7140 else
7141 {
7142 GenerateContextLostErrorOnCurrentGlobalContext();
7143 }
7144 }
7145
GL_CopyTexImage2D(GLenum target,GLint level,GLenum internalformat,GLint x,GLint y,GLsizei width,GLsizei height,GLint border)7146 void GL_APIENTRY GL_CopyTexImage2D(GLenum target,
7147 GLint level,
7148 GLenum internalformat,
7149 GLint x,
7150 GLint y,
7151 GLsizei width,
7152 GLsizei height,
7153 GLint border)
7154 {
7155 Context *context = GetValidGlobalContext();
7156 EVENT(context, GLCopyTexImage2D,
7157 "context = %d, target = %s, level = %d, internalformat = %s, x = %d, y = %d, width = %d, "
7158 "height = %d, border = %d",
7159 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level,
7160 GLenumToString(GLenumGroup::InternalFormat, internalformat), x, y, width, height, border);
7161
7162 if (context)
7163 {
7164 TextureTarget targetPacked = PackParam<TextureTarget>(target);
7165 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7166 bool isCallValid = (context->skipValidation() ||
7167 ValidateCopyTexImage2D(context, targetPacked, level, internalformat, x,
7168 y, width, height, border));
7169 if (isCallValid)
7170 {
7171 context->copyTexImage2D(targetPacked, level, internalformat, x, y, width, height,
7172 border);
7173 }
7174 ANGLE_CAPTURE(CopyTexImage2D, isCallValid, context, targetPacked, level, internalformat, x,
7175 y, width, height, border);
7176 }
7177 else
7178 {
7179 GenerateContextLostErrorOnCurrentGlobalContext();
7180 }
7181 }
7182
7183 void GL_APIENTRY
GL_CopyTexSubImage1D(GLenum target,GLint level,GLint xoffset,GLint x,GLint y,GLsizei width)7184 GL_CopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
7185 {
7186 Context *context = GetValidGlobalContext();
7187 EVENT(context, GLCopyTexSubImage1D,
7188 "context = %d, target = %s, level = %d, xoffset = %d, x = %d, y = %d, width = %d",
7189 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, xoffset, x, y,
7190 width);
7191
7192 if (context)
7193 {
7194 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7195 bool isCallValid =
7196 (context->skipValidation() ||
7197 ValidateCopyTexSubImage1D(context, target, level, xoffset, x, y, width));
7198 if (isCallValid)
7199 {
7200 context->copyTexSubImage1D(target, level, xoffset, x, y, width);
7201 }
7202 ANGLE_CAPTURE(CopyTexSubImage1D, isCallValid, context, target, level, xoffset, x, y, width);
7203 }
7204 else
7205 {
7206 GenerateContextLostErrorOnCurrentGlobalContext();
7207 }
7208 }
7209
GL_CopyTexSubImage2D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint x,GLint y,GLsizei width,GLsizei height)7210 void GL_APIENTRY GL_CopyTexSubImage2D(GLenum target,
7211 GLint level,
7212 GLint xoffset,
7213 GLint yoffset,
7214 GLint x,
7215 GLint y,
7216 GLsizei width,
7217 GLsizei height)
7218 {
7219 Context *context = GetValidGlobalContext();
7220 EVENT(context, GLCopyTexSubImage2D,
7221 "context = %d, target = %s, level = %d, xoffset = %d, yoffset = %d, x = %d, y = %d, "
7222 "width = %d, height = %d",
7223 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, xoffset, yoffset,
7224 x, y, width, height);
7225
7226 if (context)
7227 {
7228 TextureTarget targetPacked = PackParam<TextureTarget>(target);
7229 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7230 bool isCallValid = (context->skipValidation() ||
7231 ValidateCopyTexSubImage2D(context, targetPacked, level, xoffset,
7232 yoffset, x, y, width, height));
7233 if (isCallValid)
7234 {
7235 context->copyTexSubImage2D(targetPacked, level, xoffset, yoffset, x, y, width, height);
7236 }
7237 ANGLE_CAPTURE(CopyTexSubImage2D, isCallValid, context, targetPacked, level, xoffset,
7238 yoffset, x, y, width, height);
7239 }
7240 else
7241 {
7242 GenerateContextLostErrorOnCurrentGlobalContext();
7243 }
7244 }
7245
GL_DeleteTextures(GLsizei n,const GLuint * textures)7246 void GL_APIENTRY GL_DeleteTextures(GLsizei n, const GLuint *textures)
7247 {
7248 Context *context = GetValidGlobalContext();
7249 EVENT(context, GLDeleteTextures, "context = %d, n = %d, textures = 0x%016" PRIxPTR "",
7250 CID(context), n, (uintptr_t)textures);
7251
7252 if (context)
7253 {
7254 const TextureID *texturesPacked = PackParam<const TextureID *>(textures);
7255 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7256 bool isCallValid =
7257 (context->skipValidation() || ValidateDeleteTextures(context, n, texturesPacked));
7258 if (isCallValid)
7259 {
7260 context->deleteTextures(n, texturesPacked);
7261 }
7262 ANGLE_CAPTURE(DeleteTextures, isCallValid, context, n, texturesPacked);
7263 }
7264 else
7265 {
7266 GenerateContextLostErrorOnCurrentGlobalContext();
7267 }
7268 }
7269
GL_DisableClientState(GLenum array)7270 void GL_APIENTRY GL_DisableClientState(GLenum array)
7271 {
7272 Context *context = GetValidGlobalContext();
7273 EVENT(context, GLDisableClientState, "context = %d, array = %s", CID(context),
7274 GLenumToString(GLenumGroup::EnableCap, array));
7275
7276 if (context)
7277 {
7278 ClientVertexArrayType arrayPacked = PackParam<ClientVertexArrayType>(array);
7279 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7280 bool isCallValid =
7281 (context->skipValidation() || ValidateDisableClientState(context, arrayPacked));
7282 if (isCallValid)
7283 {
7284 context->disableClientState(arrayPacked);
7285 }
7286 ANGLE_CAPTURE(DisableClientState, isCallValid, context, arrayPacked);
7287 }
7288 else
7289 {
7290 GenerateContextLostErrorOnCurrentGlobalContext();
7291 }
7292 }
7293
GL_DrawArrays(GLenum mode,GLint first,GLsizei count)7294 void GL_APIENTRY GL_DrawArrays(GLenum mode, GLint first, GLsizei count)
7295 {
7296 Context *context = GetValidGlobalContext();
7297 EVENT(context, GLDrawArrays, "context = %d, mode = %s, first = %d, count = %d", CID(context),
7298 GLenumToString(GLenumGroup::PrimitiveType, mode), first, count);
7299
7300 if (context)
7301 {
7302 PrimitiveMode modePacked = PackParam<PrimitiveMode>(mode);
7303 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7304 bool isCallValid =
7305 (context->skipValidation() || ValidateDrawArrays(context, modePacked, first, count));
7306 if (isCallValid)
7307 {
7308 context->drawArrays(modePacked, first, count);
7309 }
7310 ANGLE_CAPTURE(DrawArrays, isCallValid, context, modePacked, first, count);
7311 }
7312 else
7313 {
7314 GenerateContextLostErrorOnCurrentGlobalContext();
7315 }
7316 }
7317
GL_DrawElements(GLenum mode,GLsizei count,GLenum type,const void * indices)7318 void GL_APIENTRY GL_DrawElements(GLenum mode, GLsizei count, GLenum type, const void *indices)
7319 {
7320 Context *context = GetValidGlobalContext();
7321 EVENT(context, GLDrawElements,
7322 "context = %d, mode = %s, count = %d, type = %s, indices = 0x%016" PRIxPTR "",
7323 CID(context), GLenumToString(GLenumGroup::PrimitiveType, mode), count,
7324 GLenumToString(GLenumGroup::DrawElementsType, type), (uintptr_t)indices);
7325
7326 if (context)
7327 {
7328 PrimitiveMode modePacked = PackParam<PrimitiveMode>(mode);
7329 DrawElementsType typePacked = PackParam<DrawElementsType>(type);
7330 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7331 bool isCallValid = (context->skipValidation() ||
7332 ValidateDrawElements(context, modePacked, count, typePacked, indices));
7333 if (isCallValid)
7334 {
7335 context->drawElements(modePacked, count, typePacked, indices);
7336 }
7337 ANGLE_CAPTURE(DrawElements, isCallValid, context, modePacked, count, typePacked, indices);
7338 }
7339 else
7340 {
7341 GenerateContextLostErrorOnCurrentGlobalContext();
7342 }
7343 }
7344
GL_EdgeFlagPointer(GLsizei stride,const void * pointer)7345 void GL_APIENTRY GL_EdgeFlagPointer(GLsizei stride, const void *pointer)
7346 {
7347 Context *context = GetValidGlobalContext();
7348 EVENT(context, GLEdgeFlagPointer, "context = %d, stride = %d, pointer = 0x%016" PRIxPTR "",
7349 CID(context), stride, (uintptr_t)pointer);
7350
7351 if (context)
7352 {
7353 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7354 bool isCallValid =
7355 (context->skipValidation() || ValidateEdgeFlagPointer(context, stride, pointer));
7356 if (isCallValid)
7357 {
7358 context->edgeFlagPointer(stride, pointer);
7359 }
7360 ANGLE_CAPTURE(EdgeFlagPointer, isCallValid, context, stride, pointer);
7361 }
7362 else
7363 {
7364 GenerateContextLostErrorOnCurrentGlobalContext();
7365 }
7366 }
7367
GL_EnableClientState(GLenum array)7368 void GL_APIENTRY GL_EnableClientState(GLenum array)
7369 {
7370 Context *context = GetValidGlobalContext();
7371 EVENT(context, GLEnableClientState, "context = %d, array = %s", CID(context),
7372 GLenumToString(GLenumGroup::EnableCap, array));
7373
7374 if (context)
7375 {
7376 ClientVertexArrayType arrayPacked = PackParam<ClientVertexArrayType>(array);
7377 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7378 bool isCallValid =
7379 (context->skipValidation() || ValidateEnableClientState(context, arrayPacked));
7380 if (isCallValid)
7381 {
7382 context->enableClientState(arrayPacked);
7383 }
7384 ANGLE_CAPTURE(EnableClientState, isCallValid, context, arrayPacked);
7385 }
7386 else
7387 {
7388 GenerateContextLostErrorOnCurrentGlobalContext();
7389 }
7390 }
7391
GL_GenTextures(GLsizei n,GLuint * textures)7392 void GL_APIENTRY GL_GenTextures(GLsizei n, GLuint *textures)
7393 {
7394 Context *context = GetValidGlobalContext();
7395 EVENT(context, GLGenTextures, "context = %d, n = %d, textures = 0x%016" PRIxPTR "",
7396 CID(context), n, (uintptr_t)textures);
7397
7398 if (context)
7399 {
7400 TextureID *texturesPacked = PackParam<TextureID *>(textures);
7401 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7402 bool isCallValid =
7403 (context->skipValidation() || ValidateGenTextures(context, n, texturesPacked));
7404 if (isCallValid)
7405 {
7406 context->genTextures(n, texturesPacked);
7407 }
7408 ANGLE_CAPTURE(GenTextures, isCallValid, context, n, texturesPacked);
7409 }
7410 else
7411 {
7412 GenerateContextLostErrorOnCurrentGlobalContext();
7413 }
7414 }
7415
GL_GetPointerv(GLenum pname,void ** params)7416 void GL_APIENTRY GL_GetPointerv(GLenum pname, void **params)
7417 {
7418 Context *context = GetValidGlobalContext();
7419 EVENT(context, GLGetPointerv, "context = %d, pname = %s, params = 0x%016" PRIxPTR "",
7420 CID(context), GLenumToString(GLenumGroup::GetPointervPName, pname), (uintptr_t)params);
7421
7422 if (context)
7423 {
7424 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7425 bool isCallValid =
7426 (context->skipValidation() || ValidateGetPointerv(context, pname, params));
7427 if (isCallValid)
7428 {
7429 context->getPointerv(pname, params);
7430 }
7431 ANGLE_CAPTURE(GetPointerv, isCallValid, context, pname, params);
7432 }
7433 else
7434 {
7435 GenerateContextLostErrorOnCurrentGlobalContext();
7436 }
7437 }
7438
GL_IndexPointer(GLenum type,GLsizei stride,const void * pointer)7439 void GL_APIENTRY GL_IndexPointer(GLenum type, GLsizei stride, const void *pointer)
7440 {
7441 Context *context = GetValidGlobalContext();
7442 EVENT(context, GLIndexPointer,
7443 "context = %d, type = %s, stride = %d, pointer = 0x%016" PRIxPTR "", CID(context),
7444 GLenumToString(GLenumGroup::IndexPointerType, type), stride, (uintptr_t)pointer);
7445
7446 if (context)
7447 {
7448 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7449 bool isCallValid =
7450 (context->skipValidation() || ValidateIndexPointer(context, type, stride, pointer));
7451 if (isCallValid)
7452 {
7453 context->indexPointer(type, stride, pointer);
7454 }
7455 ANGLE_CAPTURE(IndexPointer, isCallValid, context, type, stride, pointer);
7456 }
7457 else
7458 {
7459 GenerateContextLostErrorOnCurrentGlobalContext();
7460 }
7461 }
7462
GL_Indexub(GLubyte c)7463 void GL_APIENTRY GL_Indexub(GLubyte c)
7464 {
7465 Context *context = GetValidGlobalContext();
7466 EVENT(context, GLIndexub, "context = %d, c = %d", CID(context), c);
7467
7468 if (context)
7469 {
7470 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7471 bool isCallValid = (context->skipValidation() || ValidateIndexub(context, c));
7472 if (isCallValid)
7473 {
7474 context->indexub(c);
7475 }
7476 ANGLE_CAPTURE(Indexub, isCallValid, context, c);
7477 }
7478 else
7479 {
7480 GenerateContextLostErrorOnCurrentGlobalContext();
7481 }
7482 }
7483
GL_Indexubv(const GLubyte * c)7484 void GL_APIENTRY GL_Indexubv(const GLubyte *c)
7485 {
7486 Context *context = GetValidGlobalContext();
7487 EVENT(context, GLIndexubv, "context = %d, c = 0x%016" PRIxPTR "", CID(context), (uintptr_t)c);
7488
7489 if (context)
7490 {
7491 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7492 bool isCallValid = (context->skipValidation() || ValidateIndexubv(context, c));
7493 if (isCallValid)
7494 {
7495 context->indexubv(c);
7496 }
7497 ANGLE_CAPTURE(Indexubv, isCallValid, context, c);
7498 }
7499 else
7500 {
7501 GenerateContextLostErrorOnCurrentGlobalContext();
7502 }
7503 }
7504
GL_InterleavedArrays(GLenum format,GLsizei stride,const void * pointer)7505 void GL_APIENTRY GL_InterleavedArrays(GLenum format, GLsizei stride, const void *pointer)
7506 {
7507 Context *context = GetValidGlobalContext();
7508 EVENT(context, GLInterleavedArrays,
7509 "context = %d, format = %s, stride = %d, pointer = 0x%016" PRIxPTR "", CID(context),
7510 GLenumToString(GLenumGroup::InterleavedArrayFormat, format), stride, (uintptr_t)pointer);
7511
7512 if (context)
7513 {
7514 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7515 bool isCallValid = (context->skipValidation() ||
7516 ValidateInterleavedArrays(context, format, stride, pointer));
7517 if (isCallValid)
7518 {
7519 context->interleavedArrays(format, stride, pointer);
7520 }
7521 ANGLE_CAPTURE(InterleavedArrays, isCallValid, context, format, stride, pointer);
7522 }
7523 else
7524 {
7525 GenerateContextLostErrorOnCurrentGlobalContext();
7526 }
7527 }
7528
GL_IsTexture(GLuint texture)7529 GLboolean GL_APIENTRY GL_IsTexture(GLuint texture)
7530 {
7531 Context *context = GetValidGlobalContext();
7532 EVENT(context, GLIsTexture, "context = %d, texture = %u", CID(context), texture);
7533
7534 GLboolean returnValue;
7535 if (context)
7536 {
7537 TextureID texturePacked = PackParam<TextureID>(texture);
7538 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7539 bool isCallValid = (context->skipValidation() || ValidateIsTexture(context, texturePacked));
7540 if (isCallValid)
7541 {
7542 returnValue = context->isTexture(texturePacked);
7543 }
7544 else
7545 {
7546 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsTexture, GLboolean>();
7547 }
7548 ANGLE_CAPTURE(IsTexture, isCallValid, context, texturePacked, returnValue);
7549 }
7550 else
7551 {
7552 GenerateContextLostErrorOnCurrentGlobalContext();
7553 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsTexture, GLboolean>();
7554 }
7555 return returnValue;
7556 }
7557
GL_NormalPointer(GLenum type,GLsizei stride,const void * pointer)7558 void GL_APIENTRY GL_NormalPointer(GLenum type, GLsizei stride, const void *pointer)
7559 {
7560 Context *context = GetValidGlobalContext();
7561 EVENT(context, GLNormalPointer,
7562 "context = %d, type = %s, stride = %d, pointer = 0x%016" PRIxPTR "", CID(context),
7563 GLenumToString(GLenumGroup::NormalPointerType, type), stride, (uintptr_t)pointer);
7564
7565 if (context)
7566 {
7567 VertexAttribType typePacked = PackParam<VertexAttribType>(type);
7568 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7569 bool isCallValid = (context->skipValidation() ||
7570 ValidateNormalPointer(context, typePacked, stride, pointer));
7571 if (isCallValid)
7572 {
7573 context->normalPointer(typePacked, stride, pointer);
7574 }
7575 ANGLE_CAPTURE(NormalPointer, isCallValid, context, typePacked, stride, pointer);
7576 }
7577 else
7578 {
7579 GenerateContextLostErrorOnCurrentGlobalContext();
7580 }
7581 }
7582
GL_PolygonOffset(GLfloat factor,GLfloat units)7583 void GL_APIENTRY GL_PolygonOffset(GLfloat factor, GLfloat units)
7584 {
7585 Context *context = GetValidGlobalContext();
7586 EVENT(context, GLPolygonOffset, "context = %d, factor = %f, units = %f", CID(context), factor,
7587 units);
7588
7589 if (context)
7590 {
7591 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7592 bool isCallValid =
7593 (context->skipValidation() || ValidatePolygonOffset(context, factor, units));
7594 if (isCallValid)
7595 {
7596 context->polygonOffset(factor, units);
7597 }
7598 ANGLE_CAPTURE(PolygonOffset, isCallValid, context, factor, units);
7599 }
7600 else
7601 {
7602 GenerateContextLostErrorOnCurrentGlobalContext();
7603 }
7604 }
7605
GL_PopClientAttrib()7606 void GL_APIENTRY GL_PopClientAttrib()
7607 {
7608 Context *context = GetValidGlobalContext();
7609 EVENT(context, GLPopClientAttrib, "context = %d", CID(context));
7610
7611 if (context)
7612 {
7613 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7614 bool isCallValid = (context->skipValidation() || ValidatePopClientAttrib(context));
7615 if (isCallValid)
7616 {
7617 context->popClientAttrib();
7618 }
7619 ANGLE_CAPTURE(PopClientAttrib, isCallValid, context);
7620 }
7621 else
7622 {
7623 GenerateContextLostErrorOnCurrentGlobalContext();
7624 }
7625 }
7626
GL_PrioritizeTextures(GLsizei n,const GLuint * textures,const GLfloat * priorities)7627 void GL_APIENTRY GL_PrioritizeTextures(GLsizei n, const GLuint *textures, const GLfloat *priorities)
7628 {
7629 Context *context = GetValidGlobalContext();
7630 EVENT(context, GLPrioritizeTextures,
7631 "context = %d, n = %d, textures = 0x%016" PRIxPTR ", priorities = 0x%016" PRIxPTR "",
7632 CID(context), n, (uintptr_t)textures, (uintptr_t)priorities);
7633
7634 if (context)
7635 {
7636 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7637 bool isCallValid = (context->skipValidation() ||
7638 ValidatePrioritizeTextures(context, n, textures, priorities));
7639 if (isCallValid)
7640 {
7641 context->prioritizeTextures(n, textures, priorities);
7642 }
7643 ANGLE_CAPTURE(PrioritizeTextures, isCallValid, context, n, textures, priorities);
7644 }
7645 else
7646 {
7647 GenerateContextLostErrorOnCurrentGlobalContext();
7648 }
7649 }
7650
GL_PushClientAttrib(GLbitfield mask)7651 void GL_APIENTRY GL_PushClientAttrib(GLbitfield mask)
7652 {
7653 Context *context = GetValidGlobalContext();
7654 EVENT(context, GLPushClientAttrib, "context = %d, mask = %s", CID(context),
7655 GLbitfieldToString(GLenumGroup::ClientAttribMask, mask).c_str());
7656
7657 if (context)
7658 {
7659 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7660 bool isCallValid = (context->skipValidation() || ValidatePushClientAttrib(context, mask));
7661 if (isCallValid)
7662 {
7663 context->pushClientAttrib(mask);
7664 }
7665 ANGLE_CAPTURE(PushClientAttrib, isCallValid, context, mask);
7666 }
7667 else
7668 {
7669 GenerateContextLostErrorOnCurrentGlobalContext();
7670 }
7671 }
7672
GL_TexCoordPointer(GLint size,GLenum type,GLsizei stride,const void * pointer)7673 void GL_APIENTRY GL_TexCoordPointer(GLint size, GLenum type, GLsizei stride, const void *pointer)
7674 {
7675 Context *context = GetValidGlobalContext();
7676 EVENT(context, GLTexCoordPointer,
7677 "context = %d, size = %d, type = %s, stride = %d, pointer = 0x%016" PRIxPTR "",
7678 CID(context), size, GLenumToString(GLenumGroup::TexCoordPointerType, type), stride,
7679 (uintptr_t)pointer);
7680
7681 if (context)
7682 {
7683 VertexAttribType typePacked = PackParam<VertexAttribType>(type);
7684 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7685 bool isCallValid = (context->skipValidation() ||
7686 ValidateTexCoordPointer(context, size, typePacked, stride, pointer));
7687 if (isCallValid)
7688 {
7689 context->texCoordPointer(size, typePacked, stride, pointer);
7690 }
7691 ANGLE_CAPTURE(TexCoordPointer, isCallValid, context, size, typePacked, stride, pointer);
7692 }
7693 else
7694 {
7695 GenerateContextLostErrorOnCurrentGlobalContext();
7696 }
7697 }
7698
GL_TexSubImage1D(GLenum target,GLint level,GLint xoffset,GLsizei width,GLenum format,GLenum type,const void * pixels)7699 void GL_APIENTRY GL_TexSubImage1D(GLenum target,
7700 GLint level,
7701 GLint xoffset,
7702 GLsizei width,
7703 GLenum format,
7704 GLenum type,
7705 const void *pixels)
7706 {
7707 Context *context = GetValidGlobalContext();
7708 EVENT(context, GLTexSubImage1D,
7709 "context = %d, target = %s, level = %d, xoffset = %d, width = %d, format = %s, type = "
7710 "%s, pixels = 0x%016" PRIxPTR "",
7711 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, xoffset, width,
7712 GLenumToString(GLenumGroup::PixelFormat, format),
7713 GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)pixels);
7714
7715 if (context)
7716 {
7717 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7718 bool isCallValid =
7719 (context->skipValidation() ||
7720 ValidateTexSubImage1D(context, target, level, xoffset, width, format, type, pixels));
7721 if (isCallValid)
7722 {
7723 context->texSubImage1D(target, level, xoffset, width, format, type, pixels);
7724 }
7725 ANGLE_CAPTURE(TexSubImage1D, isCallValid, context, target, level, xoffset, width, format,
7726 type, pixels);
7727 }
7728 else
7729 {
7730 GenerateContextLostErrorOnCurrentGlobalContext();
7731 }
7732 }
7733
GL_TexSubImage2D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLenum type,const void * pixels)7734 void GL_APIENTRY GL_TexSubImage2D(GLenum target,
7735 GLint level,
7736 GLint xoffset,
7737 GLint yoffset,
7738 GLsizei width,
7739 GLsizei height,
7740 GLenum format,
7741 GLenum type,
7742 const void *pixels)
7743 {
7744 Context *context = GetValidGlobalContext();
7745 EVENT(context, GLTexSubImage2D,
7746 "context = %d, target = %s, level = %d, xoffset = %d, yoffset = %d, width = %d, height = "
7747 "%d, format = %s, type = %s, pixels = 0x%016" PRIxPTR "",
7748 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, xoffset, yoffset,
7749 width, height, GLenumToString(GLenumGroup::PixelFormat, format),
7750 GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)pixels);
7751
7752 if (context)
7753 {
7754 TextureTarget targetPacked = PackParam<TextureTarget>(target);
7755 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7756 bool isCallValid = (context->skipValidation() ||
7757 ValidateTexSubImage2D(context, targetPacked, level, xoffset, yoffset,
7758 width, height, format, type, pixels));
7759 if (isCallValid)
7760 {
7761 context->texSubImage2D(targetPacked, level, xoffset, yoffset, width, height, format,
7762 type, pixels);
7763 }
7764 ANGLE_CAPTURE(TexSubImage2D, isCallValid, context, targetPacked, level, xoffset, yoffset,
7765 width, height, format, type, pixels);
7766 }
7767 else
7768 {
7769 GenerateContextLostErrorOnCurrentGlobalContext();
7770 }
7771 }
7772
GL_VertexPointer(GLint size,GLenum type,GLsizei stride,const void * pointer)7773 void GL_APIENTRY GL_VertexPointer(GLint size, GLenum type, GLsizei stride, const void *pointer)
7774 {
7775 Context *context = GetValidGlobalContext();
7776 EVENT(context, GLVertexPointer,
7777 "context = %d, size = %d, type = %s, stride = %d, pointer = 0x%016" PRIxPTR "",
7778 CID(context), size, GLenumToString(GLenumGroup::VertexPointerType, type), stride,
7779 (uintptr_t)pointer);
7780
7781 if (context)
7782 {
7783 VertexAttribType typePacked = PackParam<VertexAttribType>(type);
7784 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7785 bool isCallValid = (context->skipValidation() ||
7786 ValidateVertexPointer(context, size, typePacked, stride, pointer));
7787 if (isCallValid)
7788 {
7789 context->vertexPointer(size, typePacked, stride, pointer);
7790 }
7791 ANGLE_CAPTURE(VertexPointer, isCallValid, context, size, typePacked, stride, pointer);
7792 }
7793 else
7794 {
7795 GenerateContextLostErrorOnCurrentGlobalContext();
7796 }
7797 }
7798
7799 // GL 1.2
GL_CopyTexSubImage3D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLint x,GLint y,GLsizei width,GLsizei height)7800 void GL_APIENTRY GL_CopyTexSubImage3D(GLenum target,
7801 GLint level,
7802 GLint xoffset,
7803 GLint yoffset,
7804 GLint zoffset,
7805 GLint x,
7806 GLint y,
7807 GLsizei width,
7808 GLsizei height)
7809 {
7810 Context *context = GetValidGlobalContext();
7811 EVENT(context, GLCopyTexSubImage3D,
7812 "context = %d, target = %s, level = %d, xoffset = %d, yoffset = %d, zoffset = %d, x = "
7813 "%d, y = %d, width = %d, height = %d",
7814 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, xoffset, yoffset,
7815 zoffset, x, y, width, height);
7816
7817 if (context)
7818 {
7819 TextureTarget targetPacked = PackParam<TextureTarget>(target);
7820 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7821 bool isCallValid = (context->skipValidation() ||
7822 ValidateCopyTexSubImage3D(context, targetPacked, level, xoffset,
7823 yoffset, zoffset, x, y, width, height));
7824 if (isCallValid)
7825 {
7826 context->copyTexSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, x, y, width,
7827 height);
7828 }
7829 ANGLE_CAPTURE(CopyTexSubImage3D, isCallValid, context, targetPacked, level, xoffset,
7830 yoffset, zoffset, x, y, width, height);
7831 }
7832 else
7833 {
7834 GenerateContextLostErrorOnCurrentGlobalContext();
7835 }
7836 }
7837
GL_DrawRangeElements(GLenum mode,GLuint start,GLuint end,GLsizei count,GLenum type,const void * indices)7838 void GL_APIENTRY GL_DrawRangeElements(GLenum mode,
7839 GLuint start,
7840 GLuint end,
7841 GLsizei count,
7842 GLenum type,
7843 const void *indices)
7844 {
7845 Context *context = GetValidGlobalContext();
7846 EVENT(context, GLDrawRangeElements,
7847 "context = %d, mode = %s, start = %u, end = %u, count = %d, type = %s, indices = "
7848 "0x%016" PRIxPTR "",
7849 CID(context), GLenumToString(GLenumGroup::PrimitiveType, mode), start, end, count,
7850 GLenumToString(GLenumGroup::DrawElementsType, type), (uintptr_t)indices);
7851
7852 if (context)
7853 {
7854 PrimitiveMode modePacked = PackParam<PrimitiveMode>(mode);
7855 DrawElementsType typePacked = PackParam<DrawElementsType>(type);
7856 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7857 bool isCallValid =
7858 (context->skipValidation() || ValidateDrawRangeElements(context, modePacked, start, end,
7859 count, typePacked, indices));
7860 if (isCallValid)
7861 {
7862 context->drawRangeElements(modePacked, start, end, count, typePacked, indices);
7863 }
7864 ANGLE_CAPTURE(DrawRangeElements, isCallValid, context, modePacked, start, end, count,
7865 typePacked, indices);
7866 }
7867 else
7868 {
7869 GenerateContextLostErrorOnCurrentGlobalContext();
7870 }
7871 }
7872
GL_TexImage3D(GLenum target,GLint level,GLint internalformat,GLsizei width,GLsizei height,GLsizei depth,GLint border,GLenum format,GLenum type,const void * pixels)7873 void GL_APIENTRY GL_TexImage3D(GLenum target,
7874 GLint level,
7875 GLint internalformat,
7876 GLsizei width,
7877 GLsizei height,
7878 GLsizei depth,
7879 GLint border,
7880 GLenum format,
7881 GLenum type,
7882 const void *pixels)
7883 {
7884 Context *context = GetValidGlobalContext();
7885 EVENT(context, GLTexImage3D,
7886 "context = %d, target = %s, level = %d, internalformat = %d, width = %d, height = %d, "
7887 "depth = %d, border = %d, format = %s, type = %s, pixels = 0x%016" PRIxPTR "",
7888 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, internalformat,
7889 width, height, depth, border, GLenumToString(GLenumGroup::PixelFormat, format),
7890 GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)pixels);
7891
7892 if (context)
7893 {
7894 TextureTarget targetPacked = PackParam<TextureTarget>(target);
7895 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7896 bool isCallValid = (context->skipValidation() ||
7897 ValidateTexImage3D(context, targetPacked, level, internalformat, width,
7898 height, depth, border, format, type, pixels));
7899 if (isCallValid)
7900 {
7901 context->texImage3D(targetPacked, level, internalformat, width, height, depth, border,
7902 format, type, pixels);
7903 }
7904 ANGLE_CAPTURE(TexImage3D, isCallValid, context, targetPacked, level, internalformat, width,
7905 height, depth, border, format, type, pixels);
7906 }
7907 else
7908 {
7909 GenerateContextLostErrorOnCurrentGlobalContext();
7910 }
7911 }
7912
GL_TexSubImage3D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLenum type,const void * pixels)7913 void GL_APIENTRY GL_TexSubImage3D(GLenum target,
7914 GLint level,
7915 GLint xoffset,
7916 GLint yoffset,
7917 GLint zoffset,
7918 GLsizei width,
7919 GLsizei height,
7920 GLsizei depth,
7921 GLenum format,
7922 GLenum type,
7923 const void *pixels)
7924 {
7925 Context *context = GetValidGlobalContext();
7926 EVENT(context, GLTexSubImage3D,
7927 "context = %d, target = %s, level = %d, xoffset = %d, yoffset = %d, zoffset = %d, width "
7928 "= %d, height = %d, depth = %d, format = %s, type = %s, pixels = 0x%016" PRIxPTR "",
7929 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, xoffset, yoffset,
7930 zoffset, width, height, depth, GLenumToString(GLenumGroup::PixelFormat, format),
7931 GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)pixels);
7932
7933 if (context)
7934 {
7935 TextureTarget targetPacked = PackParam<TextureTarget>(target);
7936 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7937 bool isCallValid =
7938 (context->skipValidation() ||
7939 ValidateTexSubImage3D(context, targetPacked, level, xoffset, yoffset, zoffset, width,
7940 height, depth, format, type, pixels));
7941 if (isCallValid)
7942 {
7943 context->texSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, width, height,
7944 depth, format, type, pixels);
7945 }
7946 ANGLE_CAPTURE(TexSubImage3D, isCallValid, context, targetPacked, level, xoffset, yoffset,
7947 zoffset, width, height, depth, format, type, pixels);
7948 }
7949 else
7950 {
7951 GenerateContextLostErrorOnCurrentGlobalContext();
7952 }
7953 }
7954
7955 // GL 1.3
GL_ActiveTexture(GLenum texture)7956 void GL_APIENTRY GL_ActiveTexture(GLenum texture)
7957 {
7958 Context *context = GetValidGlobalContext();
7959 EVENT(context, GLActiveTexture, "context = %d, texture = %s", CID(context),
7960 GLenumToString(GLenumGroup::TextureUnit, texture));
7961
7962 if (context)
7963 {
7964 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7965 bool isCallValid = (context->skipValidation() || ValidateActiveTexture(context, texture));
7966 if (isCallValid)
7967 {
7968 context->activeTexture(texture);
7969 }
7970 ANGLE_CAPTURE(ActiveTexture, isCallValid, context, texture);
7971 }
7972 else
7973 {
7974 GenerateContextLostErrorOnCurrentGlobalContext();
7975 }
7976 }
7977
GL_ClientActiveTexture(GLenum texture)7978 void GL_APIENTRY GL_ClientActiveTexture(GLenum texture)
7979 {
7980 Context *context = GetValidGlobalContext();
7981 EVENT(context, GLClientActiveTexture, "context = %d, texture = %s", CID(context),
7982 GLenumToString(GLenumGroup::TextureUnit, texture));
7983
7984 if (context)
7985 {
7986 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
7987 bool isCallValid =
7988 (context->skipValidation() || ValidateClientActiveTexture(context, texture));
7989 if (isCallValid)
7990 {
7991 context->clientActiveTexture(texture);
7992 }
7993 ANGLE_CAPTURE(ClientActiveTexture, isCallValid, context, texture);
7994 }
7995 else
7996 {
7997 GenerateContextLostErrorOnCurrentGlobalContext();
7998 }
7999 }
8000
GL_CompressedTexImage1D(GLenum target,GLint level,GLenum internalformat,GLsizei width,GLint border,GLsizei imageSize,const void * data)8001 void GL_APIENTRY GL_CompressedTexImage1D(GLenum target,
8002 GLint level,
8003 GLenum internalformat,
8004 GLsizei width,
8005 GLint border,
8006 GLsizei imageSize,
8007 const void *data)
8008 {
8009 Context *context = GetValidGlobalContext();
8010 EVENT(context, GLCompressedTexImage1D,
8011 "context = %d, target = %s, level = %d, internalformat = %s, width = %d, border = %d, "
8012 "imageSize = %d, data = 0x%016" PRIxPTR "",
8013 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level,
8014 GLenumToString(GLenumGroup::InternalFormat, internalformat), width, border, imageSize,
8015 (uintptr_t)data);
8016
8017 if (context)
8018 {
8019 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8020 bool isCallValid = (context->skipValidation() ||
8021 ValidateCompressedTexImage1D(context, target, level, internalformat,
8022 width, border, imageSize, data));
8023 if (isCallValid)
8024 {
8025 context->compressedTexImage1D(target, level, internalformat, width, border, imageSize,
8026 data);
8027 }
8028 ANGLE_CAPTURE(CompressedTexImage1D, isCallValid, context, target, level, internalformat,
8029 width, border, imageSize, data);
8030 }
8031 else
8032 {
8033 GenerateContextLostErrorOnCurrentGlobalContext();
8034 }
8035 }
8036
GL_CompressedTexImage2D(GLenum target,GLint level,GLenum internalformat,GLsizei width,GLsizei height,GLint border,GLsizei imageSize,const void * data)8037 void GL_APIENTRY GL_CompressedTexImage2D(GLenum target,
8038 GLint level,
8039 GLenum internalformat,
8040 GLsizei width,
8041 GLsizei height,
8042 GLint border,
8043 GLsizei imageSize,
8044 const void *data)
8045 {
8046 Context *context = GetValidGlobalContext();
8047 EVENT(context, GLCompressedTexImage2D,
8048 "context = %d, target = %s, level = %d, internalformat = %s, width = %d, height = %d, "
8049 "border = %d, imageSize = %d, data = 0x%016" PRIxPTR "",
8050 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level,
8051 GLenumToString(GLenumGroup::InternalFormat, internalformat), width, height, border,
8052 imageSize, (uintptr_t)data);
8053
8054 if (context)
8055 {
8056 TextureTarget targetPacked = PackParam<TextureTarget>(target);
8057 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8058 bool isCallValid =
8059 (context->skipValidation() ||
8060 ValidateCompressedTexImage2D(context, targetPacked, level, internalformat, width,
8061 height, border, imageSize, data));
8062 if (isCallValid)
8063 {
8064 context->compressedTexImage2D(targetPacked, level, internalformat, width, height,
8065 border, imageSize, data);
8066 }
8067 ANGLE_CAPTURE(CompressedTexImage2D, isCallValid, context, targetPacked, level,
8068 internalformat, width, height, border, imageSize, data);
8069 }
8070 else
8071 {
8072 GenerateContextLostErrorOnCurrentGlobalContext();
8073 }
8074 }
8075
GL_CompressedTexImage3D(GLenum target,GLint level,GLenum internalformat,GLsizei width,GLsizei height,GLsizei depth,GLint border,GLsizei imageSize,const void * data)8076 void GL_APIENTRY GL_CompressedTexImage3D(GLenum target,
8077 GLint level,
8078 GLenum internalformat,
8079 GLsizei width,
8080 GLsizei height,
8081 GLsizei depth,
8082 GLint border,
8083 GLsizei imageSize,
8084 const void *data)
8085 {
8086 Context *context = GetValidGlobalContext();
8087 EVENT(context, GLCompressedTexImage3D,
8088 "context = %d, target = %s, level = %d, internalformat = %s, width = %d, height = %d, "
8089 "depth = %d, border = %d, imageSize = %d, data = 0x%016" PRIxPTR "",
8090 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level,
8091 GLenumToString(GLenumGroup::InternalFormat, internalformat), width, height, depth, border,
8092 imageSize, (uintptr_t)data);
8093
8094 if (context)
8095 {
8096 TextureTarget targetPacked = PackParam<TextureTarget>(target);
8097 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8098 bool isCallValid =
8099 (context->skipValidation() ||
8100 ValidateCompressedTexImage3D(context, targetPacked, level, internalformat, width,
8101 height, depth, border, imageSize, data));
8102 if (isCallValid)
8103 {
8104 context->compressedTexImage3D(targetPacked, level, internalformat, width, height, depth,
8105 border, imageSize, data);
8106 }
8107 ANGLE_CAPTURE(CompressedTexImage3D, isCallValid, context, targetPacked, level,
8108 internalformat, width, height, depth, border, imageSize, data);
8109 }
8110 else
8111 {
8112 GenerateContextLostErrorOnCurrentGlobalContext();
8113 }
8114 }
8115
GL_CompressedTexSubImage1D(GLenum target,GLint level,GLint xoffset,GLsizei width,GLenum format,GLsizei imageSize,const void * data)8116 void GL_APIENTRY GL_CompressedTexSubImage1D(GLenum target,
8117 GLint level,
8118 GLint xoffset,
8119 GLsizei width,
8120 GLenum format,
8121 GLsizei imageSize,
8122 const void *data)
8123 {
8124 Context *context = GetValidGlobalContext();
8125 EVENT(context, GLCompressedTexSubImage1D,
8126 "context = %d, target = %s, level = %d, xoffset = %d, width = %d, format = %s, imageSize "
8127 "= %d, data = 0x%016" PRIxPTR "",
8128 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, xoffset, width,
8129 GLenumToString(GLenumGroup::PixelFormat, format), imageSize, (uintptr_t)data);
8130
8131 if (context)
8132 {
8133 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8134 bool isCallValid = (context->skipValidation() ||
8135 ValidateCompressedTexSubImage1D(context, target, level, xoffset, width,
8136 format, imageSize, data));
8137 if (isCallValid)
8138 {
8139 context->compressedTexSubImage1D(target, level, xoffset, width, format, imageSize,
8140 data);
8141 }
8142 ANGLE_CAPTURE(CompressedTexSubImage1D, isCallValid, context, target, level, xoffset, width,
8143 format, imageSize, data);
8144 }
8145 else
8146 {
8147 GenerateContextLostErrorOnCurrentGlobalContext();
8148 }
8149 }
8150
GL_CompressedTexSubImage2D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLsizei imageSize,const void * data)8151 void GL_APIENTRY GL_CompressedTexSubImage2D(GLenum target,
8152 GLint level,
8153 GLint xoffset,
8154 GLint yoffset,
8155 GLsizei width,
8156 GLsizei height,
8157 GLenum format,
8158 GLsizei imageSize,
8159 const void *data)
8160 {
8161 Context *context = GetValidGlobalContext();
8162 EVENT(context, GLCompressedTexSubImage2D,
8163 "context = %d, target = %s, level = %d, xoffset = %d, yoffset = %d, width = %d, height = "
8164 "%d, format = %s, imageSize = %d, data = 0x%016" PRIxPTR "",
8165 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, xoffset, yoffset,
8166 width, height, GLenumToString(GLenumGroup::PixelFormat, format), imageSize,
8167 (uintptr_t)data);
8168
8169 if (context)
8170 {
8171 TextureTarget targetPacked = PackParam<TextureTarget>(target);
8172 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8173 bool isCallValid =
8174 (context->skipValidation() ||
8175 ValidateCompressedTexSubImage2D(context, targetPacked, level, xoffset, yoffset, width,
8176 height, format, imageSize, data));
8177 if (isCallValid)
8178 {
8179 context->compressedTexSubImage2D(targetPacked, level, xoffset, yoffset, width, height,
8180 format, imageSize, data);
8181 }
8182 ANGLE_CAPTURE(CompressedTexSubImage2D, isCallValid, context, targetPacked, level, xoffset,
8183 yoffset, width, height, format, imageSize, data);
8184 }
8185 else
8186 {
8187 GenerateContextLostErrorOnCurrentGlobalContext();
8188 }
8189 }
8190
GL_CompressedTexSubImage3D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLsizei imageSize,const void * data)8191 void GL_APIENTRY GL_CompressedTexSubImage3D(GLenum target,
8192 GLint level,
8193 GLint xoffset,
8194 GLint yoffset,
8195 GLint zoffset,
8196 GLsizei width,
8197 GLsizei height,
8198 GLsizei depth,
8199 GLenum format,
8200 GLsizei imageSize,
8201 const void *data)
8202 {
8203 Context *context = GetValidGlobalContext();
8204 EVENT(context, GLCompressedTexSubImage3D,
8205 "context = %d, target = %s, level = %d, xoffset = %d, yoffset = %d, zoffset = %d, width "
8206 "= %d, height = %d, depth = %d, format = %s, imageSize = %d, data = 0x%016" PRIxPTR "",
8207 CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, xoffset, yoffset,
8208 zoffset, width, height, depth, GLenumToString(GLenumGroup::PixelFormat, format),
8209 imageSize, (uintptr_t)data);
8210
8211 if (context)
8212 {
8213 TextureTarget targetPacked = PackParam<TextureTarget>(target);
8214 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8215 bool isCallValid = (context->skipValidation() ||
8216 ValidateCompressedTexSubImage3D(context, targetPacked, level, xoffset,
8217 yoffset, zoffset, width, height, depth,
8218 format, imageSize, data));
8219 if (isCallValid)
8220 {
8221 context->compressedTexSubImage3D(targetPacked, level, xoffset, yoffset, zoffset, width,
8222 height, depth, format, imageSize, data);
8223 }
8224 ANGLE_CAPTURE(CompressedTexSubImage3D, isCallValid, context, targetPacked, level, xoffset,
8225 yoffset, zoffset, width, height, depth, format, imageSize, data);
8226 }
8227 else
8228 {
8229 GenerateContextLostErrorOnCurrentGlobalContext();
8230 }
8231 }
8232
GL_GetCompressedTexImage(GLenum target,GLint level,void * img)8233 void GL_APIENTRY GL_GetCompressedTexImage(GLenum target, GLint level, void *img)
8234 {
8235 Context *context = GetValidGlobalContext();
8236 EVENT(context, GLGetCompressedTexImage,
8237 "context = %d, target = %s, level = %d, img = 0x%016" PRIxPTR "", CID(context),
8238 GLenumToString(GLenumGroup::TextureTarget, target), level, (uintptr_t)img);
8239
8240 if (context)
8241 {
8242 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8243 bool isCallValid = (context->skipValidation() ||
8244 ValidateGetCompressedTexImage(context, target, level, img));
8245 if (isCallValid)
8246 {
8247 context->getCompressedTexImage(target, level, img);
8248 }
8249 ANGLE_CAPTURE(GetCompressedTexImage, isCallValid, context, target, level, img);
8250 }
8251 else
8252 {
8253 GenerateContextLostErrorOnCurrentGlobalContext();
8254 }
8255 }
8256
GL_LoadTransposeMatrixd(const GLdouble * m)8257 void GL_APIENTRY GL_LoadTransposeMatrixd(const GLdouble *m)
8258 {
8259 Context *context = GetValidGlobalContext();
8260 EVENT(context, GLLoadTransposeMatrixd, "context = %d, m = 0x%016" PRIxPTR "", CID(context),
8261 (uintptr_t)m);
8262
8263 if (context)
8264 {
8265 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8266 bool isCallValid = (context->skipValidation() || ValidateLoadTransposeMatrixd(context, m));
8267 if (isCallValid)
8268 {
8269 context->loadTransposeMatrixd(m);
8270 }
8271 ANGLE_CAPTURE(LoadTransposeMatrixd, isCallValid, context, m);
8272 }
8273 else
8274 {
8275 GenerateContextLostErrorOnCurrentGlobalContext();
8276 }
8277 }
8278
GL_LoadTransposeMatrixf(const GLfloat * m)8279 void GL_APIENTRY GL_LoadTransposeMatrixf(const GLfloat *m)
8280 {
8281 Context *context = GetValidGlobalContext();
8282 EVENT(context, GLLoadTransposeMatrixf, "context = %d, m = 0x%016" PRIxPTR "", CID(context),
8283 (uintptr_t)m);
8284
8285 if (context)
8286 {
8287 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8288 bool isCallValid = (context->skipValidation() || ValidateLoadTransposeMatrixf(context, m));
8289 if (isCallValid)
8290 {
8291 context->loadTransposeMatrixf(m);
8292 }
8293 ANGLE_CAPTURE(LoadTransposeMatrixf, isCallValid, context, m);
8294 }
8295 else
8296 {
8297 GenerateContextLostErrorOnCurrentGlobalContext();
8298 }
8299 }
8300
GL_MultTransposeMatrixd(const GLdouble * m)8301 void GL_APIENTRY GL_MultTransposeMatrixd(const GLdouble *m)
8302 {
8303 Context *context = GetValidGlobalContext();
8304 EVENT(context, GLMultTransposeMatrixd, "context = %d, m = 0x%016" PRIxPTR "", CID(context),
8305 (uintptr_t)m);
8306
8307 if (context)
8308 {
8309 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8310 bool isCallValid = (context->skipValidation() || ValidateMultTransposeMatrixd(context, m));
8311 if (isCallValid)
8312 {
8313 context->multTransposeMatrixd(m);
8314 }
8315 ANGLE_CAPTURE(MultTransposeMatrixd, isCallValid, context, m);
8316 }
8317 else
8318 {
8319 GenerateContextLostErrorOnCurrentGlobalContext();
8320 }
8321 }
8322
GL_MultTransposeMatrixf(const GLfloat * m)8323 void GL_APIENTRY GL_MultTransposeMatrixf(const GLfloat *m)
8324 {
8325 Context *context = GetValidGlobalContext();
8326 EVENT(context, GLMultTransposeMatrixf, "context = %d, m = 0x%016" PRIxPTR "", CID(context),
8327 (uintptr_t)m);
8328
8329 if (context)
8330 {
8331 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8332 bool isCallValid = (context->skipValidation() || ValidateMultTransposeMatrixf(context, m));
8333 if (isCallValid)
8334 {
8335 context->multTransposeMatrixf(m);
8336 }
8337 ANGLE_CAPTURE(MultTransposeMatrixf, isCallValid, context, m);
8338 }
8339 else
8340 {
8341 GenerateContextLostErrorOnCurrentGlobalContext();
8342 }
8343 }
8344
GL_MultiTexCoord1d(GLenum target,GLdouble s)8345 void GL_APIENTRY GL_MultiTexCoord1d(GLenum target, GLdouble s)
8346 {
8347 Context *context = GetValidGlobalContext();
8348 EVENT(context, GLMultiTexCoord1d, "context = %d, target = %s, s = %f", CID(context),
8349 GLenumToString(GLenumGroup::TextureUnit, target), s);
8350
8351 if (context)
8352 {
8353 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8354 bool isCallValid =
8355 (context->skipValidation() || ValidateMultiTexCoord1d(context, target, s));
8356 if (isCallValid)
8357 {
8358 context->multiTexCoord1d(target, s);
8359 }
8360 ANGLE_CAPTURE(MultiTexCoord1d, isCallValid, context, target, s);
8361 }
8362 else
8363 {
8364 GenerateContextLostErrorOnCurrentGlobalContext();
8365 }
8366 }
8367
GL_MultiTexCoord1dv(GLenum target,const GLdouble * v)8368 void GL_APIENTRY GL_MultiTexCoord1dv(GLenum target, const GLdouble *v)
8369 {
8370 Context *context = GetValidGlobalContext();
8371 EVENT(context, GLMultiTexCoord1dv, "context = %d, target = %s, v = 0x%016" PRIxPTR "",
8372 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), (uintptr_t)v);
8373
8374 if (context)
8375 {
8376 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8377 bool isCallValid =
8378 (context->skipValidation() || ValidateMultiTexCoord1dv(context, target, v));
8379 if (isCallValid)
8380 {
8381 context->multiTexCoord1dv(target, v);
8382 }
8383 ANGLE_CAPTURE(MultiTexCoord1dv, isCallValid, context, target, v);
8384 }
8385 else
8386 {
8387 GenerateContextLostErrorOnCurrentGlobalContext();
8388 }
8389 }
8390
GL_MultiTexCoord1f(GLenum target,GLfloat s)8391 void GL_APIENTRY GL_MultiTexCoord1f(GLenum target, GLfloat s)
8392 {
8393 Context *context = GetValidGlobalContext();
8394 EVENT(context, GLMultiTexCoord1f, "context = %d, target = %s, s = %f", CID(context),
8395 GLenumToString(GLenumGroup::TextureUnit, target), s);
8396
8397 if (context)
8398 {
8399 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8400 bool isCallValid =
8401 (context->skipValidation() || ValidateMultiTexCoord1f(context, target, s));
8402 if (isCallValid)
8403 {
8404 context->multiTexCoord1f(target, s);
8405 }
8406 ANGLE_CAPTURE(MultiTexCoord1f, isCallValid, context, target, s);
8407 }
8408 else
8409 {
8410 GenerateContextLostErrorOnCurrentGlobalContext();
8411 }
8412 }
8413
GL_MultiTexCoord1fv(GLenum target,const GLfloat * v)8414 void GL_APIENTRY GL_MultiTexCoord1fv(GLenum target, const GLfloat *v)
8415 {
8416 Context *context = GetValidGlobalContext();
8417 EVENT(context, GLMultiTexCoord1fv, "context = %d, target = %s, v = 0x%016" PRIxPTR "",
8418 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), (uintptr_t)v);
8419
8420 if (context)
8421 {
8422 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8423 bool isCallValid =
8424 (context->skipValidation() || ValidateMultiTexCoord1fv(context, target, v));
8425 if (isCallValid)
8426 {
8427 context->multiTexCoord1fv(target, v);
8428 }
8429 ANGLE_CAPTURE(MultiTexCoord1fv, isCallValid, context, target, v);
8430 }
8431 else
8432 {
8433 GenerateContextLostErrorOnCurrentGlobalContext();
8434 }
8435 }
8436
GL_MultiTexCoord1i(GLenum target,GLint s)8437 void GL_APIENTRY GL_MultiTexCoord1i(GLenum target, GLint s)
8438 {
8439 Context *context = GetValidGlobalContext();
8440 EVENT(context, GLMultiTexCoord1i, "context = %d, target = %s, s = %d", CID(context),
8441 GLenumToString(GLenumGroup::TextureUnit, target), s);
8442
8443 if (context)
8444 {
8445 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8446 bool isCallValid =
8447 (context->skipValidation() || ValidateMultiTexCoord1i(context, target, s));
8448 if (isCallValid)
8449 {
8450 context->multiTexCoord1i(target, s);
8451 }
8452 ANGLE_CAPTURE(MultiTexCoord1i, isCallValid, context, target, s);
8453 }
8454 else
8455 {
8456 GenerateContextLostErrorOnCurrentGlobalContext();
8457 }
8458 }
8459
GL_MultiTexCoord1iv(GLenum target,const GLint * v)8460 void GL_APIENTRY GL_MultiTexCoord1iv(GLenum target, const GLint *v)
8461 {
8462 Context *context = GetValidGlobalContext();
8463 EVENT(context, GLMultiTexCoord1iv, "context = %d, target = %s, v = 0x%016" PRIxPTR "",
8464 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), (uintptr_t)v);
8465
8466 if (context)
8467 {
8468 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8469 bool isCallValid =
8470 (context->skipValidation() || ValidateMultiTexCoord1iv(context, target, v));
8471 if (isCallValid)
8472 {
8473 context->multiTexCoord1iv(target, v);
8474 }
8475 ANGLE_CAPTURE(MultiTexCoord1iv, isCallValid, context, target, v);
8476 }
8477 else
8478 {
8479 GenerateContextLostErrorOnCurrentGlobalContext();
8480 }
8481 }
8482
GL_MultiTexCoord1s(GLenum target,GLshort s)8483 void GL_APIENTRY GL_MultiTexCoord1s(GLenum target, GLshort s)
8484 {
8485 Context *context = GetValidGlobalContext();
8486 EVENT(context, GLMultiTexCoord1s, "context = %d, target = %s, s = %d", CID(context),
8487 GLenumToString(GLenumGroup::TextureUnit, target), s);
8488
8489 if (context)
8490 {
8491 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8492 bool isCallValid =
8493 (context->skipValidation() || ValidateMultiTexCoord1s(context, target, s));
8494 if (isCallValid)
8495 {
8496 context->multiTexCoord1s(target, s);
8497 }
8498 ANGLE_CAPTURE(MultiTexCoord1s, isCallValid, context, target, s);
8499 }
8500 else
8501 {
8502 GenerateContextLostErrorOnCurrentGlobalContext();
8503 }
8504 }
8505
GL_MultiTexCoord1sv(GLenum target,const GLshort * v)8506 void GL_APIENTRY GL_MultiTexCoord1sv(GLenum target, const GLshort *v)
8507 {
8508 Context *context = GetValidGlobalContext();
8509 EVENT(context, GLMultiTexCoord1sv, "context = %d, target = %s, v = 0x%016" PRIxPTR "",
8510 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), (uintptr_t)v);
8511
8512 if (context)
8513 {
8514 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8515 bool isCallValid =
8516 (context->skipValidation() || ValidateMultiTexCoord1sv(context, target, v));
8517 if (isCallValid)
8518 {
8519 context->multiTexCoord1sv(target, v);
8520 }
8521 ANGLE_CAPTURE(MultiTexCoord1sv, isCallValid, context, target, v);
8522 }
8523 else
8524 {
8525 GenerateContextLostErrorOnCurrentGlobalContext();
8526 }
8527 }
8528
GL_MultiTexCoord2d(GLenum target,GLdouble s,GLdouble t)8529 void GL_APIENTRY GL_MultiTexCoord2d(GLenum target, GLdouble s, GLdouble t)
8530 {
8531 Context *context = GetValidGlobalContext();
8532 EVENT(context, GLMultiTexCoord2d, "context = %d, target = %s, s = %f, t = %f", CID(context),
8533 GLenumToString(GLenumGroup::TextureUnit, target), s, t);
8534
8535 if (context)
8536 {
8537 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8538 bool isCallValid =
8539 (context->skipValidation() || ValidateMultiTexCoord2d(context, target, s, t));
8540 if (isCallValid)
8541 {
8542 context->multiTexCoord2d(target, s, t);
8543 }
8544 ANGLE_CAPTURE(MultiTexCoord2d, isCallValid, context, target, s, t);
8545 }
8546 else
8547 {
8548 GenerateContextLostErrorOnCurrentGlobalContext();
8549 }
8550 }
8551
GL_MultiTexCoord2dv(GLenum target,const GLdouble * v)8552 void GL_APIENTRY GL_MultiTexCoord2dv(GLenum target, const GLdouble *v)
8553 {
8554 Context *context = GetValidGlobalContext();
8555 EVENT(context, GLMultiTexCoord2dv, "context = %d, target = %s, v = 0x%016" PRIxPTR "",
8556 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), (uintptr_t)v);
8557
8558 if (context)
8559 {
8560 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8561 bool isCallValid =
8562 (context->skipValidation() || ValidateMultiTexCoord2dv(context, target, v));
8563 if (isCallValid)
8564 {
8565 context->multiTexCoord2dv(target, v);
8566 }
8567 ANGLE_CAPTURE(MultiTexCoord2dv, isCallValid, context, target, v);
8568 }
8569 else
8570 {
8571 GenerateContextLostErrorOnCurrentGlobalContext();
8572 }
8573 }
8574
GL_MultiTexCoord2f(GLenum target,GLfloat s,GLfloat t)8575 void GL_APIENTRY GL_MultiTexCoord2f(GLenum target, GLfloat s, GLfloat t)
8576 {
8577 Context *context = GetValidGlobalContext();
8578 EVENT(context, GLMultiTexCoord2f, "context = %d, target = %s, s = %f, t = %f", CID(context),
8579 GLenumToString(GLenumGroup::TextureUnit, target), s, t);
8580
8581 if (context)
8582 {
8583 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8584 bool isCallValid =
8585 (context->skipValidation() || ValidateMultiTexCoord2f(context, target, s, t));
8586 if (isCallValid)
8587 {
8588 context->multiTexCoord2f(target, s, t);
8589 }
8590 ANGLE_CAPTURE(MultiTexCoord2f, isCallValid, context, target, s, t);
8591 }
8592 else
8593 {
8594 GenerateContextLostErrorOnCurrentGlobalContext();
8595 }
8596 }
8597
GL_MultiTexCoord2fv(GLenum target,const GLfloat * v)8598 void GL_APIENTRY GL_MultiTexCoord2fv(GLenum target, const GLfloat *v)
8599 {
8600 Context *context = GetValidGlobalContext();
8601 EVENT(context, GLMultiTexCoord2fv, "context = %d, target = %s, v = 0x%016" PRIxPTR "",
8602 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), (uintptr_t)v);
8603
8604 if (context)
8605 {
8606 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8607 bool isCallValid =
8608 (context->skipValidation() || ValidateMultiTexCoord2fv(context, target, v));
8609 if (isCallValid)
8610 {
8611 context->multiTexCoord2fv(target, v);
8612 }
8613 ANGLE_CAPTURE(MultiTexCoord2fv, isCallValid, context, target, v);
8614 }
8615 else
8616 {
8617 GenerateContextLostErrorOnCurrentGlobalContext();
8618 }
8619 }
8620
GL_MultiTexCoord2i(GLenum target,GLint s,GLint t)8621 void GL_APIENTRY GL_MultiTexCoord2i(GLenum target, GLint s, GLint t)
8622 {
8623 Context *context = GetValidGlobalContext();
8624 EVENT(context, GLMultiTexCoord2i, "context = %d, target = %s, s = %d, t = %d", CID(context),
8625 GLenumToString(GLenumGroup::TextureUnit, target), s, t);
8626
8627 if (context)
8628 {
8629 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8630 bool isCallValid =
8631 (context->skipValidation() || ValidateMultiTexCoord2i(context, target, s, t));
8632 if (isCallValid)
8633 {
8634 context->multiTexCoord2i(target, s, t);
8635 }
8636 ANGLE_CAPTURE(MultiTexCoord2i, isCallValid, context, target, s, t);
8637 }
8638 else
8639 {
8640 GenerateContextLostErrorOnCurrentGlobalContext();
8641 }
8642 }
8643
GL_MultiTexCoord2iv(GLenum target,const GLint * v)8644 void GL_APIENTRY GL_MultiTexCoord2iv(GLenum target, const GLint *v)
8645 {
8646 Context *context = GetValidGlobalContext();
8647 EVENT(context, GLMultiTexCoord2iv, "context = %d, target = %s, v = 0x%016" PRIxPTR "",
8648 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), (uintptr_t)v);
8649
8650 if (context)
8651 {
8652 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8653 bool isCallValid =
8654 (context->skipValidation() || ValidateMultiTexCoord2iv(context, target, v));
8655 if (isCallValid)
8656 {
8657 context->multiTexCoord2iv(target, v);
8658 }
8659 ANGLE_CAPTURE(MultiTexCoord2iv, isCallValid, context, target, v);
8660 }
8661 else
8662 {
8663 GenerateContextLostErrorOnCurrentGlobalContext();
8664 }
8665 }
8666
GL_MultiTexCoord2s(GLenum target,GLshort s,GLshort t)8667 void GL_APIENTRY GL_MultiTexCoord2s(GLenum target, GLshort s, GLshort t)
8668 {
8669 Context *context = GetValidGlobalContext();
8670 EVENT(context, GLMultiTexCoord2s, "context = %d, target = %s, s = %d, t = %d", CID(context),
8671 GLenumToString(GLenumGroup::TextureUnit, target), s, t);
8672
8673 if (context)
8674 {
8675 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8676 bool isCallValid =
8677 (context->skipValidation() || ValidateMultiTexCoord2s(context, target, s, t));
8678 if (isCallValid)
8679 {
8680 context->multiTexCoord2s(target, s, t);
8681 }
8682 ANGLE_CAPTURE(MultiTexCoord2s, isCallValid, context, target, s, t);
8683 }
8684 else
8685 {
8686 GenerateContextLostErrorOnCurrentGlobalContext();
8687 }
8688 }
8689
GL_MultiTexCoord2sv(GLenum target,const GLshort * v)8690 void GL_APIENTRY GL_MultiTexCoord2sv(GLenum target, const GLshort *v)
8691 {
8692 Context *context = GetValidGlobalContext();
8693 EVENT(context, GLMultiTexCoord2sv, "context = %d, target = %s, v = 0x%016" PRIxPTR "",
8694 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), (uintptr_t)v);
8695
8696 if (context)
8697 {
8698 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8699 bool isCallValid =
8700 (context->skipValidation() || ValidateMultiTexCoord2sv(context, target, v));
8701 if (isCallValid)
8702 {
8703 context->multiTexCoord2sv(target, v);
8704 }
8705 ANGLE_CAPTURE(MultiTexCoord2sv, isCallValid, context, target, v);
8706 }
8707 else
8708 {
8709 GenerateContextLostErrorOnCurrentGlobalContext();
8710 }
8711 }
8712
GL_MultiTexCoord3d(GLenum target,GLdouble s,GLdouble t,GLdouble r)8713 void GL_APIENTRY GL_MultiTexCoord3d(GLenum target, GLdouble s, GLdouble t, GLdouble r)
8714 {
8715 Context *context = GetValidGlobalContext();
8716 EVENT(context, GLMultiTexCoord3d, "context = %d, target = %s, s = %f, t = %f, r = %f",
8717 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), s, t, r);
8718
8719 if (context)
8720 {
8721 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8722 bool isCallValid =
8723 (context->skipValidation() || ValidateMultiTexCoord3d(context, target, s, t, r));
8724 if (isCallValid)
8725 {
8726 context->multiTexCoord3d(target, s, t, r);
8727 }
8728 ANGLE_CAPTURE(MultiTexCoord3d, isCallValid, context, target, s, t, r);
8729 }
8730 else
8731 {
8732 GenerateContextLostErrorOnCurrentGlobalContext();
8733 }
8734 }
8735
GL_MultiTexCoord3dv(GLenum target,const GLdouble * v)8736 void GL_APIENTRY GL_MultiTexCoord3dv(GLenum target, const GLdouble *v)
8737 {
8738 Context *context = GetValidGlobalContext();
8739 EVENT(context, GLMultiTexCoord3dv, "context = %d, target = %s, v = 0x%016" PRIxPTR "",
8740 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), (uintptr_t)v);
8741
8742 if (context)
8743 {
8744 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8745 bool isCallValid =
8746 (context->skipValidation() || ValidateMultiTexCoord3dv(context, target, v));
8747 if (isCallValid)
8748 {
8749 context->multiTexCoord3dv(target, v);
8750 }
8751 ANGLE_CAPTURE(MultiTexCoord3dv, isCallValid, context, target, v);
8752 }
8753 else
8754 {
8755 GenerateContextLostErrorOnCurrentGlobalContext();
8756 }
8757 }
8758
GL_MultiTexCoord3f(GLenum target,GLfloat s,GLfloat t,GLfloat r)8759 void GL_APIENTRY GL_MultiTexCoord3f(GLenum target, GLfloat s, GLfloat t, GLfloat r)
8760 {
8761 Context *context = GetValidGlobalContext();
8762 EVENT(context, GLMultiTexCoord3f, "context = %d, target = %s, s = %f, t = %f, r = %f",
8763 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), s, t, r);
8764
8765 if (context)
8766 {
8767 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8768 bool isCallValid =
8769 (context->skipValidation() || ValidateMultiTexCoord3f(context, target, s, t, r));
8770 if (isCallValid)
8771 {
8772 context->multiTexCoord3f(target, s, t, r);
8773 }
8774 ANGLE_CAPTURE(MultiTexCoord3f, isCallValid, context, target, s, t, r);
8775 }
8776 else
8777 {
8778 GenerateContextLostErrorOnCurrentGlobalContext();
8779 }
8780 }
8781
GL_MultiTexCoord3fv(GLenum target,const GLfloat * v)8782 void GL_APIENTRY GL_MultiTexCoord3fv(GLenum target, const GLfloat *v)
8783 {
8784 Context *context = GetValidGlobalContext();
8785 EVENT(context, GLMultiTexCoord3fv, "context = %d, target = %s, v = 0x%016" PRIxPTR "",
8786 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), (uintptr_t)v);
8787
8788 if (context)
8789 {
8790 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8791 bool isCallValid =
8792 (context->skipValidation() || ValidateMultiTexCoord3fv(context, target, v));
8793 if (isCallValid)
8794 {
8795 context->multiTexCoord3fv(target, v);
8796 }
8797 ANGLE_CAPTURE(MultiTexCoord3fv, isCallValid, context, target, v);
8798 }
8799 else
8800 {
8801 GenerateContextLostErrorOnCurrentGlobalContext();
8802 }
8803 }
8804
GL_MultiTexCoord3i(GLenum target,GLint s,GLint t,GLint r)8805 void GL_APIENTRY GL_MultiTexCoord3i(GLenum target, GLint s, GLint t, GLint r)
8806 {
8807 Context *context = GetValidGlobalContext();
8808 EVENT(context, GLMultiTexCoord3i, "context = %d, target = %s, s = %d, t = %d, r = %d",
8809 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), s, t, r);
8810
8811 if (context)
8812 {
8813 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8814 bool isCallValid =
8815 (context->skipValidation() || ValidateMultiTexCoord3i(context, target, s, t, r));
8816 if (isCallValid)
8817 {
8818 context->multiTexCoord3i(target, s, t, r);
8819 }
8820 ANGLE_CAPTURE(MultiTexCoord3i, isCallValid, context, target, s, t, r);
8821 }
8822 else
8823 {
8824 GenerateContextLostErrorOnCurrentGlobalContext();
8825 }
8826 }
8827
GL_MultiTexCoord3iv(GLenum target,const GLint * v)8828 void GL_APIENTRY GL_MultiTexCoord3iv(GLenum target, const GLint *v)
8829 {
8830 Context *context = GetValidGlobalContext();
8831 EVENT(context, GLMultiTexCoord3iv, "context = %d, target = %s, v = 0x%016" PRIxPTR "",
8832 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), (uintptr_t)v);
8833
8834 if (context)
8835 {
8836 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8837 bool isCallValid =
8838 (context->skipValidation() || ValidateMultiTexCoord3iv(context, target, v));
8839 if (isCallValid)
8840 {
8841 context->multiTexCoord3iv(target, v);
8842 }
8843 ANGLE_CAPTURE(MultiTexCoord3iv, isCallValid, context, target, v);
8844 }
8845 else
8846 {
8847 GenerateContextLostErrorOnCurrentGlobalContext();
8848 }
8849 }
8850
GL_MultiTexCoord3s(GLenum target,GLshort s,GLshort t,GLshort r)8851 void GL_APIENTRY GL_MultiTexCoord3s(GLenum target, GLshort s, GLshort t, GLshort r)
8852 {
8853 Context *context = GetValidGlobalContext();
8854 EVENT(context, GLMultiTexCoord3s, "context = %d, target = %s, s = %d, t = %d, r = %d",
8855 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), s, t, r);
8856
8857 if (context)
8858 {
8859 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8860 bool isCallValid =
8861 (context->skipValidation() || ValidateMultiTexCoord3s(context, target, s, t, r));
8862 if (isCallValid)
8863 {
8864 context->multiTexCoord3s(target, s, t, r);
8865 }
8866 ANGLE_CAPTURE(MultiTexCoord3s, isCallValid, context, target, s, t, r);
8867 }
8868 else
8869 {
8870 GenerateContextLostErrorOnCurrentGlobalContext();
8871 }
8872 }
8873
GL_MultiTexCoord3sv(GLenum target,const GLshort * v)8874 void GL_APIENTRY GL_MultiTexCoord3sv(GLenum target, const GLshort *v)
8875 {
8876 Context *context = GetValidGlobalContext();
8877 EVENT(context, GLMultiTexCoord3sv, "context = %d, target = %s, v = 0x%016" PRIxPTR "",
8878 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), (uintptr_t)v);
8879
8880 if (context)
8881 {
8882 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8883 bool isCallValid =
8884 (context->skipValidation() || ValidateMultiTexCoord3sv(context, target, v));
8885 if (isCallValid)
8886 {
8887 context->multiTexCoord3sv(target, v);
8888 }
8889 ANGLE_CAPTURE(MultiTexCoord3sv, isCallValid, context, target, v);
8890 }
8891 else
8892 {
8893 GenerateContextLostErrorOnCurrentGlobalContext();
8894 }
8895 }
8896
GL_MultiTexCoord4d(GLenum target,GLdouble s,GLdouble t,GLdouble r,GLdouble q)8897 void GL_APIENTRY GL_MultiTexCoord4d(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
8898 {
8899 Context *context = GetValidGlobalContext();
8900 EVENT(context, GLMultiTexCoord4d, "context = %d, target = %s, s = %f, t = %f, r = %f, q = %f",
8901 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), s, t, r, q);
8902
8903 if (context)
8904 {
8905 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8906 bool isCallValid =
8907 (context->skipValidation() || ValidateMultiTexCoord4d(context, target, s, t, r, q));
8908 if (isCallValid)
8909 {
8910 context->multiTexCoord4d(target, s, t, r, q);
8911 }
8912 ANGLE_CAPTURE(MultiTexCoord4d, isCallValid, context, target, s, t, r, q);
8913 }
8914 else
8915 {
8916 GenerateContextLostErrorOnCurrentGlobalContext();
8917 }
8918 }
8919
GL_MultiTexCoord4dv(GLenum target,const GLdouble * v)8920 void GL_APIENTRY GL_MultiTexCoord4dv(GLenum target, const GLdouble *v)
8921 {
8922 Context *context = GetValidGlobalContext();
8923 EVENT(context, GLMultiTexCoord4dv, "context = %d, target = %s, v = 0x%016" PRIxPTR "",
8924 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), (uintptr_t)v);
8925
8926 if (context)
8927 {
8928 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8929 bool isCallValid =
8930 (context->skipValidation() || ValidateMultiTexCoord4dv(context, target, v));
8931 if (isCallValid)
8932 {
8933 context->multiTexCoord4dv(target, v);
8934 }
8935 ANGLE_CAPTURE(MultiTexCoord4dv, isCallValid, context, target, v);
8936 }
8937 else
8938 {
8939 GenerateContextLostErrorOnCurrentGlobalContext();
8940 }
8941 }
8942
GL_MultiTexCoord4f(GLenum target,GLfloat s,GLfloat t,GLfloat r,GLfloat q)8943 void GL_APIENTRY GL_MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
8944 {
8945 Context *context = GetValidGlobalContext();
8946 EVENT(context, GLMultiTexCoord4f, "context = %d, target = %s, s = %f, t = %f, r = %f, q = %f",
8947 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), s, t, r, q);
8948
8949 if (context)
8950 {
8951 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8952 bool isCallValid =
8953 (context->skipValidation() || ValidateMultiTexCoord4f(context, target, s, t, r, q));
8954 if (isCallValid)
8955 {
8956 context->multiTexCoord4f(target, s, t, r, q);
8957 }
8958 ANGLE_CAPTURE(MultiTexCoord4f, isCallValid, context, target, s, t, r, q);
8959 }
8960 else
8961 {
8962 GenerateContextLostErrorOnCurrentGlobalContext();
8963 }
8964 }
8965
GL_MultiTexCoord4fv(GLenum target,const GLfloat * v)8966 void GL_APIENTRY GL_MultiTexCoord4fv(GLenum target, const GLfloat *v)
8967 {
8968 Context *context = GetValidGlobalContext();
8969 EVENT(context, GLMultiTexCoord4fv, "context = %d, target = %s, v = 0x%016" PRIxPTR "",
8970 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), (uintptr_t)v);
8971
8972 if (context)
8973 {
8974 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8975 bool isCallValid =
8976 (context->skipValidation() || ValidateMultiTexCoord4fv(context, target, v));
8977 if (isCallValid)
8978 {
8979 context->multiTexCoord4fv(target, v);
8980 }
8981 ANGLE_CAPTURE(MultiTexCoord4fv, isCallValid, context, target, v);
8982 }
8983 else
8984 {
8985 GenerateContextLostErrorOnCurrentGlobalContext();
8986 }
8987 }
8988
GL_MultiTexCoord4i(GLenum target,GLint s,GLint t,GLint r,GLint q)8989 void GL_APIENTRY GL_MultiTexCoord4i(GLenum target, GLint s, GLint t, GLint r, GLint q)
8990 {
8991 Context *context = GetValidGlobalContext();
8992 EVENT(context, GLMultiTexCoord4i, "context = %d, target = %s, s = %d, t = %d, r = %d, q = %d",
8993 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), s, t, r, q);
8994
8995 if (context)
8996 {
8997 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
8998 bool isCallValid =
8999 (context->skipValidation() || ValidateMultiTexCoord4i(context, target, s, t, r, q));
9000 if (isCallValid)
9001 {
9002 context->multiTexCoord4i(target, s, t, r, q);
9003 }
9004 ANGLE_CAPTURE(MultiTexCoord4i, isCallValid, context, target, s, t, r, q);
9005 }
9006 else
9007 {
9008 GenerateContextLostErrorOnCurrentGlobalContext();
9009 }
9010 }
9011
GL_MultiTexCoord4iv(GLenum target,const GLint * v)9012 void GL_APIENTRY GL_MultiTexCoord4iv(GLenum target, const GLint *v)
9013 {
9014 Context *context = GetValidGlobalContext();
9015 EVENT(context, GLMultiTexCoord4iv, "context = %d, target = %s, v = 0x%016" PRIxPTR "",
9016 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), (uintptr_t)v);
9017
9018 if (context)
9019 {
9020 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9021 bool isCallValid =
9022 (context->skipValidation() || ValidateMultiTexCoord4iv(context, target, v));
9023 if (isCallValid)
9024 {
9025 context->multiTexCoord4iv(target, v);
9026 }
9027 ANGLE_CAPTURE(MultiTexCoord4iv, isCallValid, context, target, v);
9028 }
9029 else
9030 {
9031 GenerateContextLostErrorOnCurrentGlobalContext();
9032 }
9033 }
9034
GL_MultiTexCoord4s(GLenum target,GLshort s,GLshort t,GLshort r,GLshort q)9035 void GL_APIENTRY GL_MultiTexCoord4s(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
9036 {
9037 Context *context = GetValidGlobalContext();
9038 EVENT(context, GLMultiTexCoord4s, "context = %d, target = %s, s = %d, t = %d, r = %d, q = %d",
9039 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), s, t, r, q);
9040
9041 if (context)
9042 {
9043 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9044 bool isCallValid =
9045 (context->skipValidation() || ValidateMultiTexCoord4s(context, target, s, t, r, q));
9046 if (isCallValid)
9047 {
9048 context->multiTexCoord4s(target, s, t, r, q);
9049 }
9050 ANGLE_CAPTURE(MultiTexCoord4s, isCallValid, context, target, s, t, r, q);
9051 }
9052 else
9053 {
9054 GenerateContextLostErrorOnCurrentGlobalContext();
9055 }
9056 }
9057
GL_MultiTexCoord4sv(GLenum target,const GLshort * v)9058 void GL_APIENTRY GL_MultiTexCoord4sv(GLenum target, const GLshort *v)
9059 {
9060 Context *context = GetValidGlobalContext();
9061 EVENT(context, GLMultiTexCoord4sv, "context = %d, target = %s, v = 0x%016" PRIxPTR "",
9062 CID(context), GLenumToString(GLenumGroup::TextureUnit, target), (uintptr_t)v);
9063
9064 if (context)
9065 {
9066 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9067 bool isCallValid =
9068 (context->skipValidation() || ValidateMultiTexCoord4sv(context, target, v));
9069 if (isCallValid)
9070 {
9071 context->multiTexCoord4sv(target, v);
9072 }
9073 ANGLE_CAPTURE(MultiTexCoord4sv, isCallValid, context, target, v);
9074 }
9075 else
9076 {
9077 GenerateContextLostErrorOnCurrentGlobalContext();
9078 }
9079 }
9080
GL_SampleCoverage(GLfloat value,GLboolean invert)9081 void GL_APIENTRY GL_SampleCoverage(GLfloat value, GLboolean invert)
9082 {
9083 Context *context = GetValidGlobalContext();
9084 EVENT(context, GLSampleCoverage, "context = %d, value = %f, invert = %s", CID(context), value,
9085 GLbooleanToString(invert));
9086
9087 if (context)
9088 {
9089 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9090 bool isCallValid =
9091 (context->skipValidation() || ValidateSampleCoverage(context, value, invert));
9092 if (isCallValid)
9093 {
9094 context->sampleCoverage(value, invert);
9095 }
9096 ANGLE_CAPTURE(SampleCoverage, isCallValid, context, value, invert);
9097 }
9098 else
9099 {
9100 GenerateContextLostErrorOnCurrentGlobalContext();
9101 }
9102 }
9103
9104 // GL 1.4
GL_BlendColor(GLfloat red,GLfloat green,GLfloat blue,GLfloat alpha)9105 void GL_APIENTRY GL_BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
9106 {
9107 Context *context = GetValidGlobalContext();
9108 EVENT(context, GLBlendColor, "context = %d, red = %f, green = %f, blue = %f, alpha = %f",
9109 CID(context), red, green, blue, alpha);
9110
9111 if (context)
9112 {
9113 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9114 bool isCallValid =
9115 (context->skipValidation() || ValidateBlendColor(context, red, green, blue, alpha));
9116 if (isCallValid)
9117 {
9118 context->blendColor(red, green, blue, alpha);
9119 }
9120 ANGLE_CAPTURE(BlendColor, isCallValid, context, red, green, blue, alpha);
9121 }
9122 else
9123 {
9124 GenerateContextLostErrorOnCurrentGlobalContext();
9125 }
9126 }
9127
GL_BlendEquation(GLenum mode)9128 void GL_APIENTRY GL_BlendEquation(GLenum mode)
9129 {
9130 Context *context = GetValidGlobalContext();
9131 EVENT(context, GLBlendEquation, "context = %d, mode = %s", CID(context),
9132 GLenumToString(GLenumGroup::BlendEquationModeEXT, mode));
9133
9134 if (context)
9135 {
9136 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9137 bool isCallValid = (context->skipValidation() || ValidateBlendEquation(context, mode));
9138 if (isCallValid)
9139 {
9140 context->blendEquation(mode);
9141 }
9142 ANGLE_CAPTURE(BlendEquation, isCallValid, context, mode);
9143 }
9144 else
9145 {
9146 GenerateContextLostErrorOnCurrentGlobalContext();
9147 }
9148 }
9149
GL_BlendFuncSeparate(GLenum sfactorRGB,GLenum dfactorRGB,GLenum sfactorAlpha,GLenum dfactorAlpha)9150 void GL_APIENTRY GL_BlendFuncSeparate(GLenum sfactorRGB,
9151 GLenum dfactorRGB,
9152 GLenum sfactorAlpha,
9153 GLenum dfactorAlpha)
9154 {
9155 Context *context = GetValidGlobalContext();
9156 EVENT(context, GLBlendFuncSeparate,
9157 "context = %d, sfactorRGB = %s, dfactorRGB = %s, sfactorAlpha = %s, dfactorAlpha = %s",
9158 CID(context), GLenumToString(GLenumGroup::BlendingFactor, sfactorRGB),
9159 GLenumToString(GLenumGroup::BlendingFactor, dfactorRGB),
9160 GLenumToString(GLenumGroup::BlendingFactor, sfactorAlpha),
9161 GLenumToString(GLenumGroup::BlendingFactor, dfactorAlpha));
9162
9163 if (context)
9164 {
9165 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9166 bool isCallValid =
9167 (context->skipValidation() || ValidateBlendFuncSeparate(context, sfactorRGB, dfactorRGB,
9168 sfactorAlpha, dfactorAlpha));
9169 if (isCallValid)
9170 {
9171 context->blendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
9172 }
9173 ANGLE_CAPTURE(BlendFuncSeparate, isCallValid, context, sfactorRGB, dfactorRGB, sfactorAlpha,
9174 dfactorAlpha);
9175 }
9176 else
9177 {
9178 GenerateContextLostErrorOnCurrentGlobalContext();
9179 }
9180 }
9181
GL_FogCoordPointer(GLenum type,GLsizei stride,const void * pointer)9182 void GL_APIENTRY GL_FogCoordPointer(GLenum type, GLsizei stride, const void *pointer)
9183 {
9184 Context *context = GetValidGlobalContext();
9185 EVENT(context, GLFogCoordPointer,
9186 "context = %d, type = %s, stride = %d, pointer = 0x%016" PRIxPTR "", CID(context),
9187 GLenumToString(GLenumGroup::FogPointerTypeEXT, type), stride, (uintptr_t)pointer);
9188
9189 if (context)
9190 {
9191 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9192 bool isCallValid =
9193 (context->skipValidation() || ValidateFogCoordPointer(context, type, stride, pointer));
9194 if (isCallValid)
9195 {
9196 context->fogCoordPointer(type, stride, pointer);
9197 }
9198 ANGLE_CAPTURE(FogCoordPointer, isCallValid, context, type, stride, pointer);
9199 }
9200 else
9201 {
9202 GenerateContextLostErrorOnCurrentGlobalContext();
9203 }
9204 }
9205
GL_FogCoordd(GLdouble coord)9206 void GL_APIENTRY GL_FogCoordd(GLdouble coord)
9207 {
9208 Context *context = GetValidGlobalContext();
9209 EVENT(context, GLFogCoordd, "context = %d, coord = %f", CID(context), coord);
9210
9211 if (context)
9212 {
9213 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9214 bool isCallValid = (context->skipValidation() || ValidateFogCoordd(context, coord));
9215 if (isCallValid)
9216 {
9217 context->fogCoordd(coord);
9218 }
9219 ANGLE_CAPTURE(FogCoordd, isCallValid, context, coord);
9220 }
9221 else
9222 {
9223 GenerateContextLostErrorOnCurrentGlobalContext();
9224 }
9225 }
9226
GL_FogCoorddv(const GLdouble * coord)9227 void GL_APIENTRY GL_FogCoorddv(const GLdouble *coord)
9228 {
9229 Context *context = GetValidGlobalContext();
9230 EVENT(context, GLFogCoorddv, "context = %d, coord = 0x%016" PRIxPTR "", CID(context),
9231 (uintptr_t)coord);
9232
9233 if (context)
9234 {
9235 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9236 bool isCallValid = (context->skipValidation() || ValidateFogCoorddv(context, coord));
9237 if (isCallValid)
9238 {
9239 context->fogCoorddv(coord);
9240 }
9241 ANGLE_CAPTURE(FogCoorddv, isCallValid, context, coord);
9242 }
9243 else
9244 {
9245 GenerateContextLostErrorOnCurrentGlobalContext();
9246 }
9247 }
9248
GL_FogCoordf(GLfloat coord)9249 void GL_APIENTRY GL_FogCoordf(GLfloat coord)
9250 {
9251 Context *context = GetValidGlobalContext();
9252 EVENT(context, GLFogCoordf, "context = %d, coord = %f", CID(context), coord);
9253
9254 if (context)
9255 {
9256 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9257 bool isCallValid = (context->skipValidation() || ValidateFogCoordf(context, coord));
9258 if (isCallValid)
9259 {
9260 context->fogCoordf(coord);
9261 }
9262 ANGLE_CAPTURE(FogCoordf, isCallValid, context, coord);
9263 }
9264 else
9265 {
9266 GenerateContextLostErrorOnCurrentGlobalContext();
9267 }
9268 }
9269
GL_FogCoordfv(const GLfloat * coord)9270 void GL_APIENTRY GL_FogCoordfv(const GLfloat *coord)
9271 {
9272 Context *context = GetValidGlobalContext();
9273 EVENT(context, GLFogCoordfv, "context = %d, coord = 0x%016" PRIxPTR "", CID(context),
9274 (uintptr_t)coord);
9275
9276 if (context)
9277 {
9278 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9279 bool isCallValid = (context->skipValidation() || ValidateFogCoordfv(context, coord));
9280 if (isCallValid)
9281 {
9282 context->fogCoordfv(coord);
9283 }
9284 ANGLE_CAPTURE(FogCoordfv, isCallValid, context, coord);
9285 }
9286 else
9287 {
9288 GenerateContextLostErrorOnCurrentGlobalContext();
9289 }
9290 }
9291
GL_MultiDrawArrays(GLenum mode,const GLint * first,const GLsizei * count,GLsizei drawcount)9292 void GL_APIENTRY GL_MultiDrawArrays(GLenum mode,
9293 const GLint *first,
9294 const GLsizei *count,
9295 GLsizei drawcount)
9296 {
9297 Context *context = GetValidGlobalContext();
9298 EVENT(context, GLMultiDrawArrays,
9299 "context = %d, mode = %s, first = 0x%016" PRIxPTR ", count = 0x%016" PRIxPTR
9300 ", drawcount = %d",
9301 CID(context), GLenumToString(GLenumGroup::PrimitiveType, mode), (uintptr_t)first,
9302 (uintptr_t)count, drawcount);
9303
9304 if (context)
9305 {
9306 PrimitiveMode modePacked = PackParam<PrimitiveMode>(mode);
9307 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9308 bool isCallValid = (context->skipValidation() ||
9309 ValidateMultiDrawArrays(context, modePacked, first, count, drawcount));
9310 if (isCallValid)
9311 {
9312 context->multiDrawArrays(modePacked, first, count, drawcount);
9313 }
9314 ANGLE_CAPTURE(MultiDrawArrays, isCallValid, context, modePacked, first, count, drawcount);
9315 }
9316 else
9317 {
9318 GenerateContextLostErrorOnCurrentGlobalContext();
9319 }
9320 }
9321
GL_MultiDrawElements(GLenum mode,const GLsizei * count,GLenum type,const void * const * indices,GLsizei drawcount)9322 void GL_APIENTRY GL_MultiDrawElements(GLenum mode,
9323 const GLsizei *count,
9324 GLenum type,
9325 const void *const *indices,
9326 GLsizei drawcount)
9327 {
9328 Context *context = GetValidGlobalContext();
9329 EVENT(context, GLMultiDrawElements,
9330 "context = %d, mode = %s, count = 0x%016" PRIxPTR ", type = %s, indices = 0x%016" PRIxPTR
9331 ", drawcount = %d",
9332 CID(context), GLenumToString(GLenumGroup::PrimitiveType, mode), (uintptr_t)count,
9333 GLenumToString(GLenumGroup::DrawElementsType, type), (uintptr_t)indices, drawcount);
9334
9335 if (context)
9336 {
9337 PrimitiveMode modePacked = PackParam<PrimitiveMode>(mode);
9338 DrawElementsType typePacked = PackParam<DrawElementsType>(type);
9339 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9340 bool isCallValid =
9341 (context->skipValidation() ||
9342 ValidateMultiDrawElements(context, modePacked, count, typePacked, indices, drawcount));
9343 if (isCallValid)
9344 {
9345 context->multiDrawElements(modePacked, count, typePacked, indices, drawcount);
9346 }
9347 ANGLE_CAPTURE(MultiDrawElements, isCallValid, context, modePacked, count, typePacked,
9348 indices, drawcount);
9349 }
9350 else
9351 {
9352 GenerateContextLostErrorOnCurrentGlobalContext();
9353 }
9354 }
9355
GL_PointParameterf(GLenum pname,GLfloat param)9356 void GL_APIENTRY GL_PointParameterf(GLenum pname, GLfloat param)
9357 {
9358 Context *context = GetValidGlobalContext();
9359 EVENT(context, GLPointParameterf, "context = %d, pname = %s, param = %f", CID(context),
9360 GLenumToString(GLenumGroup::DefaultGroup, pname), param);
9361
9362 if (context)
9363 {
9364 PointParameter pnamePacked = PackParam<PointParameter>(pname);
9365 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9366 bool isCallValid =
9367 (context->skipValidation() || ValidatePointParameterf(context, pnamePacked, param));
9368 if (isCallValid)
9369 {
9370 context->pointParameterf(pnamePacked, param);
9371 }
9372 ANGLE_CAPTURE(PointParameterf, isCallValid, context, pnamePacked, param);
9373 }
9374 else
9375 {
9376 GenerateContextLostErrorOnCurrentGlobalContext();
9377 }
9378 }
9379
GL_PointParameterfv(GLenum pname,const GLfloat * params)9380 void GL_APIENTRY GL_PointParameterfv(GLenum pname, const GLfloat *params)
9381 {
9382 Context *context = GetValidGlobalContext();
9383 EVENT(context, GLPointParameterfv, "context = %d, pname = %s, params = 0x%016" PRIxPTR "",
9384 CID(context), GLenumToString(GLenumGroup::DefaultGroup, pname), (uintptr_t)params);
9385
9386 if (context)
9387 {
9388 PointParameter pnamePacked = PackParam<PointParameter>(pname);
9389 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9390 bool isCallValid =
9391 (context->skipValidation() || ValidatePointParameterfv(context, pnamePacked, params));
9392 if (isCallValid)
9393 {
9394 context->pointParameterfv(pnamePacked, params);
9395 }
9396 ANGLE_CAPTURE(PointParameterfv, isCallValid, context, pnamePacked, params);
9397 }
9398 else
9399 {
9400 GenerateContextLostErrorOnCurrentGlobalContext();
9401 }
9402 }
9403
GL_PointParameteri(GLenum pname,GLint param)9404 void GL_APIENTRY GL_PointParameteri(GLenum pname, GLint param)
9405 {
9406 Context *context = GetValidGlobalContext();
9407 EVENT(context, GLPointParameteri, "context = %d, pname = %s, param = %d", CID(context),
9408 GLenumToString(GLenumGroup::DefaultGroup, pname), param);
9409
9410 if (context)
9411 {
9412 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9413 bool isCallValid =
9414 (context->skipValidation() || ValidatePointParameteri(context, pname, param));
9415 if (isCallValid)
9416 {
9417 context->pointParameteri(pname, param);
9418 }
9419 ANGLE_CAPTURE(PointParameteri, isCallValid, context, pname, param);
9420 }
9421 else
9422 {
9423 GenerateContextLostErrorOnCurrentGlobalContext();
9424 }
9425 }
9426
GL_PointParameteriv(GLenum pname,const GLint * params)9427 void GL_APIENTRY GL_PointParameteriv(GLenum pname, const GLint *params)
9428 {
9429 Context *context = GetValidGlobalContext();
9430 EVENT(context, GLPointParameteriv, "context = %d, pname = %s, params = 0x%016" PRIxPTR "",
9431 CID(context), GLenumToString(GLenumGroup::DefaultGroup, pname), (uintptr_t)params);
9432
9433 if (context)
9434 {
9435 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9436 bool isCallValid =
9437 (context->skipValidation() || ValidatePointParameteriv(context, pname, params));
9438 if (isCallValid)
9439 {
9440 context->pointParameteriv(pname, params);
9441 }
9442 ANGLE_CAPTURE(PointParameteriv, isCallValid, context, pname, params);
9443 }
9444 else
9445 {
9446 GenerateContextLostErrorOnCurrentGlobalContext();
9447 }
9448 }
9449
GL_SecondaryColor3b(GLbyte red,GLbyte green,GLbyte blue)9450 void GL_APIENTRY GL_SecondaryColor3b(GLbyte red, GLbyte green, GLbyte blue)
9451 {
9452 Context *context = GetValidGlobalContext();
9453 EVENT(context, GLSecondaryColor3b, "context = %d, red = %d, green = %d, blue = %d",
9454 CID(context), red, green, blue);
9455
9456 if (context)
9457 {
9458 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9459 bool isCallValid =
9460 (context->skipValidation() || ValidateSecondaryColor3b(context, red, green, blue));
9461 if (isCallValid)
9462 {
9463 context->secondaryColor3b(red, green, blue);
9464 }
9465 ANGLE_CAPTURE(SecondaryColor3b, isCallValid, context, red, green, blue);
9466 }
9467 else
9468 {
9469 GenerateContextLostErrorOnCurrentGlobalContext();
9470 }
9471 }
9472
GL_SecondaryColor3bv(const GLbyte * v)9473 void GL_APIENTRY GL_SecondaryColor3bv(const GLbyte *v)
9474 {
9475 Context *context = GetValidGlobalContext();
9476 EVENT(context, GLSecondaryColor3bv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
9477 (uintptr_t)v);
9478
9479 if (context)
9480 {
9481 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9482 bool isCallValid = (context->skipValidation() || ValidateSecondaryColor3bv(context, v));
9483 if (isCallValid)
9484 {
9485 context->secondaryColor3bv(v);
9486 }
9487 ANGLE_CAPTURE(SecondaryColor3bv, isCallValid, context, v);
9488 }
9489 else
9490 {
9491 GenerateContextLostErrorOnCurrentGlobalContext();
9492 }
9493 }
9494
GL_SecondaryColor3d(GLdouble red,GLdouble green,GLdouble blue)9495 void GL_APIENTRY GL_SecondaryColor3d(GLdouble red, GLdouble green, GLdouble blue)
9496 {
9497 Context *context = GetValidGlobalContext();
9498 EVENT(context, GLSecondaryColor3d, "context = %d, red = %f, green = %f, blue = %f",
9499 CID(context), red, green, blue);
9500
9501 if (context)
9502 {
9503 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9504 bool isCallValid =
9505 (context->skipValidation() || ValidateSecondaryColor3d(context, red, green, blue));
9506 if (isCallValid)
9507 {
9508 context->secondaryColor3d(red, green, blue);
9509 }
9510 ANGLE_CAPTURE(SecondaryColor3d, isCallValid, context, red, green, blue);
9511 }
9512 else
9513 {
9514 GenerateContextLostErrorOnCurrentGlobalContext();
9515 }
9516 }
9517
GL_SecondaryColor3dv(const GLdouble * v)9518 void GL_APIENTRY GL_SecondaryColor3dv(const GLdouble *v)
9519 {
9520 Context *context = GetValidGlobalContext();
9521 EVENT(context, GLSecondaryColor3dv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
9522 (uintptr_t)v);
9523
9524 if (context)
9525 {
9526 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9527 bool isCallValid = (context->skipValidation() || ValidateSecondaryColor3dv(context, v));
9528 if (isCallValid)
9529 {
9530 context->secondaryColor3dv(v);
9531 }
9532 ANGLE_CAPTURE(SecondaryColor3dv, isCallValid, context, v);
9533 }
9534 else
9535 {
9536 GenerateContextLostErrorOnCurrentGlobalContext();
9537 }
9538 }
9539
GL_SecondaryColor3f(GLfloat red,GLfloat green,GLfloat blue)9540 void GL_APIENTRY GL_SecondaryColor3f(GLfloat red, GLfloat green, GLfloat blue)
9541 {
9542 Context *context = GetValidGlobalContext();
9543 EVENT(context, GLSecondaryColor3f, "context = %d, red = %f, green = %f, blue = %f",
9544 CID(context), red, green, blue);
9545
9546 if (context)
9547 {
9548 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9549 bool isCallValid =
9550 (context->skipValidation() || ValidateSecondaryColor3f(context, red, green, blue));
9551 if (isCallValid)
9552 {
9553 context->secondaryColor3f(red, green, blue);
9554 }
9555 ANGLE_CAPTURE(SecondaryColor3f, isCallValid, context, red, green, blue);
9556 }
9557 else
9558 {
9559 GenerateContextLostErrorOnCurrentGlobalContext();
9560 }
9561 }
9562
GL_SecondaryColor3fv(const GLfloat * v)9563 void GL_APIENTRY GL_SecondaryColor3fv(const GLfloat *v)
9564 {
9565 Context *context = GetValidGlobalContext();
9566 EVENT(context, GLSecondaryColor3fv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
9567 (uintptr_t)v);
9568
9569 if (context)
9570 {
9571 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9572 bool isCallValid = (context->skipValidation() || ValidateSecondaryColor3fv(context, v));
9573 if (isCallValid)
9574 {
9575 context->secondaryColor3fv(v);
9576 }
9577 ANGLE_CAPTURE(SecondaryColor3fv, isCallValid, context, v);
9578 }
9579 else
9580 {
9581 GenerateContextLostErrorOnCurrentGlobalContext();
9582 }
9583 }
9584
GL_SecondaryColor3i(GLint red,GLint green,GLint blue)9585 void GL_APIENTRY GL_SecondaryColor3i(GLint red, GLint green, GLint blue)
9586 {
9587 Context *context = GetValidGlobalContext();
9588 EVENT(context, GLSecondaryColor3i, "context = %d, red = %d, green = %d, blue = %d",
9589 CID(context), red, green, blue);
9590
9591 if (context)
9592 {
9593 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9594 bool isCallValid =
9595 (context->skipValidation() || ValidateSecondaryColor3i(context, red, green, blue));
9596 if (isCallValid)
9597 {
9598 context->secondaryColor3i(red, green, blue);
9599 }
9600 ANGLE_CAPTURE(SecondaryColor3i, isCallValid, context, red, green, blue);
9601 }
9602 else
9603 {
9604 GenerateContextLostErrorOnCurrentGlobalContext();
9605 }
9606 }
9607
GL_SecondaryColor3iv(const GLint * v)9608 void GL_APIENTRY GL_SecondaryColor3iv(const GLint *v)
9609 {
9610 Context *context = GetValidGlobalContext();
9611 EVENT(context, GLSecondaryColor3iv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
9612 (uintptr_t)v);
9613
9614 if (context)
9615 {
9616 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9617 bool isCallValid = (context->skipValidation() || ValidateSecondaryColor3iv(context, v));
9618 if (isCallValid)
9619 {
9620 context->secondaryColor3iv(v);
9621 }
9622 ANGLE_CAPTURE(SecondaryColor3iv, isCallValid, context, v);
9623 }
9624 else
9625 {
9626 GenerateContextLostErrorOnCurrentGlobalContext();
9627 }
9628 }
9629
GL_SecondaryColor3s(GLshort red,GLshort green,GLshort blue)9630 void GL_APIENTRY GL_SecondaryColor3s(GLshort red, GLshort green, GLshort blue)
9631 {
9632 Context *context = GetValidGlobalContext();
9633 EVENT(context, GLSecondaryColor3s, "context = %d, red = %d, green = %d, blue = %d",
9634 CID(context), red, green, blue);
9635
9636 if (context)
9637 {
9638 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9639 bool isCallValid =
9640 (context->skipValidation() || ValidateSecondaryColor3s(context, red, green, blue));
9641 if (isCallValid)
9642 {
9643 context->secondaryColor3s(red, green, blue);
9644 }
9645 ANGLE_CAPTURE(SecondaryColor3s, isCallValid, context, red, green, blue);
9646 }
9647 else
9648 {
9649 GenerateContextLostErrorOnCurrentGlobalContext();
9650 }
9651 }
9652
GL_SecondaryColor3sv(const GLshort * v)9653 void GL_APIENTRY GL_SecondaryColor3sv(const GLshort *v)
9654 {
9655 Context *context = GetValidGlobalContext();
9656 EVENT(context, GLSecondaryColor3sv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
9657 (uintptr_t)v);
9658
9659 if (context)
9660 {
9661 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9662 bool isCallValid = (context->skipValidation() || ValidateSecondaryColor3sv(context, v));
9663 if (isCallValid)
9664 {
9665 context->secondaryColor3sv(v);
9666 }
9667 ANGLE_CAPTURE(SecondaryColor3sv, isCallValid, context, v);
9668 }
9669 else
9670 {
9671 GenerateContextLostErrorOnCurrentGlobalContext();
9672 }
9673 }
9674
GL_SecondaryColor3ub(GLubyte red,GLubyte green,GLubyte blue)9675 void GL_APIENTRY GL_SecondaryColor3ub(GLubyte red, GLubyte green, GLubyte blue)
9676 {
9677 Context *context = GetValidGlobalContext();
9678 EVENT(context, GLSecondaryColor3ub, "context = %d, red = %d, green = %d, blue = %d",
9679 CID(context), red, green, blue);
9680
9681 if (context)
9682 {
9683 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9684 bool isCallValid =
9685 (context->skipValidation() || ValidateSecondaryColor3ub(context, red, green, blue));
9686 if (isCallValid)
9687 {
9688 context->secondaryColor3ub(red, green, blue);
9689 }
9690 ANGLE_CAPTURE(SecondaryColor3ub, isCallValid, context, red, green, blue);
9691 }
9692 else
9693 {
9694 GenerateContextLostErrorOnCurrentGlobalContext();
9695 }
9696 }
9697
GL_SecondaryColor3ubv(const GLubyte * v)9698 void GL_APIENTRY GL_SecondaryColor3ubv(const GLubyte *v)
9699 {
9700 Context *context = GetValidGlobalContext();
9701 EVENT(context, GLSecondaryColor3ubv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
9702 (uintptr_t)v);
9703
9704 if (context)
9705 {
9706 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9707 bool isCallValid = (context->skipValidation() || ValidateSecondaryColor3ubv(context, v));
9708 if (isCallValid)
9709 {
9710 context->secondaryColor3ubv(v);
9711 }
9712 ANGLE_CAPTURE(SecondaryColor3ubv, isCallValid, context, v);
9713 }
9714 else
9715 {
9716 GenerateContextLostErrorOnCurrentGlobalContext();
9717 }
9718 }
9719
GL_SecondaryColor3ui(GLuint red,GLuint green,GLuint blue)9720 void GL_APIENTRY GL_SecondaryColor3ui(GLuint red, GLuint green, GLuint blue)
9721 {
9722 Context *context = GetValidGlobalContext();
9723 EVENT(context, GLSecondaryColor3ui, "context = %d, red = %u, green = %u, blue = %u",
9724 CID(context), red, green, blue);
9725
9726 if (context)
9727 {
9728 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9729 bool isCallValid =
9730 (context->skipValidation() || ValidateSecondaryColor3ui(context, red, green, blue));
9731 if (isCallValid)
9732 {
9733 context->secondaryColor3ui(red, green, blue);
9734 }
9735 ANGLE_CAPTURE(SecondaryColor3ui, isCallValid, context, red, green, blue);
9736 }
9737 else
9738 {
9739 GenerateContextLostErrorOnCurrentGlobalContext();
9740 }
9741 }
9742
GL_SecondaryColor3uiv(const GLuint * v)9743 void GL_APIENTRY GL_SecondaryColor3uiv(const GLuint *v)
9744 {
9745 Context *context = GetValidGlobalContext();
9746 EVENT(context, GLSecondaryColor3uiv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
9747 (uintptr_t)v);
9748
9749 if (context)
9750 {
9751 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9752 bool isCallValid = (context->skipValidation() || ValidateSecondaryColor3uiv(context, v));
9753 if (isCallValid)
9754 {
9755 context->secondaryColor3uiv(v);
9756 }
9757 ANGLE_CAPTURE(SecondaryColor3uiv, isCallValid, context, v);
9758 }
9759 else
9760 {
9761 GenerateContextLostErrorOnCurrentGlobalContext();
9762 }
9763 }
9764
GL_SecondaryColor3us(GLushort red,GLushort green,GLushort blue)9765 void GL_APIENTRY GL_SecondaryColor3us(GLushort red, GLushort green, GLushort blue)
9766 {
9767 Context *context = GetValidGlobalContext();
9768 EVENT(context, GLSecondaryColor3us, "context = %d, red = %u, green = %u, blue = %u",
9769 CID(context), red, green, blue);
9770
9771 if (context)
9772 {
9773 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9774 bool isCallValid =
9775 (context->skipValidation() || ValidateSecondaryColor3us(context, red, green, blue));
9776 if (isCallValid)
9777 {
9778 context->secondaryColor3us(red, green, blue);
9779 }
9780 ANGLE_CAPTURE(SecondaryColor3us, isCallValid, context, red, green, blue);
9781 }
9782 else
9783 {
9784 GenerateContextLostErrorOnCurrentGlobalContext();
9785 }
9786 }
9787
GL_SecondaryColor3usv(const GLushort * v)9788 void GL_APIENTRY GL_SecondaryColor3usv(const GLushort *v)
9789 {
9790 Context *context = GetValidGlobalContext();
9791 EVENT(context, GLSecondaryColor3usv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
9792 (uintptr_t)v);
9793
9794 if (context)
9795 {
9796 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9797 bool isCallValid = (context->skipValidation() || ValidateSecondaryColor3usv(context, v));
9798 if (isCallValid)
9799 {
9800 context->secondaryColor3usv(v);
9801 }
9802 ANGLE_CAPTURE(SecondaryColor3usv, isCallValid, context, v);
9803 }
9804 else
9805 {
9806 GenerateContextLostErrorOnCurrentGlobalContext();
9807 }
9808 }
9809
GL_SecondaryColorPointer(GLint size,GLenum type,GLsizei stride,const void * pointer)9810 void GL_APIENTRY GL_SecondaryColorPointer(GLint size,
9811 GLenum type,
9812 GLsizei stride,
9813 const void *pointer)
9814 {
9815 Context *context = GetValidGlobalContext();
9816 EVENT(context, GLSecondaryColorPointer,
9817 "context = %d, size = %d, type = %s, stride = %d, pointer = 0x%016" PRIxPTR "",
9818 CID(context), size, GLenumToString(GLenumGroup::ColorPointerType, type), stride,
9819 (uintptr_t)pointer);
9820
9821 if (context)
9822 {
9823 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9824 bool isCallValid = (context->skipValidation() ||
9825 ValidateSecondaryColorPointer(context, size, type, stride, pointer));
9826 if (isCallValid)
9827 {
9828 context->secondaryColorPointer(size, type, stride, pointer);
9829 }
9830 ANGLE_CAPTURE(SecondaryColorPointer, isCallValid, context, size, type, stride, pointer);
9831 }
9832 else
9833 {
9834 GenerateContextLostErrorOnCurrentGlobalContext();
9835 }
9836 }
9837
GL_WindowPos2d(GLdouble x,GLdouble y)9838 void GL_APIENTRY GL_WindowPos2d(GLdouble x, GLdouble y)
9839 {
9840 Context *context = GetValidGlobalContext();
9841 EVENT(context, GLWindowPos2d, "context = %d, x = %f, y = %f", CID(context), x, y);
9842
9843 if (context)
9844 {
9845 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9846 bool isCallValid = (context->skipValidation() || ValidateWindowPos2d(context, x, y));
9847 if (isCallValid)
9848 {
9849 context->windowPos2d(x, y);
9850 }
9851 ANGLE_CAPTURE(WindowPos2d, isCallValid, context, x, y);
9852 }
9853 else
9854 {
9855 GenerateContextLostErrorOnCurrentGlobalContext();
9856 }
9857 }
9858
GL_WindowPos2dv(const GLdouble * v)9859 void GL_APIENTRY GL_WindowPos2dv(const GLdouble *v)
9860 {
9861 Context *context = GetValidGlobalContext();
9862 EVENT(context, GLWindowPos2dv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
9863 (uintptr_t)v);
9864
9865 if (context)
9866 {
9867 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9868 bool isCallValid = (context->skipValidation() || ValidateWindowPos2dv(context, v));
9869 if (isCallValid)
9870 {
9871 context->windowPos2dv(v);
9872 }
9873 ANGLE_CAPTURE(WindowPos2dv, isCallValid, context, v);
9874 }
9875 else
9876 {
9877 GenerateContextLostErrorOnCurrentGlobalContext();
9878 }
9879 }
9880
GL_WindowPos2f(GLfloat x,GLfloat y)9881 void GL_APIENTRY GL_WindowPos2f(GLfloat x, GLfloat y)
9882 {
9883 Context *context = GetValidGlobalContext();
9884 EVENT(context, GLWindowPos2f, "context = %d, x = %f, y = %f", CID(context), x, y);
9885
9886 if (context)
9887 {
9888 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9889 bool isCallValid = (context->skipValidation() || ValidateWindowPos2f(context, x, y));
9890 if (isCallValid)
9891 {
9892 context->windowPos2f(x, y);
9893 }
9894 ANGLE_CAPTURE(WindowPos2f, isCallValid, context, x, y);
9895 }
9896 else
9897 {
9898 GenerateContextLostErrorOnCurrentGlobalContext();
9899 }
9900 }
9901
GL_WindowPos2fv(const GLfloat * v)9902 void GL_APIENTRY GL_WindowPos2fv(const GLfloat *v)
9903 {
9904 Context *context = GetValidGlobalContext();
9905 EVENT(context, GLWindowPos2fv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
9906 (uintptr_t)v);
9907
9908 if (context)
9909 {
9910 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9911 bool isCallValid = (context->skipValidation() || ValidateWindowPos2fv(context, v));
9912 if (isCallValid)
9913 {
9914 context->windowPos2fv(v);
9915 }
9916 ANGLE_CAPTURE(WindowPos2fv, isCallValid, context, v);
9917 }
9918 else
9919 {
9920 GenerateContextLostErrorOnCurrentGlobalContext();
9921 }
9922 }
9923
GL_WindowPos2i(GLint x,GLint y)9924 void GL_APIENTRY GL_WindowPos2i(GLint x, GLint y)
9925 {
9926 Context *context = GetValidGlobalContext();
9927 EVENT(context, GLWindowPos2i, "context = %d, x = %d, y = %d", CID(context), x, y);
9928
9929 if (context)
9930 {
9931 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9932 bool isCallValid = (context->skipValidation() || ValidateWindowPos2i(context, x, y));
9933 if (isCallValid)
9934 {
9935 context->windowPos2i(x, y);
9936 }
9937 ANGLE_CAPTURE(WindowPos2i, isCallValid, context, x, y);
9938 }
9939 else
9940 {
9941 GenerateContextLostErrorOnCurrentGlobalContext();
9942 }
9943 }
9944
GL_WindowPos2iv(const GLint * v)9945 void GL_APIENTRY GL_WindowPos2iv(const GLint *v)
9946 {
9947 Context *context = GetValidGlobalContext();
9948 EVENT(context, GLWindowPos2iv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
9949 (uintptr_t)v);
9950
9951 if (context)
9952 {
9953 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9954 bool isCallValid = (context->skipValidation() || ValidateWindowPos2iv(context, v));
9955 if (isCallValid)
9956 {
9957 context->windowPos2iv(v);
9958 }
9959 ANGLE_CAPTURE(WindowPos2iv, isCallValid, context, v);
9960 }
9961 else
9962 {
9963 GenerateContextLostErrorOnCurrentGlobalContext();
9964 }
9965 }
9966
GL_WindowPos2s(GLshort x,GLshort y)9967 void GL_APIENTRY GL_WindowPos2s(GLshort x, GLshort y)
9968 {
9969 Context *context = GetValidGlobalContext();
9970 EVENT(context, GLWindowPos2s, "context = %d, x = %d, y = %d", CID(context), x, y);
9971
9972 if (context)
9973 {
9974 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9975 bool isCallValid = (context->skipValidation() || ValidateWindowPos2s(context, x, y));
9976 if (isCallValid)
9977 {
9978 context->windowPos2s(x, y);
9979 }
9980 ANGLE_CAPTURE(WindowPos2s, isCallValid, context, x, y);
9981 }
9982 else
9983 {
9984 GenerateContextLostErrorOnCurrentGlobalContext();
9985 }
9986 }
9987
GL_WindowPos2sv(const GLshort * v)9988 void GL_APIENTRY GL_WindowPos2sv(const GLshort *v)
9989 {
9990 Context *context = GetValidGlobalContext();
9991 EVENT(context, GLWindowPos2sv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
9992 (uintptr_t)v);
9993
9994 if (context)
9995 {
9996 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
9997 bool isCallValid = (context->skipValidation() || ValidateWindowPos2sv(context, v));
9998 if (isCallValid)
9999 {
10000 context->windowPos2sv(v);
10001 }
10002 ANGLE_CAPTURE(WindowPos2sv, isCallValid, context, v);
10003 }
10004 else
10005 {
10006 GenerateContextLostErrorOnCurrentGlobalContext();
10007 }
10008 }
10009
GL_WindowPos3d(GLdouble x,GLdouble y,GLdouble z)10010 void GL_APIENTRY GL_WindowPos3d(GLdouble x, GLdouble y, GLdouble z)
10011 {
10012 Context *context = GetValidGlobalContext();
10013 EVENT(context, GLWindowPos3d, "context = %d, x = %f, y = %f, z = %f", CID(context), x, y, z);
10014
10015 if (context)
10016 {
10017 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10018 bool isCallValid = (context->skipValidation() || ValidateWindowPos3d(context, x, y, z));
10019 if (isCallValid)
10020 {
10021 context->windowPos3d(x, y, z);
10022 }
10023 ANGLE_CAPTURE(WindowPos3d, isCallValid, context, x, y, z);
10024 }
10025 else
10026 {
10027 GenerateContextLostErrorOnCurrentGlobalContext();
10028 }
10029 }
10030
GL_WindowPos3dv(const GLdouble * v)10031 void GL_APIENTRY GL_WindowPos3dv(const GLdouble *v)
10032 {
10033 Context *context = GetValidGlobalContext();
10034 EVENT(context, GLWindowPos3dv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
10035 (uintptr_t)v);
10036
10037 if (context)
10038 {
10039 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10040 bool isCallValid = (context->skipValidation() || ValidateWindowPos3dv(context, v));
10041 if (isCallValid)
10042 {
10043 context->windowPos3dv(v);
10044 }
10045 ANGLE_CAPTURE(WindowPos3dv, isCallValid, context, v);
10046 }
10047 else
10048 {
10049 GenerateContextLostErrorOnCurrentGlobalContext();
10050 }
10051 }
10052
GL_WindowPos3f(GLfloat x,GLfloat y,GLfloat z)10053 void GL_APIENTRY GL_WindowPos3f(GLfloat x, GLfloat y, GLfloat z)
10054 {
10055 Context *context = GetValidGlobalContext();
10056 EVENT(context, GLWindowPos3f, "context = %d, x = %f, y = %f, z = %f", CID(context), x, y, z);
10057
10058 if (context)
10059 {
10060 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10061 bool isCallValid = (context->skipValidation() || ValidateWindowPos3f(context, x, y, z));
10062 if (isCallValid)
10063 {
10064 context->windowPos3f(x, y, z);
10065 }
10066 ANGLE_CAPTURE(WindowPos3f, isCallValid, context, x, y, z);
10067 }
10068 else
10069 {
10070 GenerateContextLostErrorOnCurrentGlobalContext();
10071 }
10072 }
10073
GL_WindowPos3fv(const GLfloat * v)10074 void GL_APIENTRY GL_WindowPos3fv(const GLfloat *v)
10075 {
10076 Context *context = GetValidGlobalContext();
10077 EVENT(context, GLWindowPos3fv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
10078 (uintptr_t)v);
10079
10080 if (context)
10081 {
10082 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10083 bool isCallValid = (context->skipValidation() || ValidateWindowPos3fv(context, v));
10084 if (isCallValid)
10085 {
10086 context->windowPos3fv(v);
10087 }
10088 ANGLE_CAPTURE(WindowPos3fv, isCallValid, context, v);
10089 }
10090 else
10091 {
10092 GenerateContextLostErrorOnCurrentGlobalContext();
10093 }
10094 }
10095
GL_WindowPos3i(GLint x,GLint y,GLint z)10096 void GL_APIENTRY GL_WindowPos3i(GLint x, GLint y, GLint z)
10097 {
10098 Context *context = GetValidGlobalContext();
10099 EVENT(context, GLWindowPos3i, "context = %d, x = %d, y = %d, z = %d", CID(context), x, y, z);
10100
10101 if (context)
10102 {
10103 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10104 bool isCallValid = (context->skipValidation() || ValidateWindowPos3i(context, x, y, z));
10105 if (isCallValid)
10106 {
10107 context->windowPos3i(x, y, z);
10108 }
10109 ANGLE_CAPTURE(WindowPos3i, isCallValid, context, x, y, z);
10110 }
10111 else
10112 {
10113 GenerateContextLostErrorOnCurrentGlobalContext();
10114 }
10115 }
10116
GL_WindowPos3iv(const GLint * v)10117 void GL_APIENTRY GL_WindowPos3iv(const GLint *v)
10118 {
10119 Context *context = GetValidGlobalContext();
10120 EVENT(context, GLWindowPos3iv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
10121 (uintptr_t)v);
10122
10123 if (context)
10124 {
10125 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10126 bool isCallValid = (context->skipValidation() || ValidateWindowPos3iv(context, v));
10127 if (isCallValid)
10128 {
10129 context->windowPos3iv(v);
10130 }
10131 ANGLE_CAPTURE(WindowPos3iv, isCallValid, context, v);
10132 }
10133 else
10134 {
10135 GenerateContextLostErrorOnCurrentGlobalContext();
10136 }
10137 }
10138
GL_WindowPos3s(GLshort x,GLshort y,GLshort z)10139 void GL_APIENTRY GL_WindowPos3s(GLshort x, GLshort y, GLshort z)
10140 {
10141 Context *context = GetValidGlobalContext();
10142 EVENT(context, GLWindowPos3s, "context = %d, x = %d, y = %d, z = %d", CID(context), x, y, z);
10143
10144 if (context)
10145 {
10146 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10147 bool isCallValid = (context->skipValidation() || ValidateWindowPos3s(context, x, y, z));
10148 if (isCallValid)
10149 {
10150 context->windowPos3s(x, y, z);
10151 }
10152 ANGLE_CAPTURE(WindowPos3s, isCallValid, context, x, y, z);
10153 }
10154 else
10155 {
10156 GenerateContextLostErrorOnCurrentGlobalContext();
10157 }
10158 }
10159
GL_WindowPos3sv(const GLshort * v)10160 void GL_APIENTRY GL_WindowPos3sv(const GLshort *v)
10161 {
10162 Context *context = GetValidGlobalContext();
10163 EVENT(context, GLWindowPos3sv, "context = %d, v = 0x%016" PRIxPTR "", CID(context),
10164 (uintptr_t)v);
10165
10166 if (context)
10167 {
10168 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10169 bool isCallValid = (context->skipValidation() || ValidateWindowPos3sv(context, v));
10170 if (isCallValid)
10171 {
10172 context->windowPos3sv(v);
10173 }
10174 ANGLE_CAPTURE(WindowPos3sv, isCallValid, context, v);
10175 }
10176 else
10177 {
10178 GenerateContextLostErrorOnCurrentGlobalContext();
10179 }
10180 }
10181
10182 // GL 1.5
GL_BeginQuery(GLenum target,GLuint id)10183 void GL_APIENTRY GL_BeginQuery(GLenum target, GLuint id)
10184 {
10185 Context *context = GetValidGlobalContext();
10186 EVENT(context, GLBeginQuery, "context = %d, target = %s, id = %u", CID(context),
10187 GLenumToString(GLenumGroup::QueryTarget, target), id);
10188
10189 if (context)
10190 {
10191 QueryType targetPacked = PackParam<QueryType>(target);
10192 QueryID idPacked = PackParam<QueryID>(id);
10193 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10194 bool isCallValid =
10195 (context->skipValidation() || ValidateBeginQuery(context, targetPacked, idPacked));
10196 if (isCallValid)
10197 {
10198 context->beginQuery(targetPacked, idPacked);
10199 }
10200 ANGLE_CAPTURE(BeginQuery, isCallValid, context, targetPacked, idPacked);
10201 }
10202 else
10203 {
10204 GenerateContextLostErrorOnCurrentGlobalContext();
10205 }
10206 }
10207
GL_BindBuffer(GLenum target,GLuint buffer)10208 void GL_APIENTRY GL_BindBuffer(GLenum target, GLuint buffer)
10209 {
10210 Context *context = GetValidGlobalContext();
10211 EVENT(context, GLBindBuffer, "context = %d, target = %s, buffer = %u", CID(context),
10212 GLenumToString(GLenumGroup::BufferTargetARB, target), buffer);
10213
10214 if (context)
10215 {
10216 BufferBinding targetPacked = PackParam<BufferBinding>(target);
10217 BufferID bufferPacked = PackParam<BufferID>(buffer);
10218 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10219 bool isCallValid =
10220 (context->skipValidation() || ValidateBindBuffer(context, targetPacked, bufferPacked));
10221 if (isCallValid)
10222 {
10223 context->bindBuffer(targetPacked, bufferPacked);
10224 }
10225 ANGLE_CAPTURE(BindBuffer, isCallValid, context, targetPacked, bufferPacked);
10226 }
10227 else
10228 {
10229 GenerateContextLostErrorOnCurrentGlobalContext();
10230 }
10231 }
10232
GL_BufferData(GLenum target,GLsizeiptr size,const void * data,GLenum usage)10233 void GL_APIENTRY GL_BufferData(GLenum target, GLsizeiptr size, const void *data, GLenum usage)
10234 {
10235 Context *context = GetValidGlobalContext();
10236 EVENT(context, GLBufferData,
10237 "context = %d, target = %s, size = %llu, data = 0x%016" PRIxPTR ", usage = %s",
10238 CID(context), GLenumToString(GLenumGroup::BufferTargetARB, target),
10239 static_cast<unsigned long long>(size), (uintptr_t)data,
10240 GLenumToString(GLenumGroup::BufferUsageARB, usage));
10241
10242 if (context)
10243 {
10244 BufferBinding targetPacked = PackParam<BufferBinding>(target);
10245 BufferUsage usagePacked = PackParam<BufferUsage>(usage);
10246 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10247 bool isCallValid = (context->skipValidation() ||
10248 ValidateBufferData(context, targetPacked, size, data, usagePacked));
10249 if (isCallValid)
10250 {
10251 context->bufferData(targetPacked, size, data, usagePacked);
10252 }
10253 ANGLE_CAPTURE(BufferData, isCallValid, context, targetPacked, size, data, usagePacked);
10254 }
10255 else
10256 {
10257 GenerateContextLostErrorOnCurrentGlobalContext();
10258 }
10259 }
10260
GL_BufferSubData(GLenum target,GLintptr offset,GLsizeiptr size,const void * data)10261 void GL_APIENTRY GL_BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void *data)
10262 {
10263 Context *context = GetValidGlobalContext();
10264 EVENT(context, GLBufferSubData,
10265 "context = %d, target = %s, offset = %llu, size = %llu, data = 0x%016" PRIxPTR "",
10266 CID(context), GLenumToString(GLenumGroup::BufferTargetARB, target),
10267 static_cast<unsigned long long>(offset), static_cast<unsigned long long>(size),
10268 (uintptr_t)data);
10269
10270 if (context)
10271 {
10272 BufferBinding targetPacked = PackParam<BufferBinding>(target);
10273 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10274 bool isCallValid = (context->skipValidation() ||
10275 ValidateBufferSubData(context, targetPacked, offset, size, data));
10276 if (isCallValid)
10277 {
10278 context->bufferSubData(targetPacked, offset, size, data);
10279 }
10280 ANGLE_CAPTURE(BufferSubData, isCallValid, context, targetPacked, offset, size, data);
10281 }
10282 else
10283 {
10284 GenerateContextLostErrorOnCurrentGlobalContext();
10285 }
10286 }
10287
GL_DeleteBuffers(GLsizei n,const GLuint * buffers)10288 void GL_APIENTRY GL_DeleteBuffers(GLsizei n, const GLuint *buffers)
10289 {
10290 Context *context = GetValidGlobalContext();
10291 EVENT(context, GLDeleteBuffers, "context = %d, n = %d, buffers = 0x%016" PRIxPTR "",
10292 CID(context), n, (uintptr_t)buffers);
10293
10294 if (context)
10295 {
10296 const BufferID *buffersPacked = PackParam<const BufferID *>(buffers);
10297 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10298 bool isCallValid =
10299 (context->skipValidation() || ValidateDeleteBuffers(context, n, buffersPacked));
10300 if (isCallValid)
10301 {
10302 context->deleteBuffers(n, buffersPacked);
10303 }
10304 ANGLE_CAPTURE(DeleteBuffers, isCallValid, context, n, buffersPacked);
10305 }
10306 else
10307 {
10308 GenerateContextLostErrorOnCurrentGlobalContext();
10309 }
10310 }
10311
GL_DeleteQueries(GLsizei n,const GLuint * ids)10312 void GL_APIENTRY GL_DeleteQueries(GLsizei n, const GLuint *ids)
10313 {
10314 Context *context = GetValidGlobalContext();
10315 EVENT(context, GLDeleteQueries, "context = %d, n = %d, ids = 0x%016" PRIxPTR "", CID(context),
10316 n, (uintptr_t)ids);
10317
10318 if (context)
10319 {
10320 const QueryID *idsPacked = PackParam<const QueryID *>(ids);
10321 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10322 bool isCallValid =
10323 (context->skipValidation() || ValidateDeleteQueries(context, n, idsPacked));
10324 if (isCallValid)
10325 {
10326 context->deleteQueries(n, idsPacked);
10327 }
10328 ANGLE_CAPTURE(DeleteQueries, isCallValid, context, n, idsPacked);
10329 }
10330 else
10331 {
10332 GenerateContextLostErrorOnCurrentGlobalContext();
10333 }
10334 }
10335
GL_EndQuery(GLenum target)10336 void GL_APIENTRY GL_EndQuery(GLenum target)
10337 {
10338 Context *context = GetValidGlobalContext();
10339 EVENT(context, GLEndQuery, "context = %d, target = %s", CID(context),
10340 GLenumToString(GLenumGroup::QueryTarget, target));
10341
10342 if (context)
10343 {
10344 QueryType targetPacked = PackParam<QueryType>(target);
10345 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10346 bool isCallValid = (context->skipValidation() || ValidateEndQuery(context, targetPacked));
10347 if (isCallValid)
10348 {
10349 context->endQuery(targetPacked);
10350 }
10351 ANGLE_CAPTURE(EndQuery, isCallValid, context, targetPacked);
10352 }
10353 else
10354 {
10355 GenerateContextLostErrorOnCurrentGlobalContext();
10356 }
10357 }
10358
GL_GenBuffers(GLsizei n,GLuint * buffers)10359 void GL_APIENTRY GL_GenBuffers(GLsizei n, GLuint *buffers)
10360 {
10361 Context *context = GetValidGlobalContext();
10362 EVENT(context, GLGenBuffers, "context = %d, n = %d, buffers = 0x%016" PRIxPTR "", CID(context),
10363 n, (uintptr_t)buffers);
10364
10365 if (context)
10366 {
10367 BufferID *buffersPacked = PackParam<BufferID *>(buffers);
10368 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10369 bool isCallValid =
10370 (context->skipValidation() || ValidateGenBuffers(context, n, buffersPacked));
10371 if (isCallValid)
10372 {
10373 context->genBuffers(n, buffersPacked);
10374 }
10375 ANGLE_CAPTURE(GenBuffers, isCallValid, context, n, buffersPacked);
10376 }
10377 else
10378 {
10379 GenerateContextLostErrorOnCurrentGlobalContext();
10380 }
10381 }
10382
GL_GenQueries(GLsizei n,GLuint * ids)10383 void GL_APIENTRY GL_GenQueries(GLsizei n, GLuint *ids)
10384 {
10385 Context *context = GetValidGlobalContext();
10386 EVENT(context, GLGenQueries, "context = %d, n = %d, ids = 0x%016" PRIxPTR "", CID(context), n,
10387 (uintptr_t)ids);
10388
10389 if (context)
10390 {
10391 QueryID *idsPacked = PackParam<QueryID *>(ids);
10392 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10393 bool isCallValid = (context->skipValidation() || ValidateGenQueries(context, n, idsPacked));
10394 if (isCallValid)
10395 {
10396 context->genQueries(n, idsPacked);
10397 }
10398 ANGLE_CAPTURE(GenQueries, isCallValid, context, n, idsPacked);
10399 }
10400 else
10401 {
10402 GenerateContextLostErrorOnCurrentGlobalContext();
10403 }
10404 }
10405
GL_GetBufferParameteriv(GLenum target,GLenum pname,GLint * params)10406 void GL_APIENTRY GL_GetBufferParameteriv(GLenum target, GLenum pname, GLint *params)
10407 {
10408 Context *context = GetValidGlobalContext();
10409 EVENT(context, GLGetBufferParameteriv,
10410 "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
10411 GLenumToString(GLenumGroup::BufferTargetARB, target),
10412 GLenumToString(GLenumGroup::DefaultGroup, pname), (uintptr_t)params);
10413
10414 if (context)
10415 {
10416 BufferBinding targetPacked = PackParam<BufferBinding>(target);
10417 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10418 bool isCallValid = (context->skipValidation() ||
10419 ValidateGetBufferParameteriv(context, targetPacked, pname, params));
10420 if (isCallValid)
10421 {
10422 context->getBufferParameteriv(targetPacked, pname, params);
10423 }
10424 ANGLE_CAPTURE(GetBufferParameteriv, isCallValid, context, targetPacked, pname, params);
10425 }
10426 else
10427 {
10428 GenerateContextLostErrorOnCurrentGlobalContext();
10429 }
10430 }
10431
GL_GetBufferPointerv(GLenum target,GLenum pname,void ** params)10432 void GL_APIENTRY GL_GetBufferPointerv(GLenum target, GLenum pname, void **params)
10433 {
10434 Context *context = GetValidGlobalContext();
10435 EVENT(context, GLGetBufferPointerv,
10436 "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
10437 GLenumToString(GLenumGroup::BufferTargetARB, target),
10438 GLenumToString(GLenumGroup::DefaultGroup, pname), (uintptr_t)params);
10439
10440 if (context)
10441 {
10442 BufferBinding targetPacked = PackParam<BufferBinding>(target);
10443 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10444 bool isCallValid = (context->skipValidation() ||
10445 ValidateGetBufferPointerv(context, targetPacked, pname, params));
10446 if (isCallValid)
10447 {
10448 context->getBufferPointerv(targetPacked, pname, params);
10449 }
10450 ANGLE_CAPTURE(GetBufferPointerv, isCallValid, context, targetPacked, pname, params);
10451 }
10452 else
10453 {
10454 GenerateContextLostErrorOnCurrentGlobalContext();
10455 }
10456 }
10457
GL_GetBufferSubData(GLenum target,GLintptr offset,GLsizeiptr size,void * data)10458 void GL_APIENTRY GL_GetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, void *data)
10459 {
10460 Context *context = GetValidGlobalContext();
10461 EVENT(context, GLGetBufferSubData,
10462 "context = %d, target = %s, offset = %llu, size = %llu, data = 0x%016" PRIxPTR "",
10463 CID(context), GLenumToString(GLenumGroup::BufferTargetARB, target),
10464 static_cast<unsigned long long>(offset), static_cast<unsigned long long>(size),
10465 (uintptr_t)data);
10466
10467 if (context)
10468 {
10469 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10470 bool isCallValid = (context->skipValidation() ||
10471 ValidateGetBufferSubData(context, target, offset, size, data));
10472 if (isCallValid)
10473 {
10474 context->getBufferSubData(target, offset, size, data);
10475 }
10476 ANGLE_CAPTURE(GetBufferSubData, isCallValid, context, target, offset, size, data);
10477 }
10478 else
10479 {
10480 GenerateContextLostErrorOnCurrentGlobalContext();
10481 }
10482 }
10483
GL_GetQueryObjectiv(GLuint id,GLenum pname,GLint * params)10484 void GL_APIENTRY GL_GetQueryObjectiv(GLuint id, GLenum pname, GLint *params)
10485 {
10486 Context *context = GetGlobalContext();
10487 EVENT(context, GLGetQueryObjectiv,
10488 "context = %d, id = %u, pname = %s, params = 0x%016" PRIxPTR "", CID(context), id,
10489 GLenumToString(GLenumGroup::QueryObjectParameterName, pname), (uintptr_t)params);
10490
10491 if (context)
10492 {
10493 QueryID idPacked = PackParam<QueryID>(id);
10494 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10495 bool isCallValid = (context->skipValidation() ||
10496 ValidateGetQueryObjectiv(context, idPacked, pname, params));
10497 if (isCallValid)
10498 {
10499 context->getQueryObjectiv(idPacked, pname, params);
10500 }
10501 ANGLE_CAPTURE(GetQueryObjectiv, isCallValid, context, idPacked, pname, params);
10502 }
10503 else
10504 {}
10505 }
10506
GL_GetQueryObjectuiv(GLuint id,GLenum pname,GLuint * params)10507 void GL_APIENTRY GL_GetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params)
10508 {
10509 Context *context = GetValidGlobalContext();
10510 EVENT(context, GLGetQueryObjectuiv,
10511 "context = %d, id = %u, pname = %s, params = 0x%016" PRIxPTR "", CID(context), id,
10512 GLenumToString(GLenumGroup::QueryObjectParameterName, pname), (uintptr_t)params);
10513
10514 if (context)
10515 {
10516 QueryID idPacked = PackParam<QueryID>(id);
10517 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10518 bool isCallValid = (context->skipValidation() ||
10519 ValidateGetQueryObjectuiv(context, idPacked, pname, params));
10520 if (isCallValid)
10521 {
10522 context->getQueryObjectuiv(idPacked, pname, params);
10523 }
10524 ANGLE_CAPTURE(GetQueryObjectuiv, isCallValid, context, idPacked, pname, params);
10525 }
10526 else
10527 {
10528 GenerateContextLostErrorOnCurrentGlobalContext();
10529 }
10530 }
10531
GL_GetQueryiv(GLenum target,GLenum pname,GLint * params)10532 void GL_APIENTRY GL_GetQueryiv(GLenum target, GLenum pname, GLint *params)
10533 {
10534 Context *context = GetValidGlobalContext();
10535 EVENT(context, GLGetQueryiv,
10536 "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
10537 GLenumToString(GLenumGroup::QueryTarget, target),
10538 GLenumToString(GLenumGroup::QueryParameterName, pname), (uintptr_t)params);
10539
10540 if (context)
10541 {
10542 QueryType targetPacked = PackParam<QueryType>(target);
10543 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10544 bool isCallValid =
10545 (context->skipValidation() || ValidateGetQueryiv(context, targetPacked, pname, params));
10546 if (isCallValid)
10547 {
10548 context->getQueryiv(targetPacked, pname, params);
10549 }
10550 ANGLE_CAPTURE(GetQueryiv, isCallValid, context, targetPacked, pname, params);
10551 }
10552 else
10553 {
10554 GenerateContextLostErrorOnCurrentGlobalContext();
10555 }
10556 }
10557
GL_IsBuffer(GLuint buffer)10558 GLboolean GL_APIENTRY GL_IsBuffer(GLuint buffer)
10559 {
10560 Context *context = GetValidGlobalContext();
10561 EVENT(context, GLIsBuffer, "context = %d, buffer = %u", CID(context), buffer);
10562
10563 GLboolean returnValue;
10564 if (context)
10565 {
10566 BufferID bufferPacked = PackParam<BufferID>(buffer);
10567 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10568 bool isCallValid = (context->skipValidation() || ValidateIsBuffer(context, bufferPacked));
10569 if (isCallValid)
10570 {
10571 returnValue = context->isBuffer(bufferPacked);
10572 }
10573 else
10574 {
10575 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsBuffer, GLboolean>();
10576 }
10577 ANGLE_CAPTURE(IsBuffer, isCallValid, context, bufferPacked, returnValue);
10578 }
10579 else
10580 {
10581 GenerateContextLostErrorOnCurrentGlobalContext();
10582 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsBuffer, GLboolean>();
10583 }
10584 return returnValue;
10585 }
10586
GL_IsQuery(GLuint id)10587 GLboolean GL_APIENTRY GL_IsQuery(GLuint id)
10588 {
10589 Context *context = GetValidGlobalContext();
10590 EVENT(context, GLIsQuery, "context = %d, id = %u", CID(context), id);
10591
10592 GLboolean returnValue;
10593 if (context)
10594 {
10595 QueryID idPacked = PackParam<QueryID>(id);
10596 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10597 bool isCallValid = (context->skipValidation() || ValidateIsQuery(context, idPacked));
10598 if (isCallValid)
10599 {
10600 returnValue = context->isQuery(idPacked);
10601 }
10602 else
10603 {
10604 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsQuery, GLboolean>();
10605 }
10606 ANGLE_CAPTURE(IsQuery, isCallValid, context, idPacked, returnValue);
10607 }
10608 else
10609 {
10610 GenerateContextLostErrorOnCurrentGlobalContext();
10611 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsQuery, GLboolean>();
10612 }
10613 return returnValue;
10614 }
10615
GL_MapBuffer(GLenum target,GLenum access)10616 void *GL_APIENTRY GL_MapBuffer(GLenum target, GLenum access)
10617 {
10618 Context *context = GetValidGlobalContext();
10619 EVENT(context, GLMapBuffer, "context = %d, target = %s, access = %s", CID(context),
10620 GLenumToString(GLenumGroup::BufferTargetARB, target),
10621 GLenumToString(GLenumGroup::BufferAccessARB, access));
10622
10623 void *returnValue;
10624 if (context)
10625 {
10626 BufferBinding targetPacked = PackParam<BufferBinding>(target);
10627 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10628 bool isCallValid =
10629 (context->skipValidation() || ValidateMapBuffer(context, targetPacked, access));
10630 if (isCallValid)
10631 {
10632 returnValue = context->mapBuffer(targetPacked, access);
10633 }
10634 else
10635 {
10636 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLMapBuffer, void *>();
10637 }
10638 ANGLE_CAPTURE(MapBuffer, isCallValid, context, targetPacked, access, returnValue);
10639 }
10640 else
10641 {
10642 GenerateContextLostErrorOnCurrentGlobalContext();
10643 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLMapBuffer, void *>();
10644 }
10645 return returnValue;
10646 }
10647
GL_UnmapBuffer(GLenum target)10648 GLboolean GL_APIENTRY GL_UnmapBuffer(GLenum target)
10649 {
10650 Context *context = GetValidGlobalContext();
10651 EVENT(context, GLUnmapBuffer, "context = %d, target = %s", CID(context),
10652 GLenumToString(GLenumGroup::BufferTargetARB, target));
10653
10654 GLboolean returnValue;
10655 if (context)
10656 {
10657 BufferBinding targetPacked = PackParam<BufferBinding>(target);
10658 std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
10659 bool isCallValid =
10660 (context->skipValidation() || ValidateUnmapBuffer(context, targetPacked));
10661 if (isCallValid)
10662 {
10663 returnValue = context->unmapBuffer(targetPacked);
10664 }
10665 else
10666 {
10667 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLUnmapBuffer, GLboolean>();
10668 }
10669 ANGLE_CAPTURE(UnmapBuffer, isCallValid, context, targetPacked, returnValue);
10670 }
10671 else
10672 {
10673 GenerateContextLostErrorOnCurrentGlobalContext();
10674 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLUnmapBuffer, GLboolean>();
10675 }
10676 return returnValue;
10677 }
10678
10679 } // extern "C"
10680