• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by generate_entry_points.py using data from gl.xml.
3 //
4 // Copyright 2020 The ANGLE Project Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style license that can be
6 // found in the LICENSE file.
7 //
8 // entry_points_gles_1_0_autogen.cpp:
9 //   Defines the GLES 1.0 entry points.
10 
11 #include "libGLESv2/entry_points_gles_1_0_autogen.h"
12 
13 #include "common/entry_points_enum_autogen.h"
14 #include "libANGLE/Context.h"
15 #include "libANGLE/Context.inl.h"
16 #include "libANGLE/capture/capture_gles_1_0_autogen.h"
17 #include "libANGLE/capture/gl_enum_utils.h"
18 #include "libANGLE/entry_points_utils.h"
19 #include "libANGLE/validationES1.h"
20 #include "libGLESv2/global_state.h"
21 
22 using namespace gl;
23 
24 extern "C" {
GL_AlphaFunc(GLenum func,GLfloat ref)25 void GL_APIENTRY GL_AlphaFunc(GLenum func, GLfloat ref)
26 {
27     Context *context = GetValidGlobalContext();
28     EVENT(context, GLAlphaFunc, "context = %d, func = %s, ref = %f", CID(context),
29           GLenumToString(GLenumGroup::AlphaFunction, func), ref);
30 
31     if (context)
32     {
33         AlphaTestFunc funcPacked                              = PackParam<AlphaTestFunc>(func);
34         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
35         bool isCallValid =
36             (context->skipValidation() ||
37              ValidateAlphaFunc(context, angle::EntryPoint::GLAlphaFunc, funcPacked, ref));
38         if (isCallValid)
39         {
40             context->alphaFunc(funcPacked, ref);
41         }
42         ANGLE_CAPTURE(AlphaFunc, isCallValid, context, funcPacked, ref);
43     }
44     else
45     {
46         GenerateContextLostErrorOnCurrentGlobalContext();
47     }
48 }
49 
GL_AlphaFuncx(GLenum func,GLfixed ref)50 void GL_APIENTRY GL_AlphaFuncx(GLenum func, GLfixed ref)
51 {
52     Context *context = GetValidGlobalContext();
53     EVENT(context, GLAlphaFuncx, "context = %d, func = %s, ref = 0x%X", CID(context),
54           GLenumToString(GLenumGroup::AlphaFunction, func), ref);
55 
56     if (context)
57     {
58         AlphaTestFunc funcPacked                              = PackParam<AlphaTestFunc>(func);
59         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
60         bool isCallValid =
61             (context->skipValidation() ||
62              ValidateAlphaFuncx(context, angle::EntryPoint::GLAlphaFuncx, funcPacked, ref));
63         if (isCallValid)
64         {
65             context->alphaFuncx(funcPacked, ref);
66         }
67         ANGLE_CAPTURE(AlphaFuncx, isCallValid, context, funcPacked, ref);
68     }
69     else
70     {
71         GenerateContextLostErrorOnCurrentGlobalContext();
72     }
73 }
74 
GL_ClearColorx(GLfixed red,GLfixed green,GLfixed blue,GLfixed alpha)75 void GL_APIENTRY GL_ClearColorx(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
76 {
77     Context *context = GetValidGlobalContext();
78     EVENT(context, GLClearColorx,
79           "context = %d, red = 0x%X, green = 0x%X, blue = 0x%X, alpha = 0x%X", CID(context), red,
80           green, blue, alpha);
81 
82     if (context)
83     {
84         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
85         bool isCallValid                                      = (context->skipValidation() ||
86                             ValidateClearColorx(context, angle::EntryPoint::GLClearColorx, red,
87                                                 green, blue, alpha));
88         if (isCallValid)
89         {
90             context->clearColorx(red, green, blue, alpha);
91         }
92         ANGLE_CAPTURE(ClearColorx, isCallValid, context, red, green, blue, alpha);
93     }
94     else
95     {
96         GenerateContextLostErrorOnCurrentGlobalContext();
97     }
98 }
99 
GL_ClearDepthx(GLfixed depth)100 void GL_APIENTRY GL_ClearDepthx(GLfixed depth)
101 {
102     Context *context = GetValidGlobalContext();
103     EVENT(context, GLClearDepthx, "context = %d, depth = 0x%X", CID(context), depth);
104 
105     if (context)
106     {
107         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
108         bool isCallValid                                      = (context->skipValidation() ||
109                             ValidateClearDepthx(context, angle::EntryPoint::GLClearDepthx, depth));
110         if (isCallValid)
111         {
112             context->clearDepthx(depth);
113         }
114         ANGLE_CAPTURE(ClearDepthx, isCallValid, context, depth);
115     }
116     else
117     {
118         GenerateContextLostErrorOnCurrentGlobalContext();
119     }
120 }
121 
GL_ClientActiveTexture(GLenum texture)122 void GL_APIENTRY GL_ClientActiveTexture(GLenum texture)
123 {
124     Context *context = GetValidGlobalContext();
125     EVENT(context, GLClientActiveTexture, "context = %d, texture = %s", CID(context),
126           GLenumToString(GLenumGroup::TextureUnit, texture));
127 
128     if (context)
129     {
130         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
131         bool isCallValid                                      = (context->skipValidation() ||
132                             ValidateClientActiveTexture(
133                                 context, angle::EntryPoint::GLClientActiveTexture, texture));
134         if (isCallValid)
135         {
136             context->clientActiveTexture(texture);
137         }
138         ANGLE_CAPTURE(ClientActiveTexture, isCallValid, context, texture);
139     }
140     else
141     {
142         GenerateContextLostErrorOnCurrentGlobalContext();
143     }
144 }
145 
GL_ClipPlanef(GLenum p,const GLfloat * eqn)146 void GL_APIENTRY GL_ClipPlanef(GLenum p, const GLfloat *eqn)
147 {
148     Context *context = GetValidGlobalContext();
149     EVENT(context, GLClipPlanef, "context = %d, p = %s, eqn = 0x%016" PRIxPTR "", CID(context),
150           GLenumToString(GLenumGroup::ClipPlaneName, p), (uintptr_t)eqn);
151 
152     if (context)
153     {
154         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
155         bool isCallValid                                      = (context->skipValidation() ||
156                             ValidateClipPlanef(context, angle::EntryPoint::GLClipPlanef, p, eqn));
157         if (isCallValid)
158         {
159             context->clipPlanef(p, eqn);
160         }
161         ANGLE_CAPTURE(ClipPlanef, isCallValid, context, p, eqn);
162     }
163     else
164     {
165         GenerateContextLostErrorOnCurrentGlobalContext();
166     }
167 }
168 
GL_ClipPlanex(GLenum plane,const GLfixed * equation)169 void GL_APIENTRY GL_ClipPlanex(GLenum plane, const GLfixed *equation)
170 {
171     Context *context = GetValidGlobalContext();
172     EVENT(context, GLClipPlanex, "context = %d, plane = %s, equation = 0x%016" PRIxPTR "",
173           CID(context), GLenumToString(GLenumGroup::ClipPlaneName, plane), (uintptr_t)equation);
174 
175     if (context)
176     {
177         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
178         bool isCallValid =
179             (context->skipValidation() ||
180              ValidateClipPlanex(context, angle::EntryPoint::GLClipPlanex, plane, equation));
181         if (isCallValid)
182         {
183             context->clipPlanex(plane, equation);
184         }
185         ANGLE_CAPTURE(ClipPlanex, isCallValid, context, plane, equation);
186     }
187     else
188     {
189         GenerateContextLostErrorOnCurrentGlobalContext();
190     }
191 }
192 
GL_Color4f(GLfloat red,GLfloat green,GLfloat blue,GLfloat alpha)193 void GL_APIENTRY GL_Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
194 {
195     Context *context = GetValidGlobalContext();
196     EVENT(context, GLColor4f, "context = %d, red = %f, green = %f, blue = %f, alpha = %f",
197           CID(context), red, green, blue, alpha);
198 
199     if (context)
200     {
201         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
202         bool isCallValid =
203             (context->skipValidation() ||
204              ValidateColor4f(context, angle::EntryPoint::GLColor4f, red, green, blue, alpha));
205         if (isCallValid)
206         {
207             context->color4f(red, green, blue, alpha);
208         }
209         ANGLE_CAPTURE(Color4f, isCallValid, context, red, green, blue, alpha);
210     }
211     else
212     {
213         GenerateContextLostErrorOnCurrentGlobalContext();
214     }
215 }
216 
GL_Color4ub(GLubyte red,GLubyte green,GLubyte blue,GLubyte alpha)217 void GL_APIENTRY GL_Color4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
218 {
219     Context *context = GetValidGlobalContext();
220     EVENT(context, GLColor4ub, "context = %d, red = %d, green = %d, blue = %d, alpha = %d",
221           CID(context), red, green, blue, alpha);
222 
223     if (context)
224     {
225         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
226         bool isCallValid =
227             (context->skipValidation() ||
228              ValidateColor4ub(context, angle::EntryPoint::GLColor4ub, red, green, blue, alpha));
229         if (isCallValid)
230         {
231             context->color4ub(red, green, blue, alpha);
232         }
233         ANGLE_CAPTURE(Color4ub, isCallValid, context, red, green, blue, alpha);
234     }
235     else
236     {
237         GenerateContextLostErrorOnCurrentGlobalContext();
238     }
239 }
240 
GL_Color4x(GLfixed red,GLfixed green,GLfixed blue,GLfixed alpha)241 void GL_APIENTRY GL_Color4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
242 {
243     Context *context = GetValidGlobalContext();
244     EVENT(context, GLColor4x, "context = %d, red = 0x%X, green = 0x%X, blue = 0x%X, alpha = 0x%X",
245           CID(context), red, green, blue, alpha);
246 
247     if (context)
248     {
249         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
250         bool isCallValid =
251             (context->skipValidation() ||
252              ValidateColor4x(context, angle::EntryPoint::GLColor4x, red, green, blue, alpha));
253         if (isCallValid)
254         {
255             context->color4x(red, green, blue, alpha);
256         }
257         ANGLE_CAPTURE(Color4x, isCallValid, context, red, green, blue, alpha);
258     }
259     else
260     {
261         GenerateContextLostErrorOnCurrentGlobalContext();
262     }
263 }
264 
GL_ColorPointer(GLint size,GLenum type,GLsizei stride,const void * pointer)265 void GL_APIENTRY GL_ColorPointer(GLint size, GLenum type, GLsizei stride, const void *pointer)
266 {
267     Context *context = GetValidGlobalContext();
268     EVENT(context, GLColorPointer,
269           "context = %d, size = %d, type = %s, stride = %d, pointer = 0x%016" PRIxPTR "",
270           CID(context), size, GLenumToString(GLenumGroup::ColorPointerType, type), stride,
271           (uintptr_t)pointer);
272 
273     if (context)
274     {
275         VertexAttribType typePacked                           = PackParam<VertexAttribType>(type);
276         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
277         bool isCallValid                                      = (context->skipValidation() ||
278                             ValidateColorPointer(context, angle::EntryPoint::GLColorPointer, size,
279                                                  typePacked, stride, pointer));
280         if (isCallValid)
281         {
282             context->colorPointer(size, typePacked, stride, pointer);
283         }
284         ANGLE_CAPTURE(ColorPointer, isCallValid, context, size, typePacked, stride, pointer);
285     }
286     else
287     {
288         GenerateContextLostErrorOnCurrentGlobalContext();
289     }
290 }
291 
GL_DepthRangex(GLfixed n,GLfixed f)292 void GL_APIENTRY GL_DepthRangex(GLfixed n, GLfixed f)
293 {
294     Context *context = GetValidGlobalContext();
295     EVENT(context, GLDepthRangex, "context = %d, n = 0x%X, f = 0x%X", CID(context), n, f);
296 
297     if (context)
298     {
299         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
300         bool isCallValid                                      = (context->skipValidation() ||
301                             ValidateDepthRangex(context, angle::EntryPoint::GLDepthRangex, n, f));
302         if (isCallValid)
303         {
304             context->depthRangex(n, f);
305         }
306         ANGLE_CAPTURE(DepthRangex, isCallValid, context, n, f);
307     }
308     else
309     {
310         GenerateContextLostErrorOnCurrentGlobalContext();
311     }
312 }
313 
GL_DisableClientState(GLenum array)314 void GL_APIENTRY GL_DisableClientState(GLenum array)
315 {
316     Context *context = GetValidGlobalContext();
317     EVENT(context, GLDisableClientState, "context = %d, array = %s", CID(context),
318           GLenumToString(GLenumGroup::EnableCap, array));
319 
320     if (context)
321     {
322         ClientVertexArrayType arrayPacked = PackParam<ClientVertexArrayType>(array);
323         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
324         bool isCallValid                                      = (context->skipValidation() ||
325                             ValidateDisableClientState(
326                                 context, angle::EntryPoint::GLDisableClientState, arrayPacked));
327         if (isCallValid)
328         {
329             context->disableClientState(arrayPacked);
330         }
331         ANGLE_CAPTURE(DisableClientState, isCallValid, context, arrayPacked);
332     }
333     else
334     {
335         GenerateContextLostErrorOnCurrentGlobalContext();
336     }
337 }
338 
GL_EnableClientState(GLenum array)339 void GL_APIENTRY GL_EnableClientState(GLenum array)
340 {
341     Context *context = GetValidGlobalContext();
342     EVENT(context, GLEnableClientState, "context = %d, array = %s", CID(context),
343           GLenumToString(GLenumGroup::EnableCap, array));
344 
345     if (context)
346     {
347         ClientVertexArrayType arrayPacked = PackParam<ClientVertexArrayType>(array);
348         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
349         bool isCallValid                                      = (context->skipValidation() ||
350                             ValidateEnableClientState(
351                                 context, angle::EntryPoint::GLEnableClientState, arrayPacked));
352         if (isCallValid)
353         {
354             context->enableClientState(arrayPacked);
355         }
356         ANGLE_CAPTURE(EnableClientState, isCallValid, context, arrayPacked);
357     }
358     else
359     {
360         GenerateContextLostErrorOnCurrentGlobalContext();
361     }
362 }
363 
GL_Fogf(GLenum pname,GLfloat param)364 void GL_APIENTRY GL_Fogf(GLenum pname, GLfloat param)
365 {
366     Context *context = GetValidGlobalContext();
367     EVENT(context, GLFogf, "context = %d, pname = %s, param = %f", CID(context),
368           GLenumToString(GLenumGroup::FogParameter, pname), param);
369 
370     if (context)
371     {
372         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
373         bool isCallValid                                      = (context->skipValidation() ||
374                             ValidateFogf(context, angle::EntryPoint::GLFogf, pname, param));
375         if (isCallValid)
376         {
377             context->fogf(pname, param);
378         }
379         ANGLE_CAPTURE(Fogf, isCallValid, context, pname, param);
380     }
381     else
382     {
383         GenerateContextLostErrorOnCurrentGlobalContext();
384     }
385 }
386 
GL_Fogfv(GLenum pname,const GLfloat * params)387 void GL_APIENTRY GL_Fogfv(GLenum pname, const GLfloat *params)
388 {
389     Context *context = GetValidGlobalContext();
390     EVENT(context, GLFogfv, "context = %d, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
391           GLenumToString(GLenumGroup::FogParameter, pname), (uintptr_t)params);
392 
393     if (context)
394     {
395         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
396         bool isCallValid                                      = (context->skipValidation() ||
397                             ValidateFogfv(context, angle::EntryPoint::GLFogfv, pname, params));
398         if (isCallValid)
399         {
400             context->fogfv(pname, params);
401         }
402         ANGLE_CAPTURE(Fogfv, isCallValid, context, pname, params);
403     }
404     else
405     {
406         GenerateContextLostErrorOnCurrentGlobalContext();
407     }
408 }
409 
GL_Fogx(GLenum pname,GLfixed param)410 void GL_APIENTRY GL_Fogx(GLenum pname, GLfixed param)
411 {
412     Context *context = GetValidGlobalContext();
413     EVENT(context, GLFogx, "context = %d, pname = %s, param = 0x%X", CID(context),
414           GLenumToString(GLenumGroup::FogPName, pname), param);
415 
416     if (context)
417     {
418         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
419         bool isCallValid                                      = (context->skipValidation() ||
420                             ValidateFogx(context, angle::EntryPoint::GLFogx, pname, param));
421         if (isCallValid)
422         {
423             context->fogx(pname, param);
424         }
425         ANGLE_CAPTURE(Fogx, isCallValid, context, pname, param);
426     }
427     else
428     {
429         GenerateContextLostErrorOnCurrentGlobalContext();
430     }
431 }
432 
GL_Fogxv(GLenum pname,const GLfixed * param)433 void GL_APIENTRY GL_Fogxv(GLenum pname, const GLfixed *param)
434 {
435     Context *context = GetValidGlobalContext();
436     EVENT(context, GLFogxv, "context = %d, pname = %s, param = 0x%016" PRIxPTR "", CID(context),
437           GLenumToString(GLenumGroup::FogPName, pname), (uintptr_t)param);
438 
439     if (context)
440     {
441         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
442         bool isCallValid                                      = (context->skipValidation() ||
443                             ValidateFogxv(context, angle::EntryPoint::GLFogxv, pname, param));
444         if (isCallValid)
445         {
446             context->fogxv(pname, param);
447         }
448         ANGLE_CAPTURE(Fogxv, isCallValid, context, pname, param);
449     }
450     else
451     {
452         GenerateContextLostErrorOnCurrentGlobalContext();
453     }
454 }
455 
GL_Frustumf(GLfloat l,GLfloat r,GLfloat b,GLfloat t,GLfloat n,GLfloat f)456 void GL_APIENTRY GL_Frustumf(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f)
457 {
458     Context *context = GetValidGlobalContext();
459     EVENT(context, GLFrustumf, "context = %d, l = %f, r = %f, b = %f, t = %f, n = %f, f = %f",
460           CID(context), l, r, b, t, n, f);
461 
462     if (context)
463     {
464         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
465         bool isCallValid =
466             (context->skipValidation() ||
467              ValidateFrustumf(context, angle::EntryPoint::GLFrustumf, l, r, b, t, n, f));
468         if (isCallValid)
469         {
470             context->frustumf(l, r, b, t, n, f);
471         }
472         ANGLE_CAPTURE(Frustumf, isCallValid, context, l, r, b, t, n, f);
473     }
474     else
475     {
476         GenerateContextLostErrorOnCurrentGlobalContext();
477     }
478 }
479 
GL_Frustumx(GLfixed l,GLfixed r,GLfixed b,GLfixed t,GLfixed n,GLfixed f)480 void GL_APIENTRY GL_Frustumx(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f)
481 {
482     Context *context = GetValidGlobalContext();
483     EVENT(context, GLFrustumx,
484           "context = %d, l = 0x%X, r = 0x%X, b = 0x%X, t = 0x%X, n = 0x%X, f = 0x%X", CID(context),
485           l, r, b, t, n, f);
486 
487     if (context)
488     {
489         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
490         bool isCallValid =
491             (context->skipValidation() ||
492              ValidateFrustumx(context, angle::EntryPoint::GLFrustumx, l, r, b, t, n, f));
493         if (isCallValid)
494         {
495             context->frustumx(l, r, b, t, n, f);
496         }
497         ANGLE_CAPTURE(Frustumx, isCallValid, context, l, r, b, t, n, f);
498     }
499     else
500     {
501         GenerateContextLostErrorOnCurrentGlobalContext();
502     }
503 }
504 
GL_GetClipPlanef(GLenum plane,GLfloat * equation)505 void GL_APIENTRY GL_GetClipPlanef(GLenum plane, GLfloat *equation)
506 {
507     Context *context = GetValidGlobalContext();
508     EVENT(context, GLGetClipPlanef, "context = %d, plane = %s, equation = 0x%016" PRIxPTR "",
509           CID(context), GLenumToString(GLenumGroup::ClipPlaneName, plane), (uintptr_t)equation);
510 
511     if (context)
512     {
513         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
514         bool isCallValid =
515             (context->skipValidation() ||
516              ValidateGetClipPlanef(context, angle::EntryPoint::GLGetClipPlanef, plane, equation));
517         if (isCallValid)
518         {
519             context->getClipPlanef(plane, equation);
520         }
521         ANGLE_CAPTURE(GetClipPlanef, isCallValid, context, plane, equation);
522     }
523     else
524     {
525         GenerateContextLostErrorOnCurrentGlobalContext();
526     }
527 }
528 
GL_GetClipPlanex(GLenum plane,GLfixed * equation)529 void GL_APIENTRY GL_GetClipPlanex(GLenum plane, GLfixed *equation)
530 {
531     Context *context = GetValidGlobalContext();
532     EVENT(context, GLGetClipPlanex, "context = %d, plane = %s, equation = 0x%016" PRIxPTR "",
533           CID(context), GLenumToString(GLenumGroup::ClipPlaneName, plane), (uintptr_t)equation);
534 
535     if (context)
536     {
537         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
538         bool isCallValid =
539             (context->skipValidation() ||
540              ValidateGetClipPlanex(context, angle::EntryPoint::GLGetClipPlanex, plane, equation));
541         if (isCallValid)
542         {
543             context->getClipPlanex(plane, equation);
544         }
545         ANGLE_CAPTURE(GetClipPlanex, isCallValid, context, plane, equation);
546     }
547     else
548     {
549         GenerateContextLostErrorOnCurrentGlobalContext();
550     }
551 }
552 
GL_GetFixedv(GLenum pname,GLfixed * params)553 void GL_APIENTRY GL_GetFixedv(GLenum pname, GLfixed *params)
554 {
555     Context *context = GetValidGlobalContext();
556     EVENT(context, GLGetFixedv, "context = %d, pname = %s, params = 0x%016" PRIxPTR "",
557           CID(context), GLenumToString(GLenumGroup::GetPName, pname), (uintptr_t)params);
558 
559     if (context)
560     {
561         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
562         bool isCallValid =
563             (context->skipValidation() ||
564              ValidateGetFixedv(context, angle::EntryPoint::GLGetFixedv, pname, params));
565         if (isCallValid)
566         {
567             context->getFixedv(pname, params);
568         }
569         ANGLE_CAPTURE(GetFixedv, isCallValid, context, pname, params);
570     }
571     else
572     {
573         GenerateContextLostErrorOnCurrentGlobalContext();
574     }
575 }
576 
GL_GetLightfv(GLenum light,GLenum pname,GLfloat * params)577 void GL_APIENTRY GL_GetLightfv(GLenum light, GLenum pname, GLfloat *params)
578 {
579     Context *context = GetValidGlobalContext();
580     EVENT(context, GLGetLightfv, "context = %d, light = %s, pname = %s, params = 0x%016" PRIxPTR "",
581           CID(context), GLenumToString(GLenumGroup::LightName, light),
582           GLenumToString(GLenumGroup::LightParameter, pname), (uintptr_t)params);
583 
584     if (context)
585     {
586         LightParameter pnamePacked                            = PackParam<LightParameter>(pname);
587         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
588         bool isCallValid                                      = (context->skipValidation() ||
589                             ValidateGetLightfv(context, angle::EntryPoint::GLGetLightfv, light,
590                                                pnamePacked, params));
591         if (isCallValid)
592         {
593             context->getLightfv(light, pnamePacked, params);
594         }
595         ANGLE_CAPTURE(GetLightfv, isCallValid, context, light, pnamePacked, params);
596     }
597     else
598     {
599         GenerateContextLostErrorOnCurrentGlobalContext();
600     }
601 }
602 
GL_GetLightxv(GLenum light,GLenum pname,GLfixed * params)603 void GL_APIENTRY GL_GetLightxv(GLenum light, GLenum pname, GLfixed *params)
604 {
605     Context *context = GetValidGlobalContext();
606     EVENT(context, GLGetLightxv, "context = %d, light = %s, pname = %s, params = 0x%016" PRIxPTR "",
607           CID(context), GLenumToString(GLenumGroup::LightName, light),
608           GLenumToString(GLenumGroup::LightParameter, pname), (uintptr_t)params);
609 
610     if (context)
611     {
612         LightParameter pnamePacked                            = PackParam<LightParameter>(pname);
613         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
614         bool isCallValid                                      = (context->skipValidation() ||
615                             ValidateGetLightxv(context, angle::EntryPoint::GLGetLightxv, light,
616                                                pnamePacked, params));
617         if (isCallValid)
618         {
619             context->getLightxv(light, pnamePacked, params);
620         }
621         ANGLE_CAPTURE(GetLightxv, isCallValid, context, light, pnamePacked, params);
622     }
623     else
624     {
625         GenerateContextLostErrorOnCurrentGlobalContext();
626     }
627 }
628 
GL_GetMaterialfv(GLenum face,GLenum pname,GLfloat * params)629 void GL_APIENTRY GL_GetMaterialfv(GLenum face, GLenum pname, GLfloat *params)
630 {
631     Context *context = GetValidGlobalContext();
632     EVENT(context, GLGetMaterialfv,
633           "context = %d, face = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
634           GLenumToString(GLenumGroup::MaterialFace, face),
635           GLenumToString(GLenumGroup::MaterialParameter, pname), (uintptr_t)params);
636 
637     if (context)
638     {
639         MaterialParameter pnamePacked                         = PackParam<MaterialParameter>(pname);
640         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
641         bool isCallValid                                      = (context->skipValidation() ||
642                             ValidateGetMaterialfv(context, angle::EntryPoint::GLGetMaterialfv, face,
643                                                   pnamePacked, params));
644         if (isCallValid)
645         {
646             context->getMaterialfv(face, pnamePacked, params);
647         }
648         ANGLE_CAPTURE(GetMaterialfv, isCallValid, context, face, pnamePacked, params);
649     }
650     else
651     {
652         GenerateContextLostErrorOnCurrentGlobalContext();
653     }
654 }
655 
GL_GetMaterialxv(GLenum face,GLenum pname,GLfixed * params)656 void GL_APIENTRY GL_GetMaterialxv(GLenum face, GLenum pname, GLfixed *params)
657 {
658     Context *context = GetValidGlobalContext();
659     EVENT(context, GLGetMaterialxv,
660           "context = %d, face = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
661           GLenumToString(GLenumGroup::MaterialFace, face),
662           GLenumToString(GLenumGroup::MaterialParameter, pname), (uintptr_t)params);
663 
664     if (context)
665     {
666         MaterialParameter pnamePacked                         = PackParam<MaterialParameter>(pname);
667         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
668         bool isCallValid                                      = (context->skipValidation() ||
669                             ValidateGetMaterialxv(context, angle::EntryPoint::GLGetMaterialxv, face,
670                                                   pnamePacked, params));
671         if (isCallValid)
672         {
673             context->getMaterialxv(face, pnamePacked, params);
674         }
675         ANGLE_CAPTURE(GetMaterialxv, isCallValid, context, face, pnamePacked, params);
676     }
677     else
678     {
679         GenerateContextLostErrorOnCurrentGlobalContext();
680     }
681 }
682 
GL_GetTexEnvfv(GLenum target,GLenum pname,GLfloat * params)683 void GL_APIENTRY GL_GetTexEnvfv(GLenum target, GLenum pname, GLfloat *params)
684 {
685     Context *context = GetValidGlobalContext();
686     EVENT(context, GLGetTexEnvfv,
687           "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
688           GLenumToString(GLenumGroup::TextureEnvTarget, target),
689           GLenumToString(GLenumGroup::TextureEnvParameter, pname), (uintptr_t)params);
690 
691     if (context)
692     {
693         TextureEnvTarget targetPacked   = PackParam<TextureEnvTarget>(target);
694         TextureEnvParameter pnamePacked = PackParam<TextureEnvParameter>(pname);
695         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
696         bool isCallValid                                      = (context->skipValidation() ||
697                             ValidateGetTexEnvfv(context, angle::EntryPoint::GLGetTexEnvfv,
698                                                 targetPacked, pnamePacked, params));
699         if (isCallValid)
700         {
701             context->getTexEnvfv(targetPacked, pnamePacked, params);
702         }
703         ANGLE_CAPTURE(GetTexEnvfv, isCallValid, context, targetPacked, pnamePacked, params);
704     }
705     else
706     {
707         GenerateContextLostErrorOnCurrentGlobalContext();
708     }
709 }
710 
GL_GetTexEnviv(GLenum target,GLenum pname,GLint * params)711 void GL_APIENTRY GL_GetTexEnviv(GLenum target, GLenum pname, GLint *params)
712 {
713     Context *context = GetValidGlobalContext();
714     EVENT(context, GLGetTexEnviv,
715           "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
716           GLenumToString(GLenumGroup::TextureEnvTarget, target),
717           GLenumToString(GLenumGroup::TextureEnvParameter, pname), (uintptr_t)params);
718 
719     if (context)
720     {
721         TextureEnvTarget targetPacked   = PackParam<TextureEnvTarget>(target);
722         TextureEnvParameter pnamePacked = PackParam<TextureEnvParameter>(pname);
723         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
724         bool isCallValid                                      = (context->skipValidation() ||
725                             ValidateGetTexEnviv(context, angle::EntryPoint::GLGetTexEnviv,
726                                                 targetPacked, pnamePacked, params));
727         if (isCallValid)
728         {
729             context->getTexEnviv(targetPacked, pnamePacked, params);
730         }
731         ANGLE_CAPTURE(GetTexEnviv, isCallValid, context, targetPacked, pnamePacked, params);
732     }
733     else
734     {
735         GenerateContextLostErrorOnCurrentGlobalContext();
736     }
737 }
738 
GL_GetTexEnvxv(GLenum target,GLenum pname,GLfixed * params)739 void GL_APIENTRY GL_GetTexEnvxv(GLenum target, GLenum pname, GLfixed *params)
740 {
741     Context *context = GetValidGlobalContext();
742     EVENT(context, GLGetTexEnvxv,
743           "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
744           GLenumToString(GLenumGroup::TextureEnvTarget, target),
745           GLenumToString(GLenumGroup::TextureEnvParameter, pname), (uintptr_t)params);
746 
747     if (context)
748     {
749         TextureEnvTarget targetPacked   = PackParam<TextureEnvTarget>(target);
750         TextureEnvParameter pnamePacked = PackParam<TextureEnvParameter>(pname);
751         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
752         bool isCallValid                                      = (context->skipValidation() ||
753                             ValidateGetTexEnvxv(context, angle::EntryPoint::GLGetTexEnvxv,
754                                                 targetPacked, pnamePacked, params));
755         if (isCallValid)
756         {
757             context->getTexEnvxv(targetPacked, pnamePacked, params);
758         }
759         ANGLE_CAPTURE(GetTexEnvxv, isCallValid, context, targetPacked, pnamePacked, params);
760     }
761     else
762     {
763         GenerateContextLostErrorOnCurrentGlobalContext();
764     }
765 }
766 
GL_GetTexParameterxv(GLenum target,GLenum pname,GLfixed * params)767 void GL_APIENTRY GL_GetTexParameterxv(GLenum target, GLenum pname, GLfixed *params)
768 {
769     Context *context = GetValidGlobalContext();
770     EVENT(context, GLGetTexParameterxv,
771           "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
772           GLenumToString(GLenumGroup::TextureTarget, target),
773           GLenumToString(GLenumGroup::GetTextureParameter, pname), (uintptr_t)params);
774 
775     if (context)
776     {
777         TextureType targetPacked                              = PackParam<TextureType>(target);
778         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
779         bool isCallValid =
780             (context->skipValidation() ||
781              ValidateGetTexParameterxv(context, angle::EntryPoint::GLGetTexParameterxv,
782                                        targetPacked, pname, params));
783         if (isCallValid)
784         {
785             context->getTexParameterxv(targetPacked, pname, params);
786         }
787         ANGLE_CAPTURE(GetTexParameterxv, isCallValid, context, targetPacked, pname, params);
788     }
789     else
790     {
791         GenerateContextLostErrorOnCurrentGlobalContext();
792     }
793 }
794 
GL_LightModelf(GLenum pname,GLfloat param)795 void GL_APIENTRY GL_LightModelf(GLenum pname, GLfloat param)
796 {
797     Context *context = GetValidGlobalContext();
798     EVENT(context, GLLightModelf, "context = %d, pname = %s, param = %f", CID(context),
799           GLenumToString(GLenumGroup::LightModelParameter, pname), param);
800 
801     if (context)
802     {
803         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
804         bool isCallValid =
805             (context->skipValidation() ||
806              ValidateLightModelf(context, angle::EntryPoint::GLLightModelf, pname, param));
807         if (isCallValid)
808         {
809             context->lightModelf(pname, param);
810         }
811         ANGLE_CAPTURE(LightModelf, isCallValid, context, pname, param);
812     }
813     else
814     {
815         GenerateContextLostErrorOnCurrentGlobalContext();
816     }
817 }
818 
GL_LightModelfv(GLenum pname,const GLfloat * params)819 void GL_APIENTRY GL_LightModelfv(GLenum pname, const GLfloat *params)
820 {
821     Context *context = GetValidGlobalContext();
822     EVENT(context, GLLightModelfv, "context = %d, pname = %s, params = 0x%016" PRIxPTR "",
823           CID(context), GLenumToString(GLenumGroup::LightModelParameter, pname), (uintptr_t)params);
824 
825     if (context)
826     {
827         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
828         bool isCallValid =
829             (context->skipValidation() ||
830              ValidateLightModelfv(context, angle::EntryPoint::GLLightModelfv, pname, params));
831         if (isCallValid)
832         {
833             context->lightModelfv(pname, params);
834         }
835         ANGLE_CAPTURE(LightModelfv, isCallValid, context, pname, params);
836     }
837     else
838     {
839         GenerateContextLostErrorOnCurrentGlobalContext();
840     }
841 }
842 
GL_LightModelx(GLenum pname,GLfixed param)843 void GL_APIENTRY GL_LightModelx(GLenum pname, GLfixed param)
844 {
845     Context *context = GetValidGlobalContext();
846     EVENT(context, GLLightModelx, "context = %d, pname = %s, param = 0x%X", CID(context),
847           GLenumToString(GLenumGroup::LightModelParameter, pname), param);
848 
849     if (context)
850     {
851         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
852         bool isCallValid =
853             (context->skipValidation() ||
854              ValidateLightModelx(context, angle::EntryPoint::GLLightModelx, pname, param));
855         if (isCallValid)
856         {
857             context->lightModelx(pname, param);
858         }
859         ANGLE_CAPTURE(LightModelx, isCallValid, context, pname, param);
860     }
861     else
862     {
863         GenerateContextLostErrorOnCurrentGlobalContext();
864     }
865 }
866 
GL_LightModelxv(GLenum pname,const GLfixed * param)867 void GL_APIENTRY GL_LightModelxv(GLenum pname, const GLfixed *param)
868 {
869     Context *context = GetValidGlobalContext();
870     EVENT(context, GLLightModelxv, "context = %d, pname = %s, param = 0x%016" PRIxPTR "",
871           CID(context), GLenumToString(GLenumGroup::LightModelParameter, pname), (uintptr_t)param);
872 
873     if (context)
874     {
875         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
876         bool isCallValid =
877             (context->skipValidation() ||
878              ValidateLightModelxv(context, angle::EntryPoint::GLLightModelxv, pname, param));
879         if (isCallValid)
880         {
881             context->lightModelxv(pname, param);
882         }
883         ANGLE_CAPTURE(LightModelxv, isCallValid, context, pname, param);
884     }
885     else
886     {
887         GenerateContextLostErrorOnCurrentGlobalContext();
888     }
889 }
890 
GL_Lightf(GLenum light,GLenum pname,GLfloat param)891 void GL_APIENTRY GL_Lightf(GLenum light, GLenum pname, GLfloat param)
892 {
893     Context *context = GetValidGlobalContext();
894     EVENT(context, GLLightf, "context = %d, light = %s, pname = %s, param = %f", CID(context),
895           GLenumToString(GLenumGroup::LightName, light),
896           GLenumToString(GLenumGroup::LightParameter, pname), param);
897 
898     if (context)
899     {
900         LightParameter pnamePacked                            = PackParam<LightParameter>(pname);
901         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
902         bool isCallValid =
903             (context->skipValidation() ||
904              ValidateLightf(context, angle::EntryPoint::GLLightf, light, pnamePacked, param));
905         if (isCallValid)
906         {
907             context->lightf(light, pnamePacked, param);
908         }
909         ANGLE_CAPTURE(Lightf, isCallValid, context, light, pnamePacked, param);
910     }
911     else
912     {
913         GenerateContextLostErrorOnCurrentGlobalContext();
914     }
915 }
916 
GL_Lightfv(GLenum light,GLenum pname,const GLfloat * params)917 void GL_APIENTRY GL_Lightfv(GLenum light, GLenum pname, const GLfloat *params)
918 {
919     Context *context = GetValidGlobalContext();
920     EVENT(context, GLLightfv, "context = %d, light = %s, pname = %s, params = 0x%016" PRIxPTR "",
921           CID(context), GLenumToString(GLenumGroup::LightName, light),
922           GLenumToString(GLenumGroup::LightParameter, pname), (uintptr_t)params);
923 
924     if (context)
925     {
926         LightParameter pnamePacked                            = PackParam<LightParameter>(pname);
927         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
928         bool isCallValid =
929             (context->skipValidation() ||
930              ValidateLightfv(context, angle::EntryPoint::GLLightfv, light, pnamePacked, params));
931         if (isCallValid)
932         {
933             context->lightfv(light, pnamePacked, params);
934         }
935         ANGLE_CAPTURE(Lightfv, isCallValid, context, light, pnamePacked, params);
936     }
937     else
938     {
939         GenerateContextLostErrorOnCurrentGlobalContext();
940     }
941 }
942 
GL_Lightx(GLenum light,GLenum pname,GLfixed param)943 void GL_APIENTRY GL_Lightx(GLenum light, GLenum pname, GLfixed param)
944 {
945     Context *context = GetValidGlobalContext();
946     EVENT(context, GLLightx, "context = %d, light = %s, pname = %s, param = 0x%X", CID(context),
947           GLenumToString(GLenumGroup::LightName, light),
948           GLenumToString(GLenumGroup::LightParameter, pname), param);
949 
950     if (context)
951     {
952         LightParameter pnamePacked                            = PackParam<LightParameter>(pname);
953         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
954         bool isCallValid =
955             (context->skipValidation() ||
956              ValidateLightx(context, angle::EntryPoint::GLLightx, light, pnamePacked, param));
957         if (isCallValid)
958         {
959             context->lightx(light, pnamePacked, param);
960         }
961         ANGLE_CAPTURE(Lightx, isCallValid, context, light, pnamePacked, param);
962     }
963     else
964     {
965         GenerateContextLostErrorOnCurrentGlobalContext();
966     }
967 }
968 
GL_Lightxv(GLenum light,GLenum pname,const GLfixed * params)969 void GL_APIENTRY GL_Lightxv(GLenum light, GLenum pname, const GLfixed *params)
970 {
971     Context *context = GetValidGlobalContext();
972     EVENT(context, GLLightxv, "context = %d, light = %s, pname = %s, params = 0x%016" PRIxPTR "",
973           CID(context), GLenumToString(GLenumGroup::LightName, light),
974           GLenumToString(GLenumGroup::LightParameter, pname), (uintptr_t)params);
975 
976     if (context)
977     {
978         LightParameter pnamePacked                            = PackParam<LightParameter>(pname);
979         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
980         bool isCallValid =
981             (context->skipValidation() ||
982              ValidateLightxv(context, angle::EntryPoint::GLLightxv, light, pnamePacked, params));
983         if (isCallValid)
984         {
985             context->lightxv(light, pnamePacked, params);
986         }
987         ANGLE_CAPTURE(Lightxv, isCallValid, context, light, pnamePacked, params);
988     }
989     else
990     {
991         GenerateContextLostErrorOnCurrentGlobalContext();
992     }
993 }
994 
GL_LineWidthx(GLfixed width)995 void GL_APIENTRY GL_LineWidthx(GLfixed width)
996 {
997     Context *context = GetValidGlobalContext();
998     EVENT(context, GLLineWidthx, "context = %d, width = 0x%X", CID(context), width);
999 
1000     if (context)
1001     {
1002         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1003         bool isCallValid                                      = (context->skipValidation() ||
1004                             ValidateLineWidthx(context, angle::EntryPoint::GLLineWidthx, width));
1005         if (isCallValid)
1006         {
1007             context->lineWidthx(width);
1008         }
1009         ANGLE_CAPTURE(LineWidthx, isCallValid, context, width);
1010     }
1011     else
1012     {
1013         GenerateContextLostErrorOnCurrentGlobalContext();
1014     }
1015 }
1016 
GL_LoadIdentity()1017 void GL_APIENTRY GL_LoadIdentity()
1018 {
1019     Context *context = GetValidGlobalContext();
1020     EVENT(context, GLLoadIdentity, "context = %d", CID(context));
1021 
1022     if (context)
1023     {
1024         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1025         bool isCallValid                                      = (context->skipValidation() ||
1026                             ValidateLoadIdentity(context, angle::EntryPoint::GLLoadIdentity));
1027         if (isCallValid)
1028         {
1029             context->loadIdentity();
1030         }
1031         ANGLE_CAPTURE(LoadIdentity, isCallValid, context);
1032     }
1033     else
1034     {
1035         GenerateContextLostErrorOnCurrentGlobalContext();
1036     }
1037 }
1038 
GL_LoadMatrixf(const GLfloat * m)1039 void GL_APIENTRY GL_LoadMatrixf(const GLfloat *m)
1040 {
1041     Context *context = GetValidGlobalContext();
1042     EVENT(context, GLLoadMatrixf, "context = %d, m = 0x%016" PRIxPTR "", CID(context),
1043           (uintptr_t)m);
1044 
1045     if (context)
1046     {
1047         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1048         bool isCallValid                                      = (context->skipValidation() ||
1049                             ValidateLoadMatrixf(context, angle::EntryPoint::GLLoadMatrixf, m));
1050         if (isCallValid)
1051         {
1052             context->loadMatrixf(m);
1053         }
1054         ANGLE_CAPTURE(LoadMatrixf, isCallValid, context, m);
1055     }
1056     else
1057     {
1058         GenerateContextLostErrorOnCurrentGlobalContext();
1059     }
1060 }
1061 
GL_LoadMatrixx(const GLfixed * m)1062 void GL_APIENTRY GL_LoadMatrixx(const GLfixed *m)
1063 {
1064     Context *context = GetValidGlobalContext();
1065     EVENT(context, GLLoadMatrixx, "context = %d, m = 0x%016" PRIxPTR "", CID(context),
1066           (uintptr_t)m);
1067 
1068     if (context)
1069     {
1070         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1071         bool isCallValid                                      = (context->skipValidation() ||
1072                             ValidateLoadMatrixx(context, angle::EntryPoint::GLLoadMatrixx, m));
1073         if (isCallValid)
1074         {
1075             context->loadMatrixx(m);
1076         }
1077         ANGLE_CAPTURE(LoadMatrixx, isCallValid, context, m);
1078     }
1079     else
1080     {
1081         GenerateContextLostErrorOnCurrentGlobalContext();
1082     }
1083 }
1084 
GL_LogicOp(GLenum opcode)1085 void GL_APIENTRY GL_LogicOp(GLenum opcode)
1086 {
1087     Context *context = GetValidGlobalContext();
1088     EVENT(context, GLLogicOp, "context = %d, opcode = %s", CID(context),
1089           GLenumToString(GLenumGroup::LogicOp, opcode));
1090 
1091     if (context)
1092     {
1093         LogicalOperation opcodePacked                         = PackParam<LogicalOperation>(opcode);
1094         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1095         bool isCallValid                                      = (context->skipValidation() ||
1096                             ValidateLogicOp(context, angle::EntryPoint::GLLogicOp, opcodePacked));
1097         if (isCallValid)
1098         {
1099             context->logicOp(opcodePacked);
1100         }
1101         ANGLE_CAPTURE(LogicOp, isCallValid, context, opcodePacked);
1102     }
1103     else
1104     {
1105         GenerateContextLostErrorOnCurrentGlobalContext();
1106     }
1107 }
1108 
GL_Materialf(GLenum face,GLenum pname,GLfloat param)1109 void GL_APIENTRY GL_Materialf(GLenum face, GLenum pname, GLfloat param)
1110 {
1111     Context *context = GetValidGlobalContext();
1112     EVENT(context, GLMaterialf, "context = %d, face = %s, pname = %s, param = %f", CID(context),
1113           GLenumToString(GLenumGroup::MaterialFace, face),
1114           GLenumToString(GLenumGroup::MaterialParameter, pname), param);
1115 
1116     if (context)
1117     {
1118         MaterialParameter pnamePacked                         = PackParam<MaterialParameter>(pname);
1119         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1120         bool isCallValid =
1121             (context->skipValidation() ||
1122              ValidateMaterialf(context, angle::EntryPoint::GLMaterialf, face, pnamePacked, param));
1123         if (isCallValid)
1124         {
1125             context->materialf(face, pnamePacked, param);
1126         }
1127         ANGLE_CAPTURE(Materialf, isCallValid, context, face, pnamePacked, param);
1128     }
1129     else
1130     {
1131         GenerateContextLostErrorOnCurrentGlobalContext();
1132     }
1133 }
1134 
GL_Materialfv(GLenum face,GLenum pname,const GLfloat * params)1135 void GL_APIENTRY GL_Materialfv(GLenum face, GLenum pname, const GLfloat *params)
1136 {
1137     Context *context = GetValidGlobalContext();
1138     EVENT(context, GLMaterialfv, "context = %d, face = %s, pname = %s, params = 0x%016" PRIxPTR "",
1139           CID(context), GLenumToString(GLenumGroup::MaterialFace, face),
1140           GLenumToString(GLenumGroup::MaterialParameter, pname), (uintptr_t)params);
1141 
1142     if (context)
1143     {
1144         MaterialParameter pnamePacked                         = PackParam<MaterialParameter>(pname);
1145         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1146         bool isCallValid                                      = (context->skipValidation() ||
1147                             ValidateMaterialfv(context, angle::EntryPoint::GLMaterialfv, face,
1148                                                pnamePacked, params));
1149         if (isCallValid)
1150         {
1151             context->materialfv(face, pnamePacked, params);
1152         }
1153         ANGLE_CAPTURE(Materialfv, isCallValid, context, face, pnamePacked, params);
1154     }
1155     else
1156     {
1157         GenerateContextLostErrorOnCurrentGlobalContext();
1158     }
1159 }
1160 
GL_Materialx(GLenum face,GLenum pname,GLfixed param)1161 void GL_APIENTRY GL_Materialx(GLenum face, GLenum pname, GLfixed param)
1162 {
1163     Context *context = GetValidGlobalContext();
1164     EVENT(context, GLMaterialx, "context = %d, face = %s, pname = %s, param = 0x%X", CID(context),
1165           GLenumToString(GLenumGroup::MaterialFace, face),
1166           GLenumToString(GLenumGroup::MaterialParameter, pname), param);
1167 
1168     if (context)
1169     {
1170         MaterialParameter pnamePacked                         = PackParam<MaterialParameter>(pname);
1171         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1172         bool isCallValid =
1173             (context->skipValidation() ||
1174              ValidateMaterialx(context, angle::EntryPoint::GLMaterialx, face, pnamePacked, param));
1175         if (isCallValid)
1176         {
1177             context->materialx(face, pnamePacked, param);
1178         }
1179         ANGLE_CAPTURE(Materialx, isCallValid, context, face, pnamePacked, param);
1180     }
1181     else
1182     {
1183         GenerateContextLostErrorOnCurrentGlobalContext();
1184     }
1185 }
1186 
GL_Materialxv(GLenum face,GLenum pname,const GLfixed * param)1187 void GL_APIENTRY GL_Materialxv(GLenum face, GLenum pname, const GLfixed *param)
1188 {
1189     Context *context = GetValidGlobalContext();
1190     EVENT(context, GLMaterialxv, "context = %d, face = %s, pname = %s, param = 0x%016" PRIxPTR "",
1191           CID(context), GLenumToString(GLenumGroup::MaterialFace, face),
1192           GLenumToString(GLenumGroup::MaterialParameter, pname), (uintptr_t)param);
1193 
1194     if (context)
1195     {
1196         MaterialParameter pnamePacked                         = PackParam<MaterialParameter>(pname);
1197         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1198         bool isCallValid                                      = (context->skipValidation() ||
1199                             ValidateMaterialxv(context, angle::EntryPoint::GLMaterialxv, face,
1200                                                pnamePacked, param));
1201         if (isCallValid)
1202         {
1203             context->materialxv(face, pnamePacked, param);
1204         }
1205         ANGLE_CAPTURE(Materialxv, isCallValid, context, face, pnamePacked, param);
1206     }
1207     else
1208     {
1209         GenerateContextLostErrorOnCurrentGlobalContext();
1210     }
1211 }
1212 
GL_MatrixMode(GLenum mode)1213 void GL_APIENTRY GL_MatrixMode(GLenum mode)
1214 {
1215     Context *context = GetValidGlobalContext();
1216     EVENT(context, GLMatrixMode, "context = %d, mode = %s", CID(context),
1217           GLenumToString(GLenumGroup::MatrixMode, mode));
1218 
1219     if (context)
1220     {
1221         MatrixType modePacked                                 = PackParam<MatrixType>(mode);
1222         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1223         bool isCallValid =
1224             (context->skipValidation() ||
1225              ValidateMatrixMode(context, angle::EntryPoint::GLMatrixMode, modePacked));
1226         if (isCallValid)
1227         {
1228             context->matrixMode(modePacked);
1229         }
1230         ANGLE_CAPTURE(MatrixMode, isCallValid, context, modePacked);
1231     }
1232     else
1233     {
1234         GenerateContextLostErrorOnCurrentGlobalContext();
1235     }
1236 }
1237 
GL_MultMatrixf(const GLfloat * m)1238 void GL_APIENTRY GL_MultMatrixf(const GLfloat *m)
1239 {
1240     Context *context = GetValidGlobalContext();
1241     EVENT(context, GLMultMatrixf, "context = %d, m = 0x%016" PRIxPTR "", CID(context),
1242           (uintptr_t)m);
1243 
1244     if (context)
1245     {
1246         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1247         bool isCallValid                                      = (context->skipValidation() ||
1248                             ValidateMultMatrixf(context, angle::EntryPoint::GLMultMatrixf, m));
1249         if (isCallValid)
1250         {
1251             context->multMatrixf(m);
1252         }
1253         ANGLE_CAPTURE(MultMatrixf, isCallValid, context, m);
1254     }
1255     else
1256     {
1257         GenerateContextLostErrorOnCurrentGlobalContext();
1258     }
1259 }
1260 
GL_MultMatrixx(const GLfixed * m)1261 void GL_APIENTRY GL_MultMatrixx(const GLfixed *m)
1262 {
1263     Context *context = GetValidGlobalContext();
1264     EVENT(context, GLMultMatrixx, "context = %d, m = 0x%016" PRIxPTR "", CID(context),
1265           (uintptr_t)m);
1266 
1267     if (context)
1268     {
1269         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1270         bool isCallValid                                      = (context->skipValidation() ||
1271                             ValidateMultMatrixx(context, angle::EntryPoint::GLMultMatrixx, m));
1272         if (isCallValid)
1273         {
1274             context->multMatrixx(m);
1275         }
1276         ANGLE_CAPTURE(MultMatrixx, isCallValid, context, m);
1277     }
1278     else
1279     {
1280         GenerateContextLostErrorOnCurrentGlobalContext();
1281     }
1282 }
1283 
GL_MultiTexCoord4f(GLenum target,GLfloat s,GLfloat t,GLfloat r,GLfloat q)1284 void GL_APIENTRY GL_MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
1285 {
1286     Context *context = GetValidGlobalContext();
1287     EVENT(context, GLMultiTexCoord4f, "context = %d, target = %s, s = %f, t = %f, r = %f, q = %f",
1288           CID(context), GLenumToString(GLenumGroup::TextureUnit, target), s, t, r, q);
1289 
1290     if (context)
1291     {
1292         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1293         bool isCallValid                                      = (context->skipValidation() ||
1294                             ValidateMultiTexCoord4f(context, angle::EntryPoint::GLMultiTexCoord4f,
1295                                                     target, s, t, r, q));
1296         if (isCallValid)
1297         {
1298             context->multiTexCoord4f(target, s, t, r, q);
1299         }
1300         ANGLE_CAPTURE(MultiTexCoord4f, isCallValid, context, target, s, t, r, q);
1301     }
1302     else
1303     {
1304         GenerateContextLostErrorOnCurrentGlobalContext();
1305     }
1306 }
1307 
GL_MultiTexCoord4x(GLenum texture,GLfixed s,GLfixed t,GLfixed r,GLfixed q)1308 void GL_APIENTRY GL_MultiTexCoord4x(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
1309 {
1310     Context *context = GetValidGlobalContext();
1311     EVENT(context, GLMultiTexCoord4x,
1312           "context = %d, texture = %s, s = 0x%X, t = 0x%X, r = 0x%X, q = 0x%X", CID(context),
1313           GLenumToString(GLenumGroup::TextureUnit, texture), s, t, r, q);
1314 
1315     if (context)
1316     {
1317         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1318         bool isCallValid                                      = (context->skipValidation() ||
1319                             ValidateMultiTexCoord4x(context, angle::EntryPoint::GLMultiTexCoord4x,
1320                                                     texture, s, t, r, q));
1321         if (isCallValid)
1322         {
1323             context->multiTexCoord4x(texture, s, t, r, q);
1324         }
1325         ANGLE_CAPTURE(MultiTexCoord4x, isCallValid, context, texture, s, t, r, q);
1326     }
1327     else
1328     {
1329         GenerateContextLostErrorOnCurrentGlobalContext();
1330     }
1331 }
1332 
GL_Normal3f(GLfloat nx,GLfloat ny,GLfloat nz)1333 void GL_APIENTRY GL_Normal3f(GLfloat nx, GLfloat ny, GLfloat nz)
1334 {
1335     Context *context = GetValidGlobalContext();
1336     EVENT(context, GLNormal3f, "context = %d, nx = %f, ny = %f, nz = %f", CID(context), nx, ny, nz);
1337 
1338     if (context)
1339     {
1340         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1341         bool isCallValid                                      = (context->skipValidation() ||
1342                             ValidateNormal3f(context, angle::EntryPoint::GLNormal3f, nx, ny, nz));
1343         if (isCallValid)
1344         {
1345             context->normal3f(nx, ny, nz);
1346         }
1347         ANGLE_CAPTURE(Normal3f, isCallValid, context, nx, ny, nz);
1348     }
1349     else
1350     {
1351         GenerateContextLostErrorOnCurrentGlobalContext();
1352     }
1353 }
1354 
GL_Normal3x(GLfixed nx,GLfixed ny,GLfixed nz)1355 void GL_APIENTRY GL_Normal3x(GLfixed nx, GLfixed ny, GLfixed nz)
1356 {
1357     Context *context = GetValidGlobalContext();
1358     EVENT(context, GLNormal3x, "context = %d, nx = 0x%X, ny = 0x%X, nz = 0x%X", CID(context), nx,
1359           ny, nz);
1360 
1361     if (context)
1362     {
1363         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1364         bool isCallValid                                      = (context->skipValidation() ||
1365                             ValidateNormal3x(context, angle::EntryPoint::GLNormal3x, nx, ny, nz));
1366         if (isCallValid)
1367         {
1368             context->normal3x(nx, ny, nz);
1369         }
1370         ANGLE_CAPTURE(Normal3x, isCallValid, context, nx, ny, nz);
1371     }
1372     else
1373     {
1374         GenerateContextLostErrorOnCurrentGlobalContext();
1375     }
1376 }
1377 
GL_NormalPointer(GLenum type,GLsizei stride,const void * pointer)1378 void GL_APIENTRY GL_NormalPointer(GLenum type, GLsizei stride, const void *pointer)
1379 {
1380     Context *context = GetValidGlobalContext();
1381     EVENT(context, GLNormalPointer,
1382           "context = %d, type = %s, stride = %d, pointer = 0x%016" PRIxPTR "", CID(context),
1383           GLenumToString(GLenumGroup::NormalPointerType, type), stride, (uintptr_t)pointer);
1384 
1385     if (context)
1386     {
1387         VertexAttribType typePacked                           = PackParam<VertexAttribType>(type);
1388         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1389         bool isCallValid                                      = (context->skipValidation() ||
1390                             ValidateNormalPointer(context, angle::EntryPoint::GLNormalPointer,
1391                                                   typePacked, stride, pointer));
1392         if (isCallValid)
1393         {
1394             context->normalPointer(typePacked, stride, pointer);
1395         }
1396         ANGLE_CAPTURE(NormalPointer, isCallValid, context, typePacked, stride, pointer);
1397     }
1398     else
1399     {
1400         GenerateContextLostErrorOnCurrentGlobalContext();
1401     }
1402 }
1403 
GL_Orthof(GLfloat l,GLfloat r,GLfloat b,GLfloat t,GLfloat n,GLfloat f)1404 void GL_APIENTRY GL_Orthof(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f)
1405 {
1406     Context *context = GetValidGlobalContext();
1407     EVENT(context, GLOrthof, "context = %d, l = %f, r = %f, b = %f, t = %f, n = %f, f = %f",
1408           CID(context), l, r, b, t, n, f);
1409 
1410     if (context)
1411     {
1412         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1413         bool isCallValid                                      = (context->skipValidation() ||
1414                             ValidateOrthof(context, angle::EntryPoint::GLOrthof, l, r, b, t, n, f));
1415         if (isCallValid)
1416         {
1417             context->orthof(l, r, b, t, n, f);
1418         }
1419         ANGLE_CAPTURE(Orthof, isCallValid, context, l, r, b, t, n, f);
1420     }
1421     else
1422     {
1423         GenerateContextLostErrorOnCurrentGlobalContext();
1424     }
1425 }
1426 
GL_Orthox(GLfixed l,GLfixed r,GLfixed b,GLfixed t,GLfixed n,GLfixed f)1427 void GL_APIENTRY GL_Orthox(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f)
1428 {
1429     Context *context = GetValidGlobalContext();
1430     EVENT(context, GLOrthox,
1431           "context = %d, l = 0x%X, r = 0x%X, b = 0x%X, t = 0x%X, n = 0x%X, f = 0x%X", CID(context),
1432           l, r, b, t, n, f);
1433 
1434     if (context)
1435     {
1436         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1437         bool isCallValid                                      = (context->skipValidation() ||
1438                             ValidateOrthox(context, angle::EntryPoint::GLOrthox, l, r, b, t, n, f));
1439         if (isCallValid)
1440         {
1441             context->orthox(l, r, b, t, n, f);
1442         }
1443         ANGLE_CAPTURE(Orthox, isCallValid, context, l, r, b, t, n, f);
1444     }
1445     else
1446     {
1447         GenerateContextLostErrorOnCurrentGlobalContext();
1448     }
1449 }
1450 
GL_PointParameterf(GLenum pname,GLfloat param)1451 void GL_APIENTRY GL_PointParameterf(GLenum pname, GLfloat param)
1452 {
1453     Context *context = GetValidGlobalContext();
1454     EVENT(context, GLPointParameterf, "context = %d, pname = %s, param = %f", CID(context),
1455           GLenumToString(GLenumGroup::DefaultGroup, pname), param);
1456 
1457     if (context)
1458     {
1459         PointParameter pnamePacked                            = PackParam<PointParameter>(pname);
1460         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1461         bool isCallValid                                      = (context->skipValidation() ||
1462                             ValidatePointParameterf(context, angle::EntryPoint::GLPointParameterf,
1463                                                     pnamePacked, param));
1464         if (isCallValid)
1465         {
1466             context->pointParameterf(pnamePacked, param);
1467         }
1468         ANGLE_CAPTURE(PointParameterf, isCallValid, context, pnamePacked, param);
1469     }
1470     else
1471     {
1472         GenerateContextLostErrorOnCurrentGlobalContext();
1473     }
1474 }
1475 
GL_PointParameterfv(GLenum pname,const GLfloat * params)1476 void GL_APIENTRY GL_PointParameterfv(GLenum pname, const GLfloat *params)
1477 {
1478     Context *context = GetValidGlobalContext();
1479     EVENT(context, GLPointParameterfv, "context = %d, pname = %s, params = 0x%016" PRIxPTR "",
1480           CID(context), GLenumToString(GLenumGroup::DefaultGroup, pname), (uintptr_t)params);
1481 
1482     if (context)
1483     {
1484         PointParameter pnamePacked                            = PackParam<PointParameter>(pname);
1485         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1486         bool isCallValid                                      = (context->skipValidation() ||
1487                             ValidatePointParameterfv(context, angle::EntryPoint::GLPointParameterfv,
1488                                                      pnamePacked, params));
1489         if (isCallValid)
1490         {
1491             context->pointParameterfv(pnamePacked, params);
1492         }
1493         ANGLE_CAPTURE(PointParameterfv, isCallValid, context, pnamePacked, params);
1494     }
1495     else
1496     {
1497         GenerateContextLostErrorOnCurrentGlobalContext();
1498     }
1499 }
1500 
GL_PointParameterx(GLenum pname,GLfixed param)1501 void GL_APIENTRY GL_PointParameterx(GLenum pname, GLfixed param)
1502 {
1503     Context *context = GetValidGlobalContext();
1504     EVENT(context, GLPointParameterx, "context = %d, pname = %s, param = 0x%X", CID(context),
1505           GLenumToString(GLenumGroup::DefaultGroup, pname), param);
1506 
1507     if (context)
1508     {
1509         PointParameter pnamePacked                            = PackParam<PointParameter>(pname);
1510         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1511         bool isCallValid                                      = (context->skipValidation() ||
1512                             ValidatePointParameterx(context, angle::EntryPoint::GLPointParameterx,
1513                                                     pnamePacked, param));
1514         if (isCallValid)
1515         {
1516             context->pointParameterx(pnamePacked, param);
1517         }
1518         ANGLE_CAPTURE(PointParameterx, isCallValid, context, pnamePacked, param);
1519     }
1520     else
1521     {
1522         GenerateContextLostErrorOnCurrentGlobalContext();
1523     }
1524 }
1525 
GL_PointParameterxv(GLenum pname,const GLfixed * params)1526 void GL_APIENTRY GL_PointParameterxv(GLenum pname, const GLfixed *params)
1527 {
1528     Context *context = GetValidGlobalContext();
1529     EVENT(context, GLPointParameterxv, "context = %d, pname = %s, params = 0x%016" PRIxPTR "",
1530           CID(context), GLenumToString(GLenumGroup::DefaultGroup, pname), (uintptr_t)params);
1531 
1532     if (context)
1533     {
1534         PointParameter pnamePacked                            = PackParam<PointParameter>(pname);
1535         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1536         bool isCallValid                                      = (context->skipValidation() ||
1537                             ValidatePointParameterxv(context, angle::EntryPoint::GLPointParameterxv,
1538                                                      pnamePacked, params));
1539         if (isCallValid)
1540         {
1541             context->pointParameterxv(pnamePacked, params);
1542         }
1543         ANGLE_CAPTURE(PointParameterxv, isCallValid, context, pnamePacked, params);
1544     }
1545     else
1546     {
1547         GenerateContextLostErrorOnCurrentGlobalContext();
1548     }
1549 }
1550 
GL_PointSize(GLfloat size)1551 void GL_APIENTRY GL_PointSize(GLfloat size)
1552 {
1553     Context *context = GetValidGlobalContext();
1554     EVENT(context, GLPointSize, "context = %d, size = %f", CID(context), size);
1555 
1556     if (context)
1557     {
1558         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1559         bool isCallValid                                      = (context->skipValidation() ||
1560                             ValidatePointSize(context, angle::EntryPoint::GLPointSize, size));
1561         if (isCallValid)
1562         {
1563             context->pointSize(size);
1564         }
1565         ANGLE_CAPTURE(PointSize, isCallValid, context, size);
1566     }
1567     else
1568     {
1569         GenerateContextLostErrorOnCurrentGlobalContext();
1570     }
1571 }
1572 
GL_PointSizex(GLfixed size)1573 void GL_APIENTRY GL_PointSizex(GLfixed size)
1574 {
1575     Context *context = GetValidGlobalContext();
1576     EVENT(context, GLPointSizex, "context = %d, size = 0x%X", CID(context), size);
1577 
1578     if (context)
1579     {
1580         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1581         bool isCallValid                                      = (context->skipValidation() ||
1582                             ValidatePointSizex(context, angle::EntryPoint::GLPointSizex, size));
1583         if (isCallValid)
1584         {
1585             context->pointSizex(size);
1586         }
1587         ANGLE_CAPTURE(PointSizex, isCallValid, context, size);
1588     }
1589     else
1590     {
1591         GenerateContextLostErrorOnCurrentGlobalContext();
1592     }
1593 }
1594 
GL_PolygonOffsetx(GLfixed factor,GLfixed units)1595 void GL_APIENTRY GL_PolygonOffsetx(GLfixed factor, GLfixed units)
1596 {
1597     Context *context = GetValidGlobalContext();
1598     EVENT(context, GLPolygonOffsetx, "context = %d, factor = 0x%X, units = 0x%X", CID(context),
1599           factor, units);
1600 
1601     if (context)
1602     {
1603         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1604         bool isCallValid =
1605             (context->skipValidation() ||
1606              ValidatePolygonOffsetx(context, angle::EntryPoint::GLPolygonOffsetx, factor, units));
1607         if (isCallValid)
1608         {
1609             context->polygonOffsetx(factor, units);
1610         }
1611         ANGLE_CAPTURE(PolygonOffsetx, isCallValid, context, factor, units);
1612     }
1613     else
1614     {
1615         GenerateContextLostErrorOnCurrentGlobalContext();
1616     }
1617 }
1618 
GL_PopMatrix()1619 void GL_APIENTRY GL_PopMatrix()
1620 {
1621     Context *context = GetValidGlobalContext();
1622     EVENT(context, GLPopMatrix, "context = %d", CID(context));
1623 
1624     if (context)
1625     {
1626         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1627         bool isCallValid                                      = (context->skipValidation() ||
1628                             ValidatePopMatrix(context, angle::EntryPoint::GLPopMatrix));
1629         if (isCallValid)
1630         {
1631             context->popMatrix();
1632         }
1633         ANGLE_CAPTURE(PopMatrix, isCallValid, context);
1634     }
1635     else
1636     {
1637         GenerateContextLostErrorOnCurrentGlobalContext();
1638     }
1639 }
1640 
GL_PushMatrix()1641 void GL_APIENTRY GL_PushMatrix()
1642 {
1643     Context *context = GetValidGlobalContext();
1644     EVENT(context, GLPushMatrix, "context = %d", CID(context));
1645 
1646     if (context)
1647     {
1648         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1649         bool isCallValid                                      = (context->skipValidation() ||
1650                             ValidatePushMatrix(context, angle::EntryPoint::GLPushMatrix));
1651         if (isCallValid)
1652         {
1653             context->pushMatrix();
1654         }
1655         ANGLE_CAPTURE(PushMatrix, isCallValid, context);
1656     }
1657     else
1658     {
1659         GenerateContextLostErrorOnCurrentGlobalContext();
1660     }
1661 }
1662 
GL_Rotatef(GLfloat angle,GLfloat x,GLfloat y,GLfloat z)1663 void GL_APIENTRY GL_Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
1664 {
1665     Context *context = GetValidGlobalContext();
1666     EVENT(context, GLRotatef, "context = %d, angle = %f, x = %f, y = %f, z = %f", CID(context),
1667           angle, x, y, z);
1668 
1669     if (context)
1670     {
1671         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1672         bool isCallValid                                      = (context->skipValidation() ||
1673                             ValidateRotatef(context, angle::EntryPoint::GLRotatef, angle, x, y, z));
1674         if (isCallValid)
1675         {
1676             context->rotatef(angle, x, y, z);
1677         }
1678         ANGLE_CAPTURE(Rotatef, isCallValid, context, angle, x, y, z);
1679     }
1680     else
1681     {
1682         GenerateContextLostErrorOnCurrentGlobalContext();
1683     }
1684 }
1685 
GL_Rotatex(GLfixed angle,GLfixed x,GLfixed y,GLfixed z)1686 void GL_APIENTRY GL_Rotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
1687 {
1688     Context *context = GetValidGlobalContext();
1689     EVENT(context, GLRotatex, "context = %d, angle = 0x%X, x = 0x%X, y = 0x%X, z = 0x%X",
1690           CID(context), angle, x, y, z);
1691 
1692     if (context)
1693     {
1694         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1695         bool isCallValid                                      = (context->skipValidation() ||
1696                             ValidateRotatex(context, angle::EntryPoint::GLRotatex, angle, x, y, z));
1697         if (isCallValid)
1698         {
1699             context->rotatex(angle, x, y, z);
1700         }
1701         ANGLE_CAPTURE(Rotatex, isCallValid, context, angle, x, y, z);
1702     }
1703     else
1704     {
1705         GenerateContextLostErrorOnCurrentGlobalContext();
1706     }
1707 }
1708 
GL_SampleCoveragex(GLclampx value,GLboolean invert)1709 void GL_APIENTRY GL_SampleCoveragex(GLclampx value, GLboolean invert)
1710 {
1711     Context *context = GetValidGlobalContext();
1712     EVENT(context, GLSampleCoveragex, "context = %d, value = 0x%X, invert = %s", CID(context),
1713           value, GLbooleanToString(invert));
1714 
1715     if (context)
1716     {
1717         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1718         bool isCallValid =
1719             (context->skipValidation() ||
1720              ValidateSampleCoveragex(context, angle::EntryPoint::GLSampleCoveragex, value, invert));
1721         if (isCallValid)
1722         {
1723             context->sampleCoveragex(value, invert);
1724         }
1725         ANGLE_CAPTURE(SampleCoveragex, isCallValid, context, value, invert);
1726     }
1727     else
1728     {
1729         GenerateContextLostErrorOnCurrentGlobalContext();
1730     }
1731 }
1732 
GL_Scalef(GLfloat x,GLfloat y,GLfloat z)1733 void GL_APIENTRY GL_Scalef(GLfloat x, GLfloat y, GLfloat z)
1734 {
1735     Context *context = GetValidGlobalContext();
1736     EVENT(context, GLScalef, "context = %d, x = %f, y = %f, z = %f", CID(context), x, y, z);
1737 
1738     if (context)
1739     {
1740         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1741         bool isCallValid                                      = (context->skipValidation() ||
1742                             ValidateScalef(context, angle::EntryPoint::GLScalef, x, y, z));
1743         if (isCallValid)
1744         {
1745             context->scalef(x, y, z);
1746         }
1747         ANGLE_CAPTURE(Scalef, isCallValid, context, x, y, z);
1748     }
1749     else
1750     {
1751         GenerateContextLostErrorOnCurrentGlobalContext();
1752     }
1753 }
1754 
GL_Scalex(GLfixed x,GLfixed y,GLfixed z)1755 void GL_APIENTRY GL_Scalex(GLfixed x, GLfixed y, GLfixed z)
1756 {
1757     Context *context = GetValidGlobalContext();
1758     EVENT(context, GLScalex, "context = %d, x = 0x%X, y = 0x%X, z = 0x%X", CID(context), x, y, z);
1759 
1760     if (context)
1761     {
1762         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1763         bool isCallValid                                      = (context->skipValidation() ||
1764                             ValidateScalex(context, angle::EntryPoint::GLScalex, x, y, z));
1765         if (isCallValid)
1766         {
1767             context->scalex(x, y, z);
1768         }
1769         ANGLE_CAPTURE(Scalex, isCallValid, context, x, y, z);
1770     }
1771     else
1772     {
1773         GenerateContextLostErrorOnCurrentGlobalContext();
1774     }
1775 }
1776 
GL_ShadeModel(GLenum mode)1777 void GL_APIENTRY GL_ShadeModel(GLenum mode)
1778 {
1779     Context *context = GetValidGlobalContext();
1780     EVENT(context, GLShadeModel, "context = %d, mode = %s", CID(context),
1781           GLenumToString(GLenumGroup::ShadingModel, mode));
1782 
1783     if (context)
1784     {
1785         ShadingModel modePacked                               = PackParam<ShadingModel>(mode);
1786         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1787         bool isCallValid =
1788             (context->skipValidation() ||
1789              ValidateShadeModel(context, angle::EntryPoint::GLShadeModel, modePacked));
1790         if (isCallValid)
1791         {
1792             context->shadeModel(modePacked);
1793         }
1794         ANGLE_CAPTURE(ShadeModel, isCallValid, context, modePacked);
1795     }
1796     else
1797     {
1798         GenerateContextLostErrorOnCurrentGlobalContext();
1799     }
1800 }
1801 
GL_TexCoordPointer(GLint size,GLenum type,GLsizei stride,const void * pointer)1802 void GL_APIENTRY GL_TexCoordPointer(GLint size, GLenum type, GLsizei stride, const void *pointer)
1803 {
1804     Context *context = GetValidGlobalContext();
1805     EVENT(context, GLTexCoordPointer,
1806           "context = %d, size = %d, type = %s, stride = %d, pointer = 0x%016" PRIxPTR "",
1807           CID(context), size, GLenumToString(GLenumGroup::TexCoordPointerType, type), stride,
1808           (uintptr_t)pointer);
1809 
1810     if (context)
1811     {
1812         VertexAttribType typePacked                           = PackParam<VertexAttribType>(type);
1813         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1814         bool isCallValid                                      = (context->skipValidation() ||
1815                             ValidateTexCoordPointer(context, angle::EntryPoint::GLTexCoordPointer,
1816                                                     size, typePacked, stride, pointer));
1817         if (isCallValid)
1818         {
1819             context->texCoordPointer(size, typePacked, stride, pointer);
1820         }
1821         ANGLE_CAPTURE(TexCoordPointer, isCallValid, context, size, typePacked, stride, pointer);
1822     }
1823     else
1824     {
1825         GenerateContextLostErrorOnCurrentGlobalContext();
1826     }
1827 }
1828 
GL_TexEnvf(GLenum target,GLenum pname,GLfloat param)1829 void GL_APIENTRY GL_TexEnvf(GLenum target, GLenum pname, GLfloat param)
1830 {
1831     Context *context = GetValidGlobalContext();
1832     EVENT(context, GLTexEnvf, "context = %d, target = %s, pname = %s, param = %f", CID(context),
1833           GLenumToString(GLenumGroup::TextureEnvTarget, target),
1834           GLenumToString(GLenumGroup::TextureEnvParameter, pname), param);
1835 
1836     if (context)
1837     {
1838         TextureEnvTarget targetPacked   = PackParam<TextureEnvTarget>(target);
1839         TextureEnvParameter pnamePacked = PackParam<TextureEnvParameter>(pname);
1840         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1841         bool isCallValid =
1842             (context->skipValidation() || ValidateTexEnvf(context, angle::EntryPoint::GLTexEnvf,
1843                                                           targetPacked, pnamePacked, param));
1844         if (isCallValid)
1845         {
1846             context->texEnvf(targetPacked, pnamePacked, param);
1847         }
1848         ANGLE_CAPTURE(TexEnvf, isCallValid, context, targetPacked, pnamePacked, param);
1849     }
1850     else
1851     {
1852         GenerateContextLostErrorOnCurrentGlobalContext();
1853     }
1854 }
1855 
GL_TexEnvfv(GLenum target,GLenum pname,const GLfloat * params)1856 void GL_APIENTRY GL_TexEnvfv(GLenum target, GLenum pname, const GLfloat *params)
1857 {
1858     Context *context = GetValidGlobalContext();
1859     EVENT(context, GLTexEnvfv, "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "",
1860           CID(context), GLenumToString(GLenumGroup::TextureEnvTarget, target),
1861           GLenumToString(GLenumGroup::TextureEnvParameter, pname), (uintptr_t)params);
1862 
1863     if (context)
1864     {
1865         TextureEnvTarget targetPacked   = PackParam<TextureEnvTarget>(target);
1866         TextureEnvParameter pnamePacked = PackParam<TextureEnvParameter>(pname);
1867         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1868         bool isCallValid =
1869             (context->skipValidation() || ValidateTexEnvfv(context, angle::EntryPoint::GLTexEnvfv,
1870                                                            targetPacked, pnamePacked, params));
1871         if (isCallValid)
1872         {
1873             context->texEnvfv(targetPacked, pnamePacked, params);
1874         }
1875         ANGLE_CAPTURE(TexEnvfv, isCallValid, context, targetPacked, pnamePacked, params);
1876     }
1877     else
1878     {
1879         GenerateContextLostErrorOnCurrentGlobalContext();
1880     }
1881 }
1882 
GL_TexEnvi(GLenum target,GLenum pname,GLint param)1883 void GL_APIENTRY GL_TexEnvi(GLenum target, GLenum pname, GLint param)
1884 {
1885     Context *context = GetValidGlobalContext();
1886     EVENT(context, GLTexEnvi, "context = %d, target = %s, pname = %s, param = %d", CID(context),
1887           GLenumToString(GLenumGroup::TextureEnvTarget, target),
1888           GLenumToString(GLenumGroup::TextureEnvParameter, pname), param);
1889 
1890     if (context)
1891     {
1892         TextureEnvTarget targetPacked   = PackParam<TextureEnvTarget>(target);
1893         TextureEnvParameter pnamePacked = PackParam<TextureEnvParameter>(pname);
1894         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1895         bool isCallValid =
1896             (context->skipValidation() || ValidateTexEnvi(context, angle::EntryPoint::GLTexEnvi,
1897                                                           targetPacked, pnamePacked, param));
1898         if (isCallValid)
1899         {
1900             context->texEnvi(targetPacked, pnamePacked, param);
1901         }
1902         ANGLE_CAPTURE(TexEnvi, isCallValid, context, targetPacked, pnamePacked, param);
1903     }
1904     else
1905     {
1906         GenerateContextLostErrorOnCurrentGlobalContext();
1907     }
1908 }
1909 
GL_TexEnviv(GLenum target,GLenum pname,const GLint * params)1910 void GL_APIENTRY GL_TexEnviv(GLenum target, GLenum pname, const GLint *params)
1911 {
1912     Context *context = GetValidGlobalContext();
1913     EVENT(context, GLTexEnviv, "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "",
1914           CID(context), GLenumToString(GLenumGroup::TextureEnvTarget, target),
1915           GLenumToString(GLenumGroup::TextureEnvParameter, pname), (uintptr_t)params);
1916 
1917     if (context)
1918     {
1919         TextureEnvTarget targetPacked   = PackParam<TextureEnvTarget>(target);
1920         TextureEnvParameter pnamePacked = PackParam<TextureEnvParameter>(pname);
1921         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1922         bool isCallValid =
1923             (context->skipValidation() || ValidateTexEnviv(context, angle::EntryPoint::GLTexEnviv,
1924                                                            targetPacked, pnamePacked, params));
1925         if (isCallValid)
1926         {
1927             context->texEnviv(targetPacked, pnamePacked, params);
1928         }
1929         ANGLE_CAPTURE(TexEnviv, isCallValid, context, targetPacked, pnamePacked, params);
1930     }
1931     else
1932     {
1933         GenerateContextLostErrorOnCurrentGlobalContext();
1934     }
1935 }
1936 
GL_TexEnvx(GLenum target,GLenum pname,GLfixed param)1937 void GL_APIENTRY GL_TexEnvx(GLenum target, GLenum pname, GLfixed param)
1938 {
1939     Context *context = GetValidGlobalContext();
1940     EVENT(context, GLTexEnvx, "context = %d, target = %s, pname = %s, param = 0x%X", CID(context),
1941           GLenumToString(GLenumGroup::TextureEnvTarget, target),
1942           GLenumToString(GLenumGroup::TextureEnvParameter, pname), param);
1943 
1944     if (context)
1945     {
1946         TextureEnvTarget targetPacked   = PackParam<TextureEnvTarget>(target);
1947         TextureEnvParameter pnamePacked = PackParam<TextureEnvParameter>(pname);
1948         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1949         bool isCallValid =
1950             (context->skipValidation() || ValidateTexEnvx(context, angle::EntryPoint::GLTexEnvx,
1951                                                           targetPacked, pnamePacked, param));
1952         if (isCallValid)
1953         {
1954             context->texEnvx(targetPacked, pnamePacked, param);
1955         }
1956         ANGLE_CAPTURE(TexEnvx, isCallValid, context, targetPacked, pnamePacked, param);
1957     }
1958     else
1959     {
1960         GenerateContextLostErrorOnCurrentGlobalContext();
1961     }
1962 }
1963 
GL_TexEnvxv(GLenum target,GLenum pname,const GLfixed * params)1964 void GL_APIENTRY GL_TexEnvxv(GLenum target, GLenum pname, const GLfixed *params)
1965 {
1966     Context *context = GetValidGlobalContext();
1967     EVENT(context, GLTexEnvxv, "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "",
1968           CID(context), GLenumToString(GLenumGroup::TextureEnvTarget, target),
1969           GLenumToString(GLenumGroup::TextureEnvParameter, pname), (uintptr_t)params);
1970 
1971     if (context)
1972     {
1973         TextureEnvTarget targetPacked   = PackParam<TextureEnvTarget>(target);
1974         TextureEnvParameter pnamePacked = PackParam<TextureEnvParameter>(pname);
1975         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
1976         bool isCallValid =
1977             (context->skipValidation() || ValidateTexEnvxv(context, angle::EntryPoint::GLTexEnvxv,
1978                                                            targetPacked, pnamePacked, params));
1979         if (isCallValid)
1980         {
1981             context->texEnvxv(targetPacked, pnamePacked, params);
1982         }
1983         ANGLE_CAPTURE(TexEnvxv, isCallValid, context, targetPacked, pnamePacked, params);
1984     }
1985     else
1986     {
1987         GenerateContextLostErrorOnCurrentGlobalContext();
1988     }
1989 }
1990 
GL_TexParameterx(GLenum target,GLenum pname,GLfixed param)1991 void GL_APIENTRY GL_TexParameterx(GLenum target, GLenum pname, GLfixed param)
1992 {
1993     Context *context = GetValidGlobalContext();
1994     EVENT(context, GLTexParameterx, "context = %d, target = %s, pname = %s, param = 0x%X",
1995           CID(context), GLenumToString(GLenumGroup::TextureTarget, target),
1996           GLenumToString(GLenumGroup::GetTextureParameter, pname), param);
1997 
1998     if (context)
1999     {
2000         TextureType targetPacked                              = PackParam<TextureType>(target);
2001         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2002         bool isCallValid                                      = (context->skipValidation() ||
2003                             ValidateTexParameterx(context, angle::EntryPoint::GLTexParameterx,
2004                                                   targetPacked, pname, param));
2005         if (isCallValid)
2006         {
2007             context->texParameterx(targetPacked, pname, param);
2008         }
2009         ANGLE_CAPTURE(TexParameterx, isCallValid, context, targetPacked, pname, param);
2010     }
2011     else
2012     {
2013         GenerateContextLostErrorOnCurrentGlobalContext();
2014     }
2015 }
2016 
GL_TexParameterxv(GLenum target,GLenum pname,const GLfixed * params)2017 void GL_APIENTRY GL_TexParameterxv(GLenum target, GLenum pname, const GLfixed *params)
2018 {
2019     Context *context = GetValidGlobalContext();
2020     EVENT(context, GLTexParameterxv,
2021           "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
2022           GLenumToString(GLenumGroup::TextureTarget, target),
2023           GLenumToString(GLenumGroup::GetTextureParameter, pname), (uintptr_t)params);
2024 
2025     if (context)
2026     {
2027         TextureType targetPacked                              = PackParam<TextureType>(target);
2028         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2029         bool isCallValid                                      = (context->skipValidation() ||
2030                             ValidateTexParameterxv(context, angle::EntryPoint::GLTexParameterxv,
2031                                                    targetPacked, pname, params));
2032         if (isCallValid)
2033         {
2034             context->texParameterxv(targetPacked, pname, params);
2035         }
2036         ANGLE_CAPTURE(TexParameterxv, isCallValid, context, targetPacked, pname, params);
2037     }
2038     else
2039     {
2040         GenerateContextLostErrorOnCurrentGlobalContext();
2041     }
2042 }
2043 
GL_Translatef(GLfloat x,GLfloat y,GLfloat z)2044 void GL_APIENTRY GL_Translatef(GLfloat x, GLfloat y, GLfloat z)
2045 {
2046     Context *context = GetValidGlobalContext();
2047     EVENT(context, GLTranslatef, "context = %d, x = %f, y = %f, z = %f", CID(context), x, y, z);
2048 
2049     if (context)
2050     {
2051         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2052         bool isCallValid                                      = (context->skipValidation() ||
2053                             ValidateTranslatef(context, angle::EntryPoint::GLTranslatef, x, y, z));
2054         if (isCallValid)
2055         {
2056             context->translatef(x, y, z);
2057         }
2058         ANGLE_CAPTURE(Translatef, isCallValid, context, x, y, z);
2059     }
2060     else
2061     {
2062         GenerateContextLostErrorOnCurrentGlobalContext();
2063     }
2064 }
2065 
GL_Translatex(GLfixed x,GLfixed y,GLfixed z)2066 void GL_APIENTRY GL_Translatex(GLfixed x, GLfixed y, GLfixed z)
2067 {
2068     Context *context = GetValidGlobalContext();
2069     EVENT(context, GLTranslatex, "context = %d, x = 0x%X, y = 0x%X, z = 0x%X", CID(context), x, y,
2070           z);
2071 
2072     if (context)
2073     {
2074         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2075         bool isCallValid                                      = (context->skipValidation() ||
2076                             ValidateTranslatex(context, angle::EntryPoint::GLTranslatex, x, y, z));
2077         if (isCallValid)
2078         {
2079             context->translatex(x, y, z);
2080         }
2081         ANGLE_CAPTURE(Translatex, isCallValid, context, x, y, z);
2082     }
2083     else
2084     {
2085         GenerateContextLostErrorOnCurrentGlobalContext();
2086     }
2087 }
2088 
GL_VertexPointer(GLint size,GLenum type,GLsizei stride,const void * pointer)2089 void GL_APIENTRY GL_VertexPointer(GLint size, GLenum type, GLsizei stride, const void *pointer)
2090 {
2091     Context *context = GetValidGlobalContext();
2092     EVENT(context, GLVertexPointer,
2093           "context = %d, size = %d, type = %s, stride = %d, pointer = 0x%016" PRIxPTR "",
2094           CID(context), size, GLenumToString(GLenumGroup::VertexPointerType, type), stride,
2095           (uintptr_t)pointer);
2096 
2097     if (context)
2098     {
2099         VertexAttribType typePacked                           = PackParam<VertexAttribType>(type);
2100         std::unique_lock<angle::GlobalMutex> shareContextLock = GetContextLock(context);
2101         bool isCallValid                                      = (context->skipValidation() ||
2102                             ValidateVertexPointer(context, angle::EntryPoint::GLVertexPointer, size,
2103                                                   typePacked, stride, pointer));
2104         if (isCallValid)
2105         {
2106             context->vertexPointer(size, typePacked, stride, pointer);
2107         }
2108         ANGLE_CAPTURE(VertexPointer, isCallValid, context, size, typePacked, stride, pointer);
2109     }
2110     else
2111     {
2112         GenerateContextLostErrorOnCurrentGlobalContext();
2113     }
2114 }
2115 
2116 }  // extern "C"
2117