• 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 "libANGLE/Context.h"
14 #include "libANGLE/Context.inl.h"
15 #include "libANGLE/capture_gles_1_0_autogen.h"
16 #include "libANGLE/entry_points_utils.h"
17 #include "libANGLE/gl_enum_utils.h"
18 #include "libANGLE/validationES1.h"
19 #include "libGLESv2/global_state.h"
20 
21 namespace gl
22 {
AlphaFunc(GLenum func,GLfloat ref)23 void GL_APIENTRY AlphaFunc(GLenum func, GLfloat ref)
24 {
25     Context *context = GetValidGlobalContext();
26     EVENT("glAlphaFunc", "context = %d, GLenum func = %s, GLfloat ref = %f", CID(context),
27           GLenumToString(GLenumGroup::AlphaFunction, func), ref);
28 
29     if (context)
30     {
31         AlphaTestFunc funcPacked                              = FromGL<AlphaTestFunc>(func);
32         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
33         bool isCallValid =
34             (context->skipValidation() || ValidateAlphaFunc(context, funcPacked, ref));
35         if (isCallValid)
36         {
37             context->alphaFunc(funcPacked, ref);
38         }
39         ANGLE_CAPTURE(AlphaFunc, isCallValid, context, funcPacked, ref);
40     }
41 }
42 
AlphaFuncx(GLenum func,GLfixed ref)43 void GL_APIENTRY AlphaFuncx(GLenum func, GLfixed ref)
44 {
45     Context *context = GetValidGlobalContext();
46     EVENT("glAlphaFuncx", "context = %d, GLenum func = %s, GLfixed ref = 0x%X", CID(context),
47           GLenumToString(GLenumGroup::AlphaFunction, func), ref);
48 
49     if (context)
50     {
51         AlphaTestFunc funcPacked                              = FromGL<AlphaTestFunc>(func);
52         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
53         bool isCallValid =
54             (context->skipValidation() || ValidateAlphaFuncx(context, funcPacked, ref));
55         if (isCallValid)
56         {
57             context->alphaFuncx(funcPacked, ref);
58         }
59         ANGLE_CAPTURE(AlphaFuncx, isCallValid, context, funcPacked, ref);
60     }
61 }
62 
ClearColorx(GLfixed red,GLfixed green,GLfixed blue,GLfixed alpha)63 void GL_APIENTRY ClearColorx(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
64 {
65     Context *context = GetValidGlobalContext();
66     EVENT("glClearColorx",
67           "context = %d, GLfixed red = 0x%X, GLfixed green = 0x%X, GLfixed blue = 0x%X, GLfixed "
68           "alpha = 0x%X",
69           CID(context), red, green, blue, alpha);
70 
71     if (context)
72     {
73         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
74         bool isCallValid =
75             (context->skipValidation() || ValidateClearColorx(context, red, green, blue, alpha));
76         if (isCallValid)
77         {
78             context->clearColorx(red, green, blue, alpha);
79         }
80         ANGLE_CAPTURE(ClearColorx, isCallValid, context, red, green, blue, alpha);
81     }
82 }
83 
ClearDepthx(GLfixed depth)84 void GL_APIENTRY ClearDepthx(GLfixed depth)
85 {
86     Context *context = GetValidGlobalContext();
87     EVENT("glClearDepthx", "context = %d, GLfixed depth = 0x%X", CID(context), depth);
88 
89     if (context)
90     {
91         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
92         bool isCallValid = (context->skipValidation() || ValidateClearDepthx(context, depth));
93         if (isCallValid)
94         {
95             context->clearDepthx(depth);
96         }
97         ANGLE_CAPTURE(ClearDepthx, isCallValid, context, depth);
98     }
99 }
100 
ClientActiveTexture(GLenum texture)101 void GL_APIENTRY ClientActiveTexture(GLenum texture)
102 {
103     Context *context = GetValidGlobalContext();
104     EVENT("glClientActiveTexture", "context = %d, GLenum texture = %s", CID(context),
105           GLenumToString(GLenumGroup::TextureUnit, texture));
106 
107     if (context)
108     {
109         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
110         bool isCallValid =
111             (context->skipValidation() || ValidateClientActiveTexture(context, texture));
112         if (isCallValid)
113         {
114             context->clientActiveTexture(texture);
115         }
116         ANGLE_CAPTURE(ClientActiveTexture, isCallValid, context, texture);
117     }
118 }
119 
ClipPlanef(GLenum p,const GLfloat * eqn)120 void GL_APIENTRY ClipPlanef(GLenum p, const GLfloat *eqn)
121 {
122     Context *context = GetValidGlobalContext();
123     EVENT("glClipPlanef", "context = %d, GLenum p = %s, const GLfloat *eqn = 0x%016" PRIxPTR "",
124           CID(context), GLenumToString(GLenumGroup::ClipPlaneName, p), (uintptr_t)eqn);
125 
126     if (context)
127     {
128         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
129         bool isCallValid = (context->skipValidation() || ValidateClipPlanef(context, p, eqn));
130         if (isCallValid)
131         {
132             context->clipPlanef(p, eqn);
133         }
134         ANGLE_CAPTURE(ClipPlanef, isCallValid, context, p, eqn);
135     }
136 }
137 
ClipPlanex(GLenum plane,const GLfixed * equation)138 void GL_APIENTRY ClipPlanex(GLenum plane, const GLfixed *equation)
139 {
140     Context *context = GetValidGlobalContext();
141     EVENT("glClipPlanex",
142           "context = %d, GLenum plane = %s, const GLfixed *equation = 0x%016" PRIxPTR "",
143           CID(context), GLenumToString(GLenumGroup::ClipPlaneName, plane), (uintptr_t)equation);
144 
145     if (context)
146     {
147         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
148         bool isCallValid =
149             (context->skipValidation() || ValidateClipPlanex(context, plane, equation));
150         if (isCallValid)
151         {
152             context->clipPlanex(plane, equation);
153         }
154         ANGLE_CAPTURE(ClipPlanex, isCallValid, context, plane, equation);
155     }
156 }
157 
Color4f(GLfloat red,GLfloat green,GLfloat blue,GLfloat alpha)158 void GL_APIENTRY Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
159 {
160     Context *context = GetValidGlobalContext();
161     EVENT(
162         "glColor4f",
163         "context = %d, GLfloat red = %f, GLfloat green = %f, GLfloat blue = %f, GLfloat alpha = %f",
164         CID(context), red, green, blue, alpha);
165 
166     if (context)
167     {
168         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
169         bool isCallValid =
170             (context->skipValidation() || ValidateColor4f(context, red, green, blue, alpha));
171         if (isCallValid)
172         {
173             context->color4f(red, green, blue, alpha);
174         }
175         ANGLE_CAPTURE(Color4f, isCallValid, context, red, green, blue, alpha);
176     }
177 }
178 
Color4ub(GLubyte red,GLubyte green,GLubyte blue,GLubyte alpha)179 void GL_APIENTRY Color4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
180 {
181     Context *context = GetValidGlobalContext();
182     EVENT(
183         "glColor4ub",
184         "context = %d, GLubyte red = %d, GLubyte green = %d, GLubyte blue = %d, GLubyte alpha = %d",
185         CID(context), red, green, blue, alpha);
186 
187     if (context)
188     {
189         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
190         bool isCallValid =
191             (context->skipValidation() || ValidateColor4ub(context, red, green, blue, alpha));
192         if (isCallValid)
193         {
194             context->color4ub(red, green, blue, alpha);
195         }
196         ANGLE_CAPTURE(Color4ub, isCallValid, context, red, green, blue, alpha);
197     }
198 }
199 
Color4x(GLfixed red,GLfixed green,GLfixed blue,GLfixed alpha)200 void GL_APIENTRY Color4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
201 {
202     Context *context = GetValidGlobalContext();
203     EVENT("glColor4x",
204           "context = %d, GLfixed red = 0x%X, GLfixed green = 0x%X, GLfixed blue = 0x%X, GLfixed "
205           "alpha = 0x%X",
206           CID(context), red, green, blue, alpha);
207 
208     if (context)
209     {
210         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
211         bool isCallValid =
212             (context->skipValidation() || ValidateColor4x(context, red, green, blue, alpha));
213         if (isCallValid)
214         {
215             context->color4x(red, green, blue, alpha);
216         }
217         ANGLE_CAPTURE(Color4x, isCallValid, context, red, green, blue, alpha);
218     }
219 }
220 
ColorPointer(GLint size,GLenum type,GLsizei stride,const void * pointer)221 void GL_APIENTRY ColorPointer(GLint size, GLenum type, GLsizei stride, const void *pointer)
222 {
223     Context *context = GetValidGlobalContext();
224     EVENT("glColorPointer",
225           "context = %d, GLint size = %d, GLenum type = %s, GLsizei stride = %d, const void "
226           "*pointer = 0x%016" PRIxPTR "",
227           CID(context), size, GLenumToString(GLenumGroup::ColorPointerType, type), stride,
228           (uintptr_t)pointer);
229 
230     if (context)
231     {
232         VertexAttribType typePacked                           = FromGL<VertexAttribType>(type);
233         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
234         bool isCallValid                                      = (context->skipValidation() ||
235                             ValidateColorPointer(context, size, typePacked, stride, pointer));
236         if (isCallValid)
237         {
238             context->colorPointer(size, typePacked, stride, pointer);
239         }
240         ANGLE_CAPTURE(ColorPointer, isCallValid, context, size, typePacked, stride, pointer);
241     }
242 }
243 
DepthRangex(GLfixed n,GLfixed f)244 void GL_APIENTRY DepthRangex(GLfixed n, GLfixed f)
245 {
246     Context *context = GetValidGlobalContext();
247     EVENT("glDepthRangex", "context = %d, GLfixed n = 0x%X, GLfixed f = 0x%X", CID(context), n, f);
248 
249     if (context)
250     {
251         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
252         bool isCallValid = (context->skipValidation() || ValidateDepthRangex(context, n, f));
253         if (isCallValid)
254         {
255             context->depthRangex(n, f);
256         }
257         ANGLE_CAPTURE(DepthRangex, isCallValid, context, n, f);
258     }
259 }
260 
DisableClientState(GLenum array)261 void GL_APIENTRY DisableClientState(GLenum array)
262 {
263     Context *context = GetValidGlobalContext();
264     EVENT("glDisableClientState", "context = %d, GLenum array = %s", CID(context),
265           GLenumToString(GLenumGroup::EnableCap, array));
266 
267     if (context)
268     {
269         ClientVertexArrayType arrayPacked = FromGL<ClientVertexArrayType>(array);
270         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
271         bool isCallValid =
272             (context->skipValidation() || ValidateDisableClientState(context, arrayPacked));
273         if (isCallValid)
274         {
275             context->disableClientState(arrayPacked);
276         }
277         ANGLE_CAPTURE(DisableClientState, isCallValid, context, arrayPacked);
278     }
279 }
280 
EnableClientState(GLenum array)281 void GL_APIENTRY EnableClientState(GLenum array)
282 {
283     Context *context = GetValidGlobalContext();
284     EVENT("glEnableClientState", "context = %d, GLenum array = %s", CID(context),
285           GLenumToString(GLenumGroup::EnableCap, array));
286 
287     if (context)
288     {
289         ClientVertexArrayType arrayPacked = FromGL<ClientVertexArrayType>(array);
290         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
291         bool isCallValid =
292             (context->skipValidation() || ValidateEnableClientState(context, arrayPacked));
293         if (isCallValid)
294         {
295             context->enableClientState(arrayPacked);
296         }
297         ANGLE_CAPTURE(EnableClientState, isCallValid, context, arrayPacked);
298     }
299 }
300 
Fogf(GLenum pname,GLfloat param)301 void GL_APIENTRY Fogf(GLenum pname, GLfloat param)
302 {
303     Context *context = GetValidGlobalContext();
304     EVENT("glFogf", "context = %d, GLenum pname = %s, GLfloat param = %f", CID(context),
305           GLenumToString(GLenumGroup::FogParameter, pname), param);
306 
307     if (context)
308     {
309         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
310         bool isCallValid = (context->skipValidation() || ValidateFogf(context, pname, param));
311         if (isCallValid)
312         {
313             context->fogf(pname, param);
314         }
315         ANGLE_CAPTURE(Fogf, isCallValid, context, pname, param);
316     }
317 }
318 
Fogfv(GLenum pname,const GLfloat * params)319 void GL_APIENTRY Fogfv(GLenum pname, const GLfloat *params)
320 {
321     Context *context = GetValidGlobalContext();
322     EVENT("glFogfv", "context = %d, GLenum pname = %s, const GLfloat *params = 0x%016" PRIxPTR "",
323           CID(context), GLenumToString(GLenumGroup::FogParameter, pname), (uintptr_t)params);
324 
325     if (context)
326     {
327         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
328         bool isCallValid = (context->skipValidation() || ValidateFogfv(context, pname, params));
329         if (isCallValid)
330         {
331             context->fogfv(pname, params);
332         }
333         ANGLE_CAPTURE(Fogfv, isCallValid, context, pname, params);
334     }
335 }
336 
Fogx(GLenum pname,GLfixed param)337 void GL_APIENTRY Fogx(GLenum pname, GLfixed param)
338 {
339     Context *context = GetValidGlobalContext();
340     EVENT("glFogx", "context = %d, GLenum pname = %s, GLfixed param = 0x%X", CID(context),
341           GLenumToString(GLenumGroup::FogPName, pname), param);
342 
343     if (context)
344     {
345         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
346         bool isCallValid = (context->skipValidation() || ValidateFogx(context, pname, param));
347         if (isCallValid)
348         {
349             context->fogx(pname, param);
350         }
351         ANGLE_CAPTURE(Fogx, isCallValid, context, pname, param);
352     }
353 }
354 
Fogxv(GLenum pname,const GLfixed * param)355 void GL_APIENTRY Fogxv(GLenum pname, const GLfixed *param)
356 {
357     Context *context = GetValidGlobalContext();
358     EVENT("glFogxv", "context = %d, GLenum pname = %s, const GLfixed *param = 0x%016" PRIxPTR "",
359           CID(context), GLenumToString(GLenumGroup::FogPName, pname), (uintptr_t)param);
360 
361     if (context)
362     {
363         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
364         bool isCallValid = (context->skipValidation() || ValidateFogxv(context, pname, param));
365         if (isCallValid)
366         {
367             context->fogxv(pname, param);
368         }
369         ANGLE_CAPTURE(Fogxv, isCallValid, context, pname, param);
370     }
371 }
372 
Frustumf(GLfloat l,GLfloat r,GLfloat b,GLfloat t,GLfloat n,GLfloat f)373 void GL_APIENTRY Frustumf(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f)
374 {
375     Context *context = GetValidGlobalContext();
376     EVENT("glFrustumf",
377           "context = %d, GLfloat l = %f, GLfloat r = %f, GLfloat b = %f, GLfloat t = %f, GLfloat n "
378           "= %f, GLfloat f = %f",
379           CID(context), l, r, b, t, n, f);
380 
381     if (context)
382     {
383         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
384         bool isCallValid =
385             (context->skipValidation() || ValidateFrustumf(context, l, r, b, t, n, f));
386         if (isCallValid)
387         {
388             context->frustumf(l, r, b, t, n, f);
389         }
390         ANGLE_CAPTURE(Frustumf, isCallValid, context, l, r, b, t, n, f);
391     }
392 }
393 
Frustumx(GLfixed l,GLfixed r,GLfixed b,GLfixed t,GLfixed n,GLfixed f)394 void GL_APIENTRY Frustumx(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f)
395 {
396     Context *context = GetValidGlobalContext();
397     EVENT("glFrustumx",
398           "context = %d, GLfixed l = 0x%X, GLfixed r = 0x%X, GLfixed b = 0x%X, GLfixed t = 0x%X, "
399           "GLfixed n = 0x%X, GLfixed f = 0x%X",
400           CID(context), l, r, b, t, n, f);
401 
402     if (context)
403     {
404         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
405         bool isCallValid =
406             (context->skipValidation() || ValidateFrustumx(context, l, r, b, t, n, f));
407         if (isCallValid)
408         {
409             context->frustumx(l, r, b, t, n, f);
410         }
411         ANGLE_CAPTURE(Frustumx, isCallValid, context, l, r, b, t, n, f);
412     }
413 }
414 
GetClipPlanef(GLenum plane,GLfloat * equation)415 void GL_APIENTRY GetClipPlanef(GLenum plane, GLfloat *equation)
416 {
417     Context *context = GetValidGlobalContext();
418     EVENT("glGetClipPlanef",
419           "context = %d, GLenum plane = %s, GLfloat *equation = 0x%016" PRIxPTR "", CID(context),
420           GLenumToString(GLenumGroup::ClipPlaneName, plane), (uintptr_t)equation);
421 
422     if (context)
423     {
424         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
425         bool isCallValid =
426             (context->skipValidation() || ValidateGetClipPlanef(context, plane, equation));
427         if (isCallValid)
428         {
429             context->getClipPlanef(plane, equation);
430         }
431         ANGLE_CAPTURE(GetClipPlanef, isCallValid, context, plane, equation);
432     }
433 }
434 
GetClipPlanex(GLenum plane,GLfixed * equation)435 void GL_APIENTRY GetClipPlanex(GLenum plane, GLfixed *equation)
436 {
437     Context *context = GetValidGlobalContext();
438     EVENT("glGetClipPlanex",
439           "context = %d, GLenum plane = %s, GLfixed *equation = 0x%016" PRIxPTR "", CID(context),
440           GLenumToString(GLenumGroup::ClipPlaneName, plane), (uintptr_t)equation);
441 
442     if (context)
443     {
444         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
445         bool isCallValid =
446             (context->skipValidation() || ValidateGetClipPlanex(context, plane, equation));
447         if (isCallValid)
448         {
449             context->getClipPlanex(plane, equation);
450         }
451         ANGLE_CAPTURE(GetClipPlanex, isCallValid, context, plane, equation);
452     }
453 }
454 
GetFixedv(GLenum pname,GLfixed * params)455 void GL_APIENTRY GetFixedv(GLenum pname, GLfixed *params)
456 {
457     Context *context = GetValidGlobalContext();
458     EVENT("glGetFixedv", "context = %d, GLenum pname = %s, GLfixed *params = 0x%016" PRIxPTR "",
459           CID(context), GLenumToString(GLenumGroup::GetPName, pname), (uintptr_t)params);
460 
461     if (context)
462     {
463         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
464         bool isCallValid = (context->skipValidation() || ValidateGetFixedv(context, pname, params));
465         if (isCallValid)
466         {
467             context->getFixedv(pname, params);
468         }
469         ANGLE_CAPTURE(GetFixedv, isCallValid, context, pname, params);
470     }
471 }
472 
GetLightfv(GLenum light,GLenum pname,GLfloat * params)473 void GL_APIENTRY GetLightfv(GLenum light, GLenum pname, GLfloat *params)
474 {
475     Context *context = GetValidGlobalContext();
476     EVENT("glGetLightfv",
477           "context = %d, GLenum light = %s, GLenum pname = %s, GLfloat *params = 0x%016" PRIxPTR "",
478           CID(context), GLenumToString(GLenumGroup::LightName, light),
479           GLenumToString(GLenumGroup::LightParameter, pname), (uintptr_t)params);
480 
481     if (context)
482     {
483         LightParameter pnamePacked                            = FromGL<LightParameter>(pname);
484         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
485         bool isCallValid =
486             (context->skipValidation() || ValidateGetLightfv(context, light, pnamePacked, params));
487         if (isCallValid)
488         {
489             context->getLightfv(light, pnamePacked, params);
490         }
491         ANGLE_CAPTURE(GetLightfv, isCallValid, context, light, pnamePacked, params);
492     }
493 }
494 
GetLightxv(GLenum light,GLenum pname,GLfixed * params)495 void GL_APIENTRY GetLightxv(GLenum light, GLenum pname, GLfixed *params)
496 {
497     Context *context = GetValidGlobalContext();
498     EVENT("glGetLightxv",
499           "context = %d, GLenum light = %s, GLenum pname = %s, GLfixed *params = 0x%016" PRIxPTR "",
500           CID(context), GLenumToString(GLenumGroup::LightName, light),
501           GLenumToString(GLenumGroup::LightParameter, pname), (uintptr_t)params);
502 
503     if (context)
504     {
505         LightParameter pnamePacked                            = FromGL<LightParameter>(pname);
506         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
507         bool isCallValid =
508             (context->skipValidation() || ValidateGetLightxv(context, light, pnamePacked, params));
509         if (isCallValid)
510         {
511             context->getLightxv(light, pnamePacked, params);
512         }
513         ANGLE_CAPTURE(GetLightxv, isCallValid, context, light, pnamePacked, params);
514     }
515 }
516 
GetMaterialfv(GLenum face,GLenum pname,GLfloat * params)517 void GL_APIENTRY GetMaterialfv(GLenum face, GLenum pname, GLfloat *params)
518 {
519     Context *context = GetValidGlobalContext();
520     EVENT("glGetMaterialfv",
521           "context = %d, GLenum face = %s, GLenum pname = %s, GLfloat *params = 0x%016" PRIxPTR "",
522           CID(context), GLenumToString(GLenumGroup::MaterialFace, face),
523           GLenumToString(GLenumGroup::MaterialParameter, pname), (uintptr_t)params);
524 
525     if (context)
526     {
527         MaterialParameter pnamePacked                         = FromGL<MaterialParameter>(pname);
528         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
529         bool isCallValid                                      = (context->skipValidation() ||
530                             ValidateGetMaterialfv(context, face, pnamePacked, params));
531         if (isCallValid)
532         {
533             context->getMaterialfv(face, pnamePacked, params);
534         }
535         ANGLE_CAPTURE(GetMaterialfv, isCallValid, context, face, pnamePacked, params);
536     }
537 }
538 
GetMaterialxv(GLenum face,GLenum pname,GLfixed * params)539 void GL_APIENTRY GetMaterialxv(GLenum face, GLenum pname, GLfixed *params)
540 {
541     Context *context = GetValidGlobalContext();
542     EVENT("glGetMaterialxv",
543           "context = %d, GLenum face = %s, GLenum pname = %s, GLfixed *params = 0x%016" PRIxPTR "",
544           CID(context), GLenumToString(GLenumGroup::MaterialFace, face),
545           GLenumToString(GLenumGroup::MaterialParameter, pname), (uintptr_t)params);
546 
547     if (context)
548     {
549         MaterialParameter pnamePacked                         = FromGL<MaterialParameter>(pname);
550         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
551         bool isCallValid                                      = (context->skipValidation() ||
552                             ValidateGetMaterialxv(context, face, pnamePacked, params));
553         if (isCallValid)
554         {
555             context->getMaterialxv(face, pnamePacked, params);
556         }
557         ANGLE_CAPTURE(GetMaterialxv, isCallValid, context, face, pnamePacked, params);
558     }
559 }
560 
GetTexEnvfv(GLenum target,GLenum pname,GLfloat * params)561 void GL_APIENTRY GetTexEnvfv(GLenum target, GLenum pname, GLfloat *params)
562 {
563     Context *context = GetValidGlobalContext();
564     EVENT("glGetTexEnvfv",
565           "context = %d, GLenum target = %s, GLenum pname = %s, GLfloat *params = 0x%016" PRIxPTR
566           "",
567           CID(context), GLenumToString(GLenumGroup::TextureEnvTarget, target),
568           GLenumToString(GLenumGroup::TextureEnvParameter, pname), (uintptr_t)params);
569 
570     if (context)
571     {
572         TextureEnvTarget targetPacked                         = FromGL<TextureEnvTarget>(target);
573         TextureEnvParameter pnamePacked                       = FromGL<TextureEnvParameter>(pname);
574         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
575         bool isCallValid                                      = (context->skipValidation() ||
576                             ValidateGetTexEnvfv(context, targetPacked, pnamePacked, params));
577         if (isCallValid)
578         {
579             context->getTexEnvfv(targetPacked, pnamePacked, params);
580         }
581         ANGLE_CAPTURE(GetTexEnvfv, isCallValid, context, targetPacked, pnamePacked, params);
582     }
583 }
584 
GetTexEnviv(GLenum target,GLenum pname,GLint * params)585 void GL_APIENTRY GetTexEnviv(GLenum target, GLenum pname, GLint *params)
586 {
587     Context *context = GetValidGlobalContext();
588     EVENT("glGetTexEnviv",
589           "context = %d, GLenum target = %s, GLenum pname = %s, GLint *params = 0x%016" PRIxPTR "",
590           CID(context), GLenumToString(GLenumGroup::TextureEnvTarget, target),
591           GLenumToString(GLenumGroup::TextureEnvParameter, pname), (uintptr_t)params);
592 
593     if (context)
594     {
595         TextureEnvTarget targetPacked                         = FromGL<TextureEnvTarget>(target);
596         TextureEnvParameter pnamePacked                       = FromGL<TextureEnvParameter>(pname);
597         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
598         bool isCallValid                                      = (context->skipValidation() ||
599                             ValidateGetTexEnviv(context, targetPacked, pnamePacked, params));
600         if (isCallValid)
601         {
602             context->getTexEnviv(targetPacked, pnamePacked, params);
603         }
604         ANGLE_CAPTURE(GetTexEnviv, isCallValid, context, targetPacked, pnamePacked, params);
605     }
606 }
607 
GetTexEnvxv(GLenum target,GLenum pname,GLfixed * params)608 void GL_APIENTRY GetTexEnvxv(GLenum target, GLenum pname, GLfixed *params)
609 {
610     Context *context = GetValidGlobalContext();
611     EVENT("glGetTexEnvxv",
612           "context = %d, GLenum target = %s, GLenum pname = %s, GLfixed *params = 0x%016" PRIxPTR
613           "",
614           CID(context), GLenumToString(GLenumGroup::TextureEnvTarget, target),
615           GLenumToString(GLenumGroup::TextureEnvParameter, pname), (uintptr_t)params);
616 
617     if (context)
618     {
619         TextureEnvTarget targetPacked                         = FromGL<TextureEnvTarget>(target);
620         TextureEnvParameter pnamePacked                       = FromGL<TextureEnvParameter>(pname);
621         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
622         bool isCallValid                                      = (context->skipValidation() ||
623                             ValidateGetTexEnvxv(context, targetPacked, pnamePacked, params));
624         if (isCallValid)
625         {
626             context->getTexEnvxv(targetPacked, pnamePacked, params);
627         }
628         ANGLE_CAPTURE(GetTexEnvxv, isCallValid, context, targetPacked, pnamePacked, params);
629     }
630 }
631 
GetTexParameterxv(GLenum target,GLenum pname,GLfixed * params)632 void GL_APIENTRY GetTexParameterxv(GLenum target, GLenum pname, GLfixed *params)
633 {
634     Context *context = GetValidGlobalContext();
635     EVENT("glGetTexParameterxv",
636           "context = %d, GLenum target = %s, GLenum pname = %s, GLfixed *params = 0x%016" PRIxPTR
637           "",
638           CID(context), GLenumToString(GLenumGroup::TextureTarget, target),
639           GLenumToString(GLenumGroup::GetTextureParameter, pname), (uintptr_t)params);
640 
641     if (context)
642     {
643         TextureType targetPacked                              = FromGL<TextureType>(target);
644         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
645         bool isCallValid                                      = (context->skipValidation() ||
646                             ValidateGetTexParameterxv(context, targetPacked, pname, params));
647         if (isCallValid)
648         {
649             context->getTexParameterxv(targetPacked, pname, params);
650         }
651         ANGLE_CAPTURE(GetTexParameterxv, isCallValid, context, targetPacked, pname, params);
652     }
653 }
654 
LightModelf(GLenum pname,GLfloat param)655 void GL_APIENTRY LightModelf(GLenum pname, GLfloat param)
656 {
657     Context *context = GetValidGlobalContext();
658     EVENT("glLightModelf", "context = %d, GLenum pname = %s, GLfloat param = %f", CID(context),
659           GLenumToString(GLenumGroup::LightModelParameter, pname), param);
660 
661     if (context)
662     {
663         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
664         bool isCallValid =
665             (context->skipValidation() || ValidateLightModelf(context, pname, param));
666         if (isCallValid)
667         {
668             context->lightModelf(pname, param);
669         }
670         ANGLE_CAPTURE(LightModelf, isCallValid, context, pname, param);
671     }
672 }
673 
LightModelfv(GLenum pname,const GLfloat * params)674 void GL_APIENTRY LightModelfv(GLenum pname, const GLfloat *params)
675 {
676     Context *context = GetValidGlobalContext();
677     EVENT("glLightModelfv",
678           "context = %d, GLenum pname = %s, const GLfloat *params = 0x%016" PRIxPTR "",
679           CID(context), GLenumToString(GLenumGroup::LightModelParameter, pname), (uintptr_t)params);
680 
681     if (context)
682     {
683         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
684         bool isCallValid =
685             (context->skipValidation() || ValidateLightModelfv(context, pname, params));
686         if (isCallValid)
687         {
688             context->lightModelfv(pname, params);
689         }
690         ANGLE_CAPTURE(LightModelfv, isCallValid, context, pname, params);
691     }
692 }
693 
LightModelx(GLenum pname,GLfixed param)694 void GL_APIENTRY LightModelx(GLenum pname, GLfixed param)
695 {
696     Context *context = GetValidGlobalContext();
697     EVENT("glLightModelx", "context = %d, GLenum pname = %s, GLfixed param = 0x%X", CID(context),
698           GLenumToString(GLenumGroup::LightModelParameter, pname), param);
699 
700     if (context)
701     {
702         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
703         bool isCallValid =
704             (context->skipValidation() || ValidateLightModelx(context, pname, param));
705         if (isCallValid)
706         {
707             context->lightModelx(pname, param);
708         }
709         ANGLE_CAPTURE(LightModelx, isCallValid, context, pname, param);
710     }
711 }
712 
LightModelxv(GLenum pname,const GLfixed * param)713 void GL_APIENTRY LightModelxv(GLenum pname, const GLfixed *param)
714 {
715     Context *context = GetValidGlobalContext();
716     EVENT("glLightModelxv",
717           "context = %d, GLenum pname = %s, const GLfixed *param = 0x%016" PRIxPTR "", CID(context),
718           GLenumToString(GLenumGroup::LightModelParameter, pname), (uintptr_t)param);
719 
720     if (context)
721     {
722         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
723         bool isCallValid =
724             (context->skipValidation() || ValidateLightModelxv(context, pname, param));
725         if (isCallValid)
726         {
727             context->lightModelxv(pname, param);
728         }
729         ANGLE_CAPTURE(LightModelxv, isCallValid, context, pname, param);
730     }
731 }
732 
Lightf(GLenum light,GLenum pname,GLfloat param)733 void GL_APIENTRY Lightf(GLenum light, GLenum pname, GLfloat param)
734 {
735     Context *context = GetValidGlobalContext();
736     EVENT("glLightf", "context = %d, GLenum light = %s, GLenum pname = %s, GLfloat param = %f",
737           CID(context), GLenumToString(GLenumGroup::LightName, light),
738           GLenumToString(GLenumGroup::LightParameter, pname), param);
739 
740     if (context)
741     {
742         LightParameter pnamePacked                            = FromGL<LightParameter>(pname);
743         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
744         bool isCallValid =
745             (context->skipValidation() || ValidateLightf(context, light, pnamePacked, param));
746         if (isCallValid)
747         {
748             context->lightf(light, pnamePacked, param);
749         }
750         ANGLE_CAPTURE(Lightf, isCallValid, context, light, pnamePacked, param);
751     }
752 }
753 
Lightfv(GLenum light,GLenum pname,const GLfloat * params)754 void GL_APIENTRY Lightfv(GLenum light, GLenum pname, const GLfloat *params)
755 {
756     Context *context = GetValidGlobalContext();
757     EVENT(
758         "glLightfv",
759         "context = %d, GLenum light = %s, GLenum pname = %s, const GLfloat *params = 0x%016" PRIxPTR
760         "",
761         CID(context), GLenumToString(GLenumGroup::LightName, light),
762         GLenumToString(GLenumGroup::LightParameter, pname), (uintptr_t)params);
763 
764     if (context)
765     {
766         LightParameter pnamePacked                            = FromGL<LightParameter>(pname);
767         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
768         bool isCallValid =
769             (context->skipValidation() || ValidateLightfv(context, light, pnamePacked, params));
770         if (isCallValid)
771         {
772             context->lightfv(light, pnamePacked, params);
773         }
774         ANGLE_CAPTURE(Lightfv, isCallValid, context, light, pnamePacked, params);
775     }
776 }
777 
Lightx(GLenum light,GLenum pname,GLfixed param)778 void GL_APIENTRY Lightx(GLenum light, GLenum pname, GLfixed param)
779 {
780     Context *context = GetValidGlobalContext();
781     EVENT("glLightx", "context = %d, GLenum light = %s, GLenum pname = %s, GLfixed param = 0x%X",
782           CID(context), GLenumToString(GLenumGroup::LightName, light),
783           GLenumToString(GLenumGroup::LightParameter, pname), param);
784 
785     if (context)
786     {
787         LightParameter pnamePacked                            = FromGL<LightParameter>(pname);
788         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
789         bool isCallValid =
790             (context->skipValidation() || ValidateLightx(context, light, pnamePacked, param));
791         if (isCallValid)
792         {
793             context->lightx(light, pnamePacked, param);
794         }
795         ANGLE_CAPTURE(Lightx, isCallValid, context, light, pnamePacked, param);
796     }
797 }
798 
Lightxv(GLenum light,GLenum pname,const GLfixed * params)799 void GL_APIENTRY Lightxv(GLenum light, GLenum pname, const GLfixed *params)
800 {
801     Context *context = GetValidGlobalContext();
802     EVENT(
803         "glLightxv",
804         "context = %d, GLenum light = %s, GLenum pname = %s, const GLfixed *params = 0x%016" PRIxPTR
805         "",
806         CID(context), GLenumToString(GLenumGroup::LightName, light),
807         GLenumToString(GLenumGroup::LightParameter, pname), (uintptr_t)params);
808 
809     if (context)
810     {
811         LightParameter pnamePacked                            = FromGL<LightParameter>(pname);
812         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
813         bool isCallValid =
814             (context->skipValidation() || ValidateLightxv(context, light, pnamePacked, params));
815         if (isCallValid)
816         {
817             context->lightxv(light, pnamePacked, params);
818         }
819         ANGLE_CAPTURE(Lightxv, isCallValid, context, light, pnamePacked, params);
820     }
821 }
822 
LineWidthx(GLfixed width)823 void GL_APIENTRY LineWidthx(GLfixed width)
824 {
825     Context *context = GetValidGlobalContext();
826     EVENT("glLineWidthx", "context = %d, GLfixed width = 0x%X", CID(context), width);
827 
828     if (context)
829     {
830         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
831         bool isCallValid = (context->skipValidation() || ValidateLineWidthx(context, width));
832         if (isCallValid)
833         {
834             context->lineWidthx(width);
835         }
836         ANGLE_CAPTURE(LineWidthx, isCallValid, context, width);
837     }
838 }
839 
LoadIdentity()840 void GL_APIENTRY LoadIdentity()
841 {
842     Context *context = GetValidGlobalContext();
843     EVENT("glLoadIdentity", "context = %d", CID(context));
844 
845     if (context)
846     {
847         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
848         bool isCallValid = (context->skipValidation() || ValidateLoadIdentity(context));
849         if (isCallValid)
850         {
851             context->loadIdentity();
852         }
853         ANGLE_CAPTURE(LoadIdentity, isCallValid, context);
854     }
855 }
856 
LoadMatrixf(const GLfloat * m)857 void GL_APIENTRY LoadMatrixf(const GLfloat *m)
858 {
859     Context *context = GetValidGlobalContext();
860     EVENT("glLoadMatrixf", "context = %d, const GLfloat *m = 0x%016" PRIxPTR "", CID(context),
861           (uintptr_t)m);
862 
863     if (context)
864     {
865         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
866         bool isCallValid = (context->skipValidation() || ValidateLoadMatrixf(context, m));
867         if (isCallValid)
868         {
869             context->loadMatrixf(m);
870         }
871         ANGLE_CAPTURE(LoadMatrixf, isCallValid, context, m);
872     }
873 }
874 
LoadMatrixx(const GLfixed * m)875 void GL_APIENTRY LoadMatrixx(const GLfixed *m)
876 {
877     Context *context = GetValidGlobalContext();
878     EVENT("glLoadMatrixx", "context = %d, const GLfixed *m = 0x%016" PRIxPTR "", CID(context),
879           (uintptr_t)m);
880 
881     if (context)
882     {
883         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
884         bool isCallValid = (context->skipValidation() || ValidateLoadMatrixx(context, m));
885         if (isCallValid)
886         {
887             context->loadMatrixx(m);
888         }
889         ANGLE_CAPTURE(LoadMatrixx, isCallValid, context, m);
890     }
891 }
892 
LogicOp(GLenum opcode)893 void GL_APIENTRY LogicOp(GLenum opcode)
894 {
895     Context *context = GetValidGlobalContext();
896     EVENT("glLogicOp", "context = %d, GLenum opcode = %s", CID(context),
897           GLenumToString(GLenumGroup::LogicOp, opcode));
898 
899     if (context)
900     {
901         LogicalOperation opcodePacked                         = FromGL<LogicalOperation>(opcode);
902         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
903         bool isCallValid = (context->skipValidation() || ValidateLogicOp(context, opcodePacked));
904         if (isCallValid)
905         {
906             context->logicOp(opcodePacked);
907         }
908         ANGLE_CAPTURE(LogicOp, isCallValid, context, opcodePacked);
909     }
910 }
911 
Materialf(GLenum face,GLenum pname,GLfloat param)912 void GL_APIENTRY Materialf(GLenum face, GLenum pname, GLfloat param)
913 {
914     Context *context = GetValidGlobalContext();
915     EVENT("glMaterialf", "context = %d, GLenum face = %s, GLenum pname = %s, GLfloat param = %f",
916           CID(context), GLenumToString(GLenumGroup::MaterialFace, face),
917           GLenumToString(GLenumGroup::MaterialParameter, pname), param);
918 
919     if (context)
920     {
921         MaterialParameter pnamePacked                         = FromGL<MaterialParameter>(pname);
922         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
923         bool isCallValid =
924             (context->skipValidation() || ValidateMaterialf(context, face, pnamePacked, param));
925         if (isCallValid)
926         {
927             context->materialf(face, pnamePacked, param);
928         }
929         ANGLE_CAPTURE(Materialf, isCallValid, context, face, pnamePacked, param);
930     }
931 }
932 
Materialfv(GLenum face,GLenum pname,const GLfloat * params)933 void GL_APIENTRY Materialfv(GLenum face, GLenum pname, const GLfloat *params)
934 {
935     Context *context = GetValidGlobalContext();
936     EVENT(
937         "glMaterialfv",
938         "context = %d, GLenum face = %s, GLenum pname = %s, const GLfloat *params = 0x%016" PRIxPTR
939         "",
940         CID(context), GLenumToString(GLenumGroup::MaterialFace, face),
941         GLenumToString(GLenumGroup::MaterialParameter, pname), (uintptr_t)params);
942 
943     if (context)
944     {
945         MaterialParameter pnamePacked                         = FromGL<MaterialParameter>(pname);
946         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
947         bool isCallValid =
948             (context->skipValidation() || ValidateMaterialfv(context, face, pnamePacked, params));
949         if (isCallValid)
950         {
951             context->materialfv(face, pnamePacked, params);
952         }
953         ANGLE_CAPTURE(Materialfv, isCallValid, context, face, pnamePacked, params);
954     }
955 }
956 
Materialx(GLenum face,GLenum pname,GLfixed param)957 void GL_APIENTRY Materialx(GLenum face, GLenum pname, GLfixed param)
958 {
959     Context *context = GetValidGlobalContext();
960     EVENT("glMaterialx", "context = %d, GLenum face = %s, GLenum pname = %s, GLfixed param = 0x%X",
961           CID(context), GLenumToString(GLenumGroup::MaterialFace, face),
962           GLenumToString(GLenumGroup::MaterialParameter, pname), param);
963 
964     if (context)
965     {
966         MaterialParameter pnamePacked                         = FromGL<MaterialParameter>(pname);
967         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
968         bool isCallValid =
969             (context->skipValidation() || ValidateMaterialx(context, face, pnamePacked, param));
970         if (isCallValid)
971         {
972             context->materialx(face, pnamePacked, param);
973         }
974         ANGLE_CAPTURE(Materialx, isCallValid, context, face, pnamePacked, param);
975     }
976 }
977 
Materialxv(GLenum face,GLenum pname,const GLfixed * param)978 void GL_APIENTRY Materialxv(GLenum face, GLenum pname, const GLfixed *param)
979 {
980     Context *context = GetValidGlobalContext();
981     EVENT("glMaterialxv",
982           "context = %d, GLenum face = %s, GLenum pname = %s, const GLfixed *param = 0x%016" PRIxPTR
983           "",
984           CID(context), GLenumToString(GLenumGroup::MaterialFace, face),
985           GLenumToString(GLenumGroup::MaterialParameter, pname), (uintptr_t)param);
986 
987     if (context)
988     {
989         MaterialParameter pnamePacked                         = FromGL<MaterialParameter>(pname);
990         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
991         bool isCallValid =
992             (context->skipValidation() || ValidateMaterialxv(context, face, pnamePacked, param));
993         if (isCallValid)
994         {
995             context->materialxv(face, pnamePacked, param);
996         }
997         ANGLE_CAPTURE(Materialxv, isCallValid, context, face, pnamePacked, param);
998     }
999 }
1000 
MatrixMode(GLenum mode)1001 void GL_APIENTRY MatrixMode(GLenum mode)
1002 {
1003     Context *context = GetValidGlobalContext();
1004     EVENT("glMatrixMode", "context = %d, GLenum mode = %s", CID(context),
1005           GLenumToString(GLenumGroup::MatrixMode, mode));
1006 
1007     if (context)
1008     {
1009         MatrixType modePacked                                 = FromGL<MatrixType>(mode);
1010         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1011         bool isCallValid = (context->skipValidation() || ValidateMatrixMode(context, modePacked));
1012         if (isCallValid)
1013         {
1014             context->matrixMode(modePacked);
1015         }
1016         ANGLE_CAPTURE(MatrixMode, isCallValid, context, modePacked);
1017     }
1018 }
1019 
MultMatrixf(const GLfloat * m)1020 void GL_APIENTRY MultMatrixf(const GLfloat *m)
1021 {
1022     Context *context = GetValidGlobalContext();
1023     EVENT("glMultMatrixf", "context = %d, const GLfloat *m = 0x%016" PRIxPTR "", CID(context),
1024           (uintptr_t)m);
1025 
1026     if (context)
1027     {
1028         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1029         bool isCallValid = (context->skipValidation() || ValidateMultMatrixf(context, m));
1030         if (isCallValid)
1031         {
1032             context->multMatrixf(m);
1033         }
1034         ANGLE_CAPTURE(MultMatrixf, isCallValid, context, m);
1035     }
1036 }
1037 
MultMatrixx(const GLfixed * m)1038 void GL_APIENTRY MultMatrixx(const GLfixed *m)
1039 {
1040     Context *context = GetValidGlobalContext();
1041     EVENT("glMultMatrixx", "context = %d, const GLfixed *m = 0x%016" PRIxPTR "", CID(context),
1042           (uintptr_t)m);
1043 
1044     if (context)
1045     {
1046         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1047         bool isCallValid = (context->skipValidation() || ValidateMultMatrixx(context, m));
1048         if (isCallValid)
1049         {
1050             context->multMatrixx(m);
1051         }
1052         ANGLE_CAPTURE(MultMatrixx, isCallValid, context, m);
1053     }
1054 }
1055 
MultiTexCoord4f(GLenum target,GLfloat s,GLfloat t,GLfloat r,GLfloat q)1056 void GL_APIENTRY MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
1057 {
1058     Context *context = GetValidGlobalContext();
1059     EVENT("glMultiTexCoord4f",
1060           "context = %d, GLenum target = %s, GLfloat s = %f, GLfloat t = %f, GLfloat r = %f, "
1061           "GLfloat q = %f",
1062           CID(context), GLenumToString(GLenumGroup::TextureUnit, target), s, t, r, q);
1063 
1064     if (context)
1065     {
1066         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1067         bool isCallValid =
1068             (context->skipValidation() || ValidateMultiTexCoord4f(context, target, s, t, r, q));
1069         if (isCallValid)
1070         {
1071             context->multiTexCoord4f(target, s, t, r, q);
1072         }
1073         ANGLE_CAPTURE(MultiTexCoord4f, isCallValid, context, target, s, t, r, q);
1074     }
1075 }
1076 
MultiTexCoord4x(GLenum texture,GLfixed s,GLfixed t,GLfixed r,GLfixed q)1077 void GL_APIENTRY MultiTexCoord4x(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
1078 {
1079     Context *context = GetValidGlobalContext();
1080     EVENT("glMultiTexCoord4x",
1081           "context = %d, GLenum texture = %s, GLfixed s = 0x%X, GLfixed t = 0x%X, GLfixed r = "
1082           "0x%X, GLfixed q = 0x%X",
1083           CID(context), GLenumToString(GLenumGroup::TextureUnit, texture), s, t, r, q);
1084 
1085     if (context)
1086     {
1087         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1088         bool isCallValid =
1089             (context->skipValidation() || ValidateMultiTexCoord4x(context, texture, s, t, r, q));
1090         if (isCallValid)
1091         {
1092             context->multiTexCoord4x(texture, s, t, r, q);
1093         }
1094         ANGLE_CAPTURE(MultiTexCoord4x, isCallValid, context, texture, s, t, r, q);
1095     }
1096 }
1097 
Normal3f(GLfloat nx,GLfloat ny,GLfloat nz)1098 void GL_APIENTRY Normal3f(GLfloat nx, GLfloat ny, GLfloat nz)
1099 {
1100     Context *context = GetValidGlobalContext();
1101     EVENT("glNormal3f", "context = %d, GLfloat nx = %f, GLfloat ny = %f, GLfloat nz = %f",
1102           CID(context), nx, ny, nz);
1103 
1104     if (context)
1105     {
1106         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1107         bool isCallValid = (context->skipValidation() || ValidateNormal3f(context, nx, ny, nz));
1108         if (isCallValid)
1109         {
1110             context->normal3f(nx, ny, nz);
1111         }
1112         ANGLE_CAPTURE(Normal3f, isCallValid, context, nx, ny, nz);
1113     }
1114 }
1115 
Normal3x(GLfixed nx,GLfixed ny,GLfixed nz)1116 void GL_APIENTRY Normal3x(GLfixed nx, GLfixed ny, GLfixed nz)
1117 {
1118     Context *context = GetValidGlobalContext();
1119     EVENT("glNormal3x", "context = %d, GLfixed nx = 0x%X, GLfixed ny = 0x%X, GLfixed nz = 0x%X",
1120           CID(context), nx, ny, nz);
1121 
1122     if (context)
1123     {
1124         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1125         bool isCallValid = (context->skipValidation() || ValidateNormal3x(context, nx, ny, nz));
1126         if (isCallValid)
1127         {
1128             context->normal3x(nx, ny, nz);
1129         }
1130         ANGLE_CAPTURE(Normal3x, isCallValid, context, nx, ny, nz);
1131     }
1132 }
1133 
NormalPointer(GLenum type,GLsizei stride,const void * pointer)1134 void GL_APIENTRY NormalPointer(GLenum type, GLsizei stride, const void *pointer)
1135 {
1136     Context *context = GetValidGlobalContext();
1137     EVENT(
1138         "glNormalPointer",
1139         "context = %d, GLenum type = %s, GLsizei stride = %d, const void *pointer = 0x%016" PRIxPTR
1140         "",
1141         CID(context), GLenumToString(GLenumGroup::NormalPointerType, type), stride,
1142         (uintptr_t)pointer);
1143 
1144     if (context)
1145     {
1146         VertexAttribType typePacked                           = FromGL<VertexAttribType>(type);
1147         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1148         bool isCallValid                                      = (context->skipValidation() ||
1149                             ValidateNormalPointer(context, typePacked, stride, pointer));
1150         if (isCallValid)
1151         {
1152             context->normalPointer(typePacked, stride, pointer);
1153         }
1154         ANGLE_CAPTURE(NormalPointer, isCallValid, context, typePacked, stride, pointer);
1155     }
1156 }
1157 
Orthof(GLfloat l,GLfloat r,GLfloat b,GLfloat t,GLfloat n,GLfloat f)1158 void GL_APIENTRY Orthof(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f)
1159 {
1160     Context *context = GetValidGlobalContext();
1161     EVENT("glOrthof",
1162           "context = %d, GLfloat l = %f, GLfloat r = %f, GLfloat b = %f, GLfloat t = %f, GLfloat n "
1163           "= %f, GLfloat f = %f",
1164           CID(context), l, r, b, t, n, f);
1165 
1166     if (context)
1167     {
1168         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1169         bool isCallValid = (context->skipValidation() || ValidateOrthof(context, l, r, b, t, n, f));
1170         if (isCallValid)
1171         {
1172             context->orthof(l, r, b, t, n, f);
1173         }
1174         ANGLE_CAPTURE(Orthof, isCallValid, context, l, r, b, t, n, f);
1175     }
1176 }
1177 
Orthox(GLfixed l,GLfixed r,GLfixed b,GLfixed t,GLfixed n,GLfixed f)1178 void GL_APIENTRY Orthox(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f)
1179 {
1180     Context *context = GetValidGlobalContext();
1181     EVENT("glOrthox",
1182           "context = %d, GLfixed l = 0x%X, GLfixed r = 0x%X, GLfixed b = 0x%X, GLfixed t = 0x%X, "
1183           "GLfixed n = 0x%X, GLfixed f = 0x%X",
1184           CID(context), l, r, b, t, n, f);
1185 
1186     if (context)
1187     {
1188         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1189         bool isCallValid = (context->skipValidation() || ValidateOrthox(context, l, r, b, t, n, f));
1190         if (isCallValid)
1191         {
1192             context->orthox(l, r, b, t, n, f);
1193         }
1194         ANGLE_CAPTURE(Orthox, isCallValid, context, l, r, b, t, n, f);
1195     }
1196 }
1197 
PointParameterf(GLenum pname,GLfloat param)1198 void GL_APIENTRY PointParameterf(GLenum pname, GLfloat param)
1199 {
1200     Context *context = GetValidGlobalContext();
1201     EVENT("glPointParameterf", "context = %d, GLenum pname = %s, GLfloat param = %f", CID(context),
1202           GLenumToString(GLenumGroup::DefaultGroup, pname), param);
1203 
1204     if (context)
1205     {
1206         PointParameter pnamePacked                            = FromGL<PointParameter>(pname);
1207         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1208         bool isCallValid =
1209             (context->skipValidation() || ValidatePointParameterf(context, pnamePacked, param));
1210         if (isCallValid)
1211         {
1212             context->pointParameterf(pnamePacked, param);
1213         }
1214         ANGLE_CAPTURE(PointParameterf, isCallValid, context, pnamePacked, param);
1215     }
1216 }
1217 
PointParameterfv(GLenum pname,const GLfloat * params)1218 void GL_APIENTRY PointParameterfv(GLenum pname, const GLfloat *params)
1219 {
1220     Context *context = GetValidGlobalContext();
1221     EVENT("glPointParameterfv",
1222           "context = %d, GLenum pname = %s, const GLfloat *params = 0x%016" PRIxPTR "",
1223           CID(context), GLenumToString(GLenumGroup::DefaultGroup, pname), (uintptr_t)params);
1224 
1225     if (context)
1226     {
1227         PointParameter pnamePacked                            = FromGL<PointParameter>(pname);
1228         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1229         bool isCallValid =
1230             (context->skipValidation() || ValidatePointParameterfv(context, pnamePacked, params));
1231         if (isCallValid)
1232         {
1233             context->pointParameterfv(pnamePacked, params);
1234         }
1235         ANGLE_CAPTURE(PointParameterfv, isCallValid, context, pnamePacked, params);
1236     }
1237 }
1238 
PointParameterx(GLenum pname,GLfixed param)1239 void GL_APIENTRY PointParameterx(GLenum pname, GLfixed param)
1240 {
1241     Context *context = GetValidGlobalContext();
1242     EVENT("glPointParameterx", "context = %d, GLenum pname = %s, GLfixed param = 0x%X",
1243           CID(context), GLenumToString(GLenumGroup::DefaultGroup, pname), param);
1244 
1245     if (context)
1246     {
1247         PointParameter pnamePacked                            = FromGL<PointParameter>(pname);
1248         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1249         bool isCallValid =
1250             (context->skipValidation() || ValidatePointParameterx(context, pnamePacked, param));
1251         if (isCallValid)
1252         {
1253             context->pointParameterx(pnamePacked, param);
1254         }
1255         ANGLE_CAPTURE(PointParameterx, isCallValid, context, pnamePacked, param);
1256     }
1257 }
1258 
PointParameterxv(GLenum pname,const GLfixed * params)1259 void GL_APIENTRY PointParameterxv(GLenum pname, const GLfixed *params)
1260 {
1261     Context *context = GetValidGlobalContext();
1262     EVENT("glPointParameterxv",
1263           "context = %d, GLenum pname = %s, const GLfixed *params = 0x%016" PRIxPTR "",
1264           CID(context), GLenumToString(GLenumGroup::DefaultGroup, pname), (uintptr_t)params);
1265 
1266     if (context)
1267     {
1268         PointParameter pnamePacked                            = FromGL<PointParameter>(pname);
1269         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1270         bool isCallValid =
1271             (context->skipValidation() || ValidatePointParameterxv(context, pnamePacked, params));
1272         if (isCallValid)
1273         {
1274             context->pointParameterxv(pnamePacked, params);
1275         }
1276         ANGLE_CAPTURE(PointParameterxv, isCallValid, context, pnamePacked, params);
1277     }
1278 }
1279 
PointSize(GLfloat size)1280 void GL_APIENTRY PointSize(GLfloat size)
1281 {
1282     Context *context = GetValidGlobalContext();
1283     EVENT("glPointSize", "context = %d, GLfloat size = %f", CID(context), size);
1284 
1285     if (context)
1286     {
1287         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1288         bool isCallValid = (context->skipValidation() || ValidatePointSize(context, size));
1289         if (isCallValid)
1290         {
1291             context->pointSize(size);
1292         }
1293         ANGLE_CAPTURE(PointSize, isCallValid, context, size);
1294     }
1295 }
1296 
PointSizex(GLfixed size)1297 void GL_APIENTRY PointSizex(GLfixed size)
1298 {
1299     Context *context = GetValidGlobalContext();
1300     EVENT("glPointSizex", "context = %d, GLfixed size = 0x%X", CID(context), size);
1301 
1302     if (context)
1303     {
1304         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1305         bool isCallValid = (context->skipValidation() || ValidatePointSizex(context, size));
1306         if (isCallValid)
1307         {
1308             context->pointSizex(size);
1309         }
1310         ANGLE_CAPTURE(PointSizex, isCallValid, context, size);
1311     }
1312 }
1313 
PolygonOffsetx(GLfixed factor,GLfixed units)1314 void GL_APIENTRY PolygonOffsetx(GLfixed factor, GLfixed units)
1315 {
1316     Context *context = GetValidGlobalContext();
1317     EVENT("glPolygonOffsetx", "context = %d, GLfixed factor = 0x%X, GLfixed units = 0x%X",
1318           CID(context), factor, units);
1319 
1320     if (context)
1321     {
1322         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1323         bool isCallValid =
1324             (context->skipValidation() || ValidatePolygonOffsetx(context, factor, units));
1325         if (isCallValid)
1326         {
1327             context->polygonOffsetx(factor, units);
1328         }
1329         ANGLE_CAPTURE(PolygonOffsetx, isCallValid, context, factor, units);
1330     }
1331 }
1332 
PopMatrix()1333 void GL_APIENTRY PopMatrix()
1334 {
1335     Context *context = GetValidGlobalContext();
1336     EVENT("glPopMatrix", "context = %d", CID(context));
1337 
1338     if (context)
1339     {
1340         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1341         bool isCallValid = (context->skipValidation() || ValidatePopMatrix(context));
1342         if (isCallValid)
1343         {
1344             context->popMatrix();
1345         }
1346         ANGLE_CAPTURE(PopMatrix, isCallValid, context);
1347     }
1348 }
1349 
PushMatrix()1350 void GL_APIENTRY PushMatrix()
1351 {
1352     Context *context = GetValidGlobalContext();
1353     EVENT("glPushMatrix", "context = %d", CID(context));
1354 
1355     if (context)
1356     {
1357         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1358         bool isCallValid = (context->skipValidation() || ValidatePushMatrix(context));
1359         if (isCallValid)
1360         {
1361             context->pushMatrix();
1362         }
1363         ANGLE_CAPTURE(PushMatrix, isCallValid, context);
1364     }
1365 }
1366 
Rotatef(GLfloat angle,GLfloat x,GLfloat y,GLfloat z)1367 void GL_APIENTRY Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
1368 {
1369     Context *context = GetValidGlobalContext();
1370     EVENT("glRotatef",
1371           "context = %d, GLfloat angle = %f, GLfloat x = %f, GLfloat y = %f, GLfloat z = %f",
1372           CID(context), angle, x, y, z);
1373 
1374     if (context)
1375     {
1376         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1377         bool isCallValid = (context->skipValidation() || ValidateRotatef(context, angle, x, y, z));
1378         if (isCallValid)
1379         {
1380             context->rotatef(angle, x, y, z);
1381         }
1382         ANGLE_CAPTURE(Rotatef, isCallValid, context, angle, x, y, z);
1383     }
1384 }
1385 
Rotatex(GLfixed angle,GLfixed x,GLfixed y,GLfixed z)1386 void GL_APIENTRY Rotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
1387 {
1388     Context *context = GetValidGlobalContext();
1389     EVENT(
1390         "glRotatex",
1391         "context = %d, GLfixed angle = 0x%X, GLfixed x = 0x%X, GLfixed y = 0x%X, GLfixed z = 0x%X",
1392         CID(context), angle, x, y, z);
1393 
1394     if (context)
1395     {
1396         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1397         bool isCallValid = (context->skipValidation() || ValidateRotatex(context, angle, x, y, z));
1398         if (isCallValid)
1399         {
1400             context->rotatex(angle, x, y, z);
1401         }
1402         ANGLE_CAPTURE(Rotatex, isCallValid, context, angle, x, y, z);
1403     }
1404 }
1405 
SampleCoveragex(GLclampx value,GLboolean invert)1406 void GL_APIENTRY SampleCoveragex(GLclampx value, GLboolean invert)
1407 {
1408     Context *context = GetValidGlobalContext();
1409     EVENT("glSampleCoveragex", "context = %d, GLclampx value = 0x%X, GLboolean invert = %s",
1410           CID(context), value, GLbooleanToString(invert));
1411 
1412     if (context)
1413     {
1414         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1415         bool isCallValid =
1416             (context->skipValidation() || ValidateSampleCoveragex(context, value, invert));
1417         if (isCallValid)
1418         {
1419             context->sampleCoveragex(value, invert);
1420         }
1421         ANGLE_CAPTURE(SampleCoveragex, isCallValid, context, value, invert);
1422     }
1423 }
1424 
Scalef(GLfloat x,GLfloat y,GLfloat z)1425 void GL_APIENTRY Scalef(GLfloat x, GLfloat y, GLfloat z)
1426 {
1427     Context *context = GetValidGlobalContext();
1428     EVENT("glScalef", "context = %d, GLfloat x = %f, GLfloat y = %f, GLfloat z = %f", CID(context),
1429           x, y, z);
1430 
1431     if (context)
1432     {
1433         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1434         bool isCallValid = (context->skipValidation() || ValidateScalef(context, x, y, z));
1435         if (isCallValid)
1436         {
1437             context->scalef(x, y, z);
1438         }
1439         ANGLE_CAPTURE(Scalef, isCallValid, context, x, y, z);
1440     }
1441 }
1442 
Scalex(GLfixed x,GLfixed y,GLfixed z)1443 void GL_APIENTRY Scalex(GLfixed x, GLfixed y, GLfixed z)
1444 {
1445     Context *context = GetValidGlobalContext();
1446     EVENT("glScalex", "context = %d, GLfixed x = 0x%X, GLfixed y = 0x%X, GLfixed z = 0x%X",
1447           CID(context), x, y, z);
1448 
1449     if (context)
1450     {
1451         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1452         bool isCallValid = (context->skipValidation() || ValidateScalex(context, x, y, z));
1453         if (isCallValid)
1454         {
1455             context->scalex(x, y, z);
1456         }
1457         ANGLE_CAPTURE(Scalex, isCallValid, context, x, y, z);
1458     }
1459 }
1460 
ShadeModel(GLenum mode)1461 void GL_APIENTRY ShadeModel(GLenum mode)
1462 {
1463     Context *context = GetValidGlobalContext();
1464     EVENT("glShadeModel", "context = %d, GLenum mode = %s", CID(context),
1465           GLenumToString(GLenumGroup::ShadingModel, mode));
1466 
1467     if (context)
1468     {
1469         ShadingModel modePacked                               = FromGL<ShadingModel>(mode);
1470         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1471         bool isCallValid = (context->skipValidation() || ValidateShadeModel(context, modePacked));
1472         if (isCallValid)
1473         {
1474             context->shadeModel(modePacked);
1475         }
1476         ANGLE_CAPTURE(ShadeModel, isCallValid, context, modePacked);
1477     }
1478 }
1479 
TexCoordPointer(GLint size,GLenum type,GLsizei stride,const void * pointer)1480 void GL_APIENTRY TexCoordPointer(GLint size, GLenum type, GLsizei stride, const void *pointer)
1481 {
1482     Context *context = GetValidGlobalContext();
1483     EVENT("glTexCoordPointer",
1484           "context = %d, GLint size = %d, GLenum type = %s, GLsizei stride = %d, const void "
1485           "*pointer = 0x%016" PRIxPTR "",
1486           CID(context), size, GLenumToString(GLenumGroup::TexCoordPointerType, type), stride,
1487           (uintptr_t)pointer);
1488 
1489     if (context)
1490     {
1491         VertexAttribType typePacked                           = FromGL<VertexAttribType>(type);
1492         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1493         bool isCallValid                                      = (context->skipValidation() ||
1494                             ValidateTexCoordPointer(context, size, typePacked, stride, pointer));
1495         if (isCallValid)
1496         {
1497             context->texCoordPointer(size, typePacked, stride, pointer);
1498         }
1499         ANGLE_CAPTURE(TexCoordPointer, isCallValid, context, size, typePacked, stride, pointer);
1500     }
1501 }
1502 
TexEnvf(GLenum target,GLenum pname,GLfloat param)1503 void GL_APIENTRY TexEnvf(GLenum target, GLenum pname, GLfloat param)
1504 {
1505     Context *context = GetValidGlobalContext();
1506     EVENT("glTexEnvf", "context = %d, GLenum target = %s, GLenum pname = %s, GLfloat param = %f",
1507           CID(context), GLenumToString(GLenumGroup::TextureEnvTarget, target),
1508           GLenumToString(GLenumGroup::TextureEnvParameter, pname), param);
1509 
1510     if (context)
1511     {
1512         TextureEnvTarget targetPacked                         = FromGL<TextureEnvTarget>(target);
1513         TextureEnvParameter pnamePacked                       = FromGL<TextureEnvParameter>(pname);
1514         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1515         bool isCallValid                                      = (context->skipValidation() ||
1516                             ValidateTexEnvf(context, targetPacked, pnamePacked, param));
1517         if (isCallValid)
1518         {
1519             context->texEnvf(targetPacked, pnamePacked, param);
1520         }
1521         ANGLE_CAPTURE(TexEnvf, isCallValid, context, targetPacked, pnamePacked, param);
1522     }
1523 }
1524 
TexEnvfv(GLenum target,GLenum pname,const GLfloat * params)1525 void GL_APIENTRY TexEnvfv(GLenum target, GLenum pname, const GLfloat *params)
1526 {
1527     Context *context = GetValidGlobalContext();
1528     EVENT("glTexEnvfv",
1529           "context = %d, GLenum target = %s, GLenum pname = %s, const GLfloat *params = "
1530           "0x%016" PRIxPTR "",
1531           CID(context), GLenumToString(GLenumGroup::TextureEnvTarget, target),
1532           GLenumToString(GLenumGroup::TextureEnvParameter, pname), (uintptr_t)params);
1533 
1534     if (context)
1535     {
1536         TextureEnvTarget targetPacked                         = FromGL<TextureEnvTarget>(target);
1537         TextureEnvParameter pnamePacked                       = FromGL<TextureEnvParameter>(pname);
1538         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1539         bool isCallValid                                      = (context->skipValidation() ||
1540                             ValidateTexEnvfv(context, targetPacked, pnamePacked, params));
1541         if (isCallValid)
1542         {
1543             context->texEnvfv(targetPacked, pnamePacked, params);
1544         }
1545         ANGLE_CAPTURE(TexEnvfv, isCallValid, context, targetPacked, pnamePacked, params);
1546     }
1547 }
1548 
TexEnvi(GLenum target,GLenum pname,GLint param)1549 void GL_APIENTRY TexEnvi(GLenum target, GLenum pname, GLint param)
1550 {
1551     Context *context = GetValidGlobalContext();
1552     EVENT("glTexEnvi", "context = %d, GLenum target = %s, GLenum pname = %s, GLint param = %d",
1553           CID(context), GLenumToString(GLenumGroup::TextureEnvTarget, target),
1554           GLenumToString(GLenumGroup::TextureEnvParameter, pname), param);
1555 
1556     if (context)
1557     {
1558         TextureEnvTarget targetPacked                         = FromGL<TextureEnvTarget>(target);
1559         TextureEnvParameter pnamePacked                       = FromGL<TextureEnvParameter>(pname);
1560         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1561         bool isCallValid                                      = (context->skipValidation() ||
1562                             ValidateTexEnvi(context, targetPacked, pnamePacked, param));
1563         if (isCallValid)
1564         {
1565             context->texEnvi(targetPacked, pnamePacked, param);
1566         }
1567         ANGLE_CAPTURE(TexEnvi, isCallValid, context, targetPacked, pnamePacked, param);
1568     }
1569 }
1570 
TexEnviv(GLenum target,GLenum pname,const GLint * params)1571 void GL_APIENTRY TexEnviv(GLenum target, GLenum pname, const GLint *params)
1572 {
1573     Context *context = GetValidGlobalContext();
1574     EVENT(
1575         "glTexEnviv",
1576         "context = %d, GLenum target = %s, GLenum pname = %s, const GLint *params = 0x%016" PRIxPTR
1577         "",
1578         CID(context), GLenumToString(GLenumGroup::TextureEnvTarget, target),
1579         GLenumToString(GLenumGroup::TextureEnvParameter, pname), (uintptr_t)params);
1580 
1581     if (context)
1582     {
1583         TextureEnvTarget targetPacked                         = FromGL<TextureEnvTarget>(target);
1584         TextureEnvParameter pnamePacked                       = FromGL<TextureEnvParameter>(pname);
1585         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1586         bool isCallValid                                      = (context->skipValidation() ||
1587                             ValidateTexEnviv(context, targetPacked, pnamePacked, params));
1588         if (isCallValid)
1589         {
1590             context->texEnviv(targetPacked, pnamePacked, params);
1591         }
1592         ANGLE_CAPTURE(TexEnviv, isCallValid, context, targetPacked, pnamePacked, params);
1593     }
1594 }
1595 
TexEnvx(GLenum target,GLenum pname,GLfixed param)1596 void GL_APIENTRY TexEnvx(GLenum target, GLenum pname, GLfixed param)
1597 {
1598     Context *context = GetValidGlobalContext();
1599     EVENT("glTexEnvx", "context = %d, GLenum target = %s, GLenum pname = %s, GLfixed param = 0x%X",
1600           CID(context), GLenumToString(GLenumGroup::TextureEnvTarget, target),
1601           GLenumToString(GLenumGroup::TextureEnvParameter, pname), param);
1602 
1603     if (context)
1604     {
1605         TextureEnvTarget targetPacked                         = FromGL<TextureEnvTarget>(target);
1606         TextureEnvParameter pnamePacked                       = FromGL<TextureEnvParameter>(pname);
1607         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1608         bool isCallValid                                      = (context->skipValidation() ||
1609                             ValidateTexEnvx(context, targetPacked, pnamePacked, param));
1610         if (isCallValid)
1611         {
1612             context->texEnvx(targetPacked, pnamePacked, param);
1613         }
1614         ANGLE_CAPTURE(TexEnvx, isCallValid, context, targetPacked, pnamePacked, param);
1615     }
1616 }
1617 
TexEnvxv(GLenum target,GLenum pname,const GLfixed * params)1618 void GL_APIENTRY TexEnvxv(GLenum target, GLenum pname, const GLfixed *params)
1619 {
1620     Context *context = GetValidGlobalContext();
1621     EVENT("glTexEnvxv",
1622           "context = %d, GLenum target = %s, GLenum pname = %s, const GLfixed *params = "
1623           "0x%016" PRIxPTR "",
1624           CID(context), GLenumToString(GLenumGroup::TextureEnvTarget, target),
1625           GLenumToString(GLenumGroup::TextureEnvParameter, pname), (uintptr_t)params);
1626 
1627     if (context)
1628     {
1629         TextureEnvTarget targetPacked                         = FromGL<TextureEnvTarget>(target);
1630         TextureEnvParameter pnamePacked                       = FromGL<TextureEnvParameter>(pname);
1631         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1632         bool isCallValid                                      = (context->skipValidation() ||
1633                             ValidateTexEnvxv(context, targetPacked, pnamePacked, params));
1634         if (isCallValid)
1635         {
1636             context->texEnvxv(targetPacked, pnamePacked, params);
1637         }
1638         ANGLE_CAPTURE(TexEnvxv, isCallValid, context, targetPacked, pnamePacked, params);
1639     }
1640 }
1641 
TexParameterx(GLenum target,GLenum pname,GLfixed param)1642 void GL_APIENTRY TexParameterx(GLenum target, GLenum pname, GLfixed param)
1643 {
1644     Context *context = GetValidGlobalContext();
1645     EVENT("glTexParameterx",
1646           "context = %d, GLenum target = %s, GLenum pname = %s, GLfixed param = 0x%X", CID(context),
1647           GLenumToString(GLenumGroup::TextureTarget, target),
1648           GLenumToString(GLenumGroup::GetTextureParameter, pname), param);
1649 
1650     if (context)
1651     {
1652         TextureType targetPacked                              = FromGL<TextureType>(target);
1653         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1654         bool isCallValid                                      = (context->skipValidation() ||
1655                             ValidateTexParameterx(context, targetPacked, pname, param));
1656         if (isCallValid)
1657         {
1658             context->texParameterx(targetPacked, pname, param);
1659         }
1660         ANGLE_CAPTURE(TexParameterx, isCallValid, context, targetPacked, pname, param);
1661     }
1662 }
1663 
TexParameterxv(GLenum target,GLenum pname,const GLfixed * params)1664 void GL_APIENTRY TexParameterxv(GLenum target, GLenum pname, const GLfixed *params)
1665 {
1666     Context *context = GetValidGlobalContext();
1667     EVENT("glTexParameterxv",
1668           "context = %d, GLenum target = %s, GLenum pname = %s, const GLfixed *params = "
1669           "0x%016" PRIxPTR "",
1670           CID(context), GLenumToString(GLenumGroup::TextureTarget, target),
1671           GLenumToString(GLenumGroup::GetTextureParameter, pname), (uintptr_t)params);
1672 
1673     if (context)
1674     {
1675         TextureType targetPacked                              = FromGL<TextureType>(target);
1676         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1677         bool isCallValid                                      = (context->skipValidation() ||
1678                             ValidateTexParameterxv(context, targetPacked, pname, params));
1679         if (isCallValid)
1680         {
1681             context->texParameterxv(targetPacked, pname, params);
1682         }
1683         ANGLE_CAPTURE(TexParameterxv, isCallValid, context, targetPacked, pname, params);
1684     }
1685 }
1686 
Translatef(GLfloat x,GLfloat y,GLfloat z)1687 void GL_APIENTRY Translatef(GLfloat x, GLfloat y, GLfloat z)
1688 {
1689     Context *context = GetValidGlobalContext();
1690     EVENT("glTranslatef", "context = %d, GLfloat x = %f, GLfloat y = %f, GLfloat z = %f",
1691           CID(context), x, y, z);
1692 
1693     if (context)
1694     {
1695         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1696         bool isCallValid = (context->skipValidation() || ValidateTranslatef(context, x, y, z));
1697         if (isCallValid)
1698         {
1699             context->translatef(x, y, z);
1700         }
1701         ANGLE_CAPTURE(Translatef, isCallValid, context, x, y, z);
1702     }
1703 }
1704 
Translatex(GLfixed x,GLfixed y,GLfixed z)1705 void GL_APIENTRY Translatex(GLfixed x, GLfixed y, GLfixed z)
1706 {
1707     Context *context = GetValidGlobalContext();
1708     EVENT("glTranslatex", "context = %d, GLfixed x = 0x%X, GLfixed y = 0x%X, GLfixed z = 0x%X",
1709           CID(context), x, y, z);
1710 
1711     if (context)
1712     {
1713         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1714         bool isCallValid = (context->skipValidation() || ValidateTranslatex(context, x, y, z));
1715         if (isCallValid)
1716         {
1717             context->translatex(x, y, z);
1718         }
1719         ANGLE_CAPTURE(Translatex, isCallValid, context, x, y, z);
1720     }
1721 }
1722 
VertexPointer(GLint size,GLenum type,GLsizei stride,const void * pointer)1723 void GL_APIENTRY VertexPointer(GLint size, GLenum type, GLsizei stride, const void *pointer)
1724 {
1725     Context *context = GetValidGlobalContext();
1726     EVENT("glVertexPointer",
1727           "context = %d, GLint size = %d, GLenum type = %s, GLsizei stride = %d, const void "
1728           "*pointer = 0x%016" PRIxPTR "",
1729           CID(context), size, GLenumToString(GLenumGroup::VertexPointerType, type), stride,
1730           (uintptr_t)pointer);
1731 
1732     if (context)
1733     {
1734         VertexAttribType typePacked                           = FromGL<VertexAttribType>(type);
1735         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
1736         bool isCallValid                                      = (context->skipValidation() ||
1737                             ValidateVertexPointer(context, size, typePacked, stride, pointer));
1738         if (isCallValid)
1739         {
1740             context->vertexPointer(size, typePacked, stride, pointer);
1741         }
1742         ANGLE_CAPTURE(VertexPointer, isCallValid, context, size, typePacked, stride, pointer);
1743     }
1744 }
1745 }  // namespace gl
1746