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_3_1_autogen.cpp:
9 // Defines the GLES 3.1 entry points.
10
11 #include "libGLESv2/entry_points_gles_3_1_autogen.h"
12
13 #include "common/entry_points_enum_autogen.h"
14 #include "common/gl_enum_utils.h"
15 #include "libANGLE/Context.h"
16 #include "libANGLE/Context.inl.h"
17 #include "libANGLE/capture/capture_gles_3_1_autogen.h"
18 #include "libANGLE/context_private_call_gles_autogen.h"
19 #include "libANGLE/entry_points_utils.h"
20 #include "libANGLE/validationES31.h"
21 #include "libGLESv2/global_state.h"
22
23 using namespace gl;
24
25 extern "C" {
GL_ActiveShaderProgram(GLuint pipeline,GLuint program)26 void GL_APIENTRY GL_ActiveShaderProgram(GLuint pipeline, GLuint program)
27 {
28 Context *context = GetValidGlobalContext();
29 EVENT(context, GLActiveShaderProgram, "context = %d, pipeline = %u, program = %u", CID(context),
30 pipeline, program);
31
32 if (context)
33 {
34 ProgramPipelineID pipelinePacked = PackParam<ProgramPipelineID>(pipeline);
35 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
36 SCOPED_SHARE_CONTEXT_LOCK(context);
37 bool isCallValid =
38 (context->skipValidation() ||
39 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
40 context->getMutableErrorSetForValidation(),
41 angle::EntryPoint::GLActiveShaderProgram) &&
42 ValidateActiveShaderProgram(context, angle::EntryPoint::GLActiveShaderProgram,
43 pipelinePacked, programPacked)));
44 if (isCallValid)
45 {
46 context->activeShaderProgram(pipelinePacked, programPacked);
47 }
48 ANGLE_CAPTURE_GL(ActiveShaderProgram, isCallValid, context, pipelinePacked, programPacked);
49 }
50 else
51 {
52 GenerateContextLostErrorOnCurrentGlobalContext();
53 }
54 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
55 }
56
GL_BindImageTexture(GLuint unit,GLuint texture,GLint level,GLboolean layered,GLint layer,GLenum access,GLenum format)57 void GL_APIENTRY GL_BindImageTexture(GLuint unit,
58 GLuint texture,
59 GLint level,
60 GLboolean layered,
61 GLint layer,
62 GLenum access,
63 GLenum format)
64 {
65 Context *context = GetValidGlobalContext();
66 EVENT(context, GLBindImageTexture,
67 "context = %d, unit = %u, texture = %u, level = %d, layered = %s, layer = %d, access = "
68 "%s, format = %s",
69 CID(context), unit, texture, level, GLbooleanToString(layered), layer,
70 GLenumToString(GLESEnum::BufferAccessARB, access),
71 GLenumToString(GLESEnum::InternalFormat, format));
72
73 if (context)
74 {
75 TextureID texturePacked = PackParam<TextureID>(texture);
76 SCOPED_SHARE_CONTEXT_LOCK(context);
77 bool isCallValid =
78 (context->skipValidation() ||
79 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
80 context->getMutableErrorSetForValidation(),
81 angle::EntryPoint::GLBindImageTexture) &&
82 ValidateBindImageTexture(context, angle::EntryPoint::GLBindImageTexture, unit,
83 texturePacked, level, layered, layer, access, format)));
84 if (isCallValid)
85 {
86 context->bindImageTexture(unit, texturePacked, level, layered, layer, access, format);
87 }
88 ANGLE_CAPTURE_GL(BindImageTexture, isCallValid, context, unit, texturePacked, level,
89 layered, layer, access, format);
90 }
91 else
92 {
93 GenerateContextLostErrorOnCurrentGlobalContext();
94 }
95 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
96 }
97
GL_BindProgramPipeline(GLuint pipeline)98 void GL_APIENTRY GL_BindProgramPipeline(GLuint pipeline)
99 {
100 Context *context = GetValidGlobalContext();
101 EVENT(context, GLBindProgramPipeline, "context = %d, pipeline = %u", CID(context), pipeline);
102
103 if (context)
104 {
105 ProgramPipelineID pipelinePacked = PackParam<ProgramPipelineID>(pipeline);
106 SCOPED_SHARE_CONTEXT_LOCK(context);
107 bool isCallValid =
108 (context->skipValidation() ||
109 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
110 context->getMutableErrorSetForValidation(),
111 angle::EntryPoint::GLBindProgramPipeline) &&
112 ValidateBindProgramPipeline(context, angle::EntryPoint::GLBindProgramPipeline,
113 pipelinePacked)));
114 if (isCallValid)
115 {
116 context->bindProgramPipeline(pipelinePacked);
117 }
118 ANGLE_CAPTURE_GL(BindProgramPipeline, isCallValid, context, pipelinePacked);
119 }
120 else
121 {
122 GenerateContextLostErrorOnCurrentGlobalContext();
123 }
124 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
125 }
126
GL_BindVertexBuffer(GLuint bindingindex,GLuint buffer,GLintptr offset,GLsizei stride)127 void GL_APIENTRY GL_BindVertexBuffer(GLuint bindingindex,
128 GLuint buffer,
129 GLintptr offset,
130 GLsizei stride)
131 {
132 Context *context = GetValidGlobalContext();
133 EVENT(context, GLBindVertexBuffer,
134 "context = %d, bindingindex = %u, buffer = %u, offset = %llu, stride = %d", CID(context),
135 bindingindex, buffer, static_cast<unsigned long long>(offset), stride);
136
137 if (context)
138 {
139 BufferID bufferPacked = PackParam<BufferID>(buffer);
140 SCOPED_SHARE_CONTEXT_LOCK(context);
141 bool isCallValid =
142 (context->skipValidation() ||
143 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
144 context->getMutableErrorSetForValidation(),
145 angle::EntryPoint::GLBindVertexBuffer) &&
146 ValidateBindVertexBuffer(context, angle::EntryPoint::GLBindVertexBuffer, bindingindex,
147 bufferPacked, offset, stride)));
148 if (isCallValid)
149 {
150 context->bindVertexBuffer(bindingindex, bufferPacked, offset, stride);
151 }
152 ANGLE_CAPTURE_GL(BindVertexBuffer, isCallValid, context, bindingindex, bufferPacked, offset,
153 stride);
154 }
155 else
156 {
157 GenerateContextLostErrorOnCurrentGlobalContext();
158 }
159 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
160 }
161
GL_CreateShaderProgramv(GLenum type,GLsizei count,const GLchar * const * strings)162 GLuint GL_APIENTRY GL_CreateShaderProgramv(GLenum type, GLsizei count, const GLchar *const *strings)
163 {
164 Context *context = GetValidGlobalContext();
165 EVENT(context, GLCreateShaderProgramv,
166 "context = %d, type = %s, count = %d, strings = 0x%016" PRIxPTR "", CID(context),
167 GLenumToString(GLESEnum::ShaderType, type), count, (uintptr_t)strings);
168
169 GLuint returnValue;
170 if (context)
171 {
172 ShaderType typePacked = PackParam<ShaderType>(type);
173 SCOPED_SHARE_CONTEXT_LOCK(context);
174 bool isCallValid =
175 (context->skipValidation() ||
176 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
177 context->getMutableErrorSetForValidation(),
178 angle::EntryPoint::GLCreateShaderProgramv) &&
179 ValidateCreateShaderProgramv(context, angle::EntryPoint::GLCreateShaderProgramv,
180 typePacked, count, strings)));
181 if (isCallValid)
182 {
183 returnValue = context->createShaderProgramv(typePacked, count, strings);
184 }
185 else
186 {
187 returnValue =
188 GetDefaultReturnValue<angle::EntryPoint::GLCreateShaderProgramv, GLuint>();
189 }
190 ANGLE_CAPTURE_GL(CreateShaderProgramv, isCallValid, context, typePacked, count, strings,
191 returnValue);
192 }
193 else
194 {
195 GenerateContextLostErrorOnCurrentGlobalContext();
196 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLCreateShaderProgramv, GLuint>();
197 }
198 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
199 return returnValue;
200 }
201
GL_DeleteProgramPipelines(GLsizei n,const GLuint * pipelines)202 void GL_APIENTRY GL_DeleteProgramPipelines(GLsizei n, const GLuint *pipelines)
203 {
204 Context *context = GetValidGlobalContext();
205 EVENT(context, GLDeleteProgramPipelines, "context = %d, n = %d, pipelines = 0x%016" PRIxPTR "",
206 CID(context), n, (uintptr_t)pipelines);
207
208 if (context)
209 {
210 const ProgramPipelineID *pipelinesPacked = PackParam<const ProgramPipelineID *>(pipelines);
211 SCOPED_SHARE_CONTEXT_LOCK(context);
212 bool isCallValid =
213 (context->skipValidation() ||
214 ValidateDeleteProgramPipelines(context, angle::EntryPoint::GLDeleteProgramPipelines, n,
215 pipelinesPacked));
216 if (isCallValid)
217 {
218 context->deleteProgramPipelines(n, pipelinesPacked);
219 }
220 ANGLE_CAPTURE_GL(DeleteProgramPipelines, isCallValid, context, n, pipelinesPacked);
221 }
222 else
223 {
224 GenerateContextLostErrorOnCurrentGlobalContext();
225 }
226 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
227 }
228
GL_DispatchCompute(GLuint num_groups_x,GLuint num_groups_y,GLuint num_groups_z)229 void GL_APIENTRY GL_DispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z)
230 {
231 Context *context = GetValidGlobalContext();
232 EVENT(context, GLDispatchCompute,
233 "context = %d, num_groups_x = %u, num_groups_y = %u, num_groups_z = %u", CID(context),
234 num_groups_x, num_groups_y, num_groups_z);
235
236 if (context)
237 {
238 SCOPED_SHARE_CONTEXT_LOCK(context);
239 bool isCallValid =
240 (context->skipValidation() ||
241 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
242 context->getMutableErrorSetForValidation(),
243 angle::EntryPoint::GLDispatchCompute) &&
244 ValidateDispatchCompute(context, angle::EntryPoint::GLDispatchCompute, num_groups_x,
245 num_groups_y, num_groups_z)));
246 if (isCallValid)
247 {
248 context->dispatchCompute(num_groups_x, num_groups_y, num_groups_z);
249 }
250 ANGLE_CAPTURE_GL(DispatchCompute, isCallValid, context, num_groups_x, num_groups_y,
251 num_groups_z);
252 }
253 else
254 {
255 GenerateContextLostErrorOnCurrentGlobalContext();
256 }
257 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
258 }
259
GL_DispatchComputeIndirect(GLintptr indirect)260 void GL_APIENTRY GL_DispatchComputeIndirect(GLintptr indirect)
261 {
262 Context *context = GetValidGlobalContext();
263 EVENT(context, GLDispatchComputeIndirect, "context = %d, indirect = %llu", CID(context),
264 static_cast<unsigned long long>(indirect));
265
266 if (context)
267 {
268 SCOPED_SHARE_CONTEXT_LOCK(context);
269 bool isCallValid = (context->skipValidation() ||
270 ValidateDispatchComputeIndirect(
271 context, angle::EntryPoint::GLDispatchComputeIndirect, indirect));
272 if (isCallValid)
273 {
274 context->dispatchComputeIndirect(indirect);
275 }
276 ANGLE_CAPTURE_GL(DispatchComputeIndirect, isCallValid, context, indirect);
277 }
278 else
279 {
280 GenerateContextLostErrorOnCurrentGlobalContext();
281 }
282 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
283 }
284
GL_DrawArraysIndirect(GLenum mode,const void * indirect)285 void GL_APIENTRY GL_DrawArraysIndirect(GLenum mode, const void *indirect)
286 {
287 Context *context = GetValidGlobalContext();
288 EVENT(context, GLDrawArraysIndirect, "context = %d, mode = %s, indirect = 0x%016" PRIxPTR "",
289 CID(context), GLenumToString(GLESEnum::PrimitiveType, mode), (uintptr_t)indirect);
290
291 if (context)
292 {
293 PrimitiveMode modePacked = PackParam<PrimitiveMode>(mode);
294 SCOPED_SHARE_CONTEXT_LOCK(context);
295 bool isCallValid =
296 (context->skipValidation() ||
297 ValidateDrawArraysIndirect(context, angle::EntryPoint::GLDrawArraysIndirect,
298 modePacked, indirect));
299 if (isCallValid)
300 {
301 context->drawArraysIndirect(modePacked, indirect);
302 }
303 ANGLE_CAPTURE_GL(DrawArraysIndirect, isCallValid, context, modePacked, indirect);
304 }
305 else
306 {
307 GenerateContextLostErrorOnCurrentGlobalContext();
308 }
309 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
310 }
311
GL_DrawElementsIndirect(GLenum mode,GLenum type,const void * indirect)312 void GL_APIENTRY GL_DrawElementsIndirect(GLenum mode, GLenum type, const void *indirect)
313 {
314 Context *context = GetValidGlobalContext();
315 EVENT(context, GLDrawElementsIndirect,
316 "context = %d, mode = %s, type = %s, indirect = 0x%016" PRIxPTR "", CID(context),
317 GLenumToString(GLESEnum::PrimitiveType, mode),
318 GLenumToString(GLESEnum::DrawElementsType, type), (uintptr_t)indirect);
319
320 if (context)
321 {
322 PrimitiveMode modePacked = PackParam<PrimitiveMode>(mode);
323 DrawElementsType typePacked = PackParam<DrawElementsType>(type);
324 SCOPED_SHARE_CONTEXT_LOCK(context);
325 bool isCallValid =
326 (context->skipValidation() ||
327 ValidateDrawElementsIndirect(context, angle::EntryPoint::GLDrawElementsIndirect,
328 modePacked, typePacked, indirect));
329 if (isCallValid)
330 {
331 context->drawElementsIndirect(modePacked, typePacked, indirect);
332 }
333 ANGLE_CAPTURE_GL(DrawElementsIndirect, isCallValid, context, modePacked, typePacked,
334 indirect);
335 }
336 else
337 {
338 GenerateContextLostErrorOnCurrentGlobalContext();
339 }
340 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
341 }
342
GL_FramebufferParameteri(GLenum target,GLenum pname,GLint param)343 void GL_APIENTRY GL_FramebufferParameteri(GLenum target, GLenum pname, GLint param)
344 {
345 Context *context = GetValidGlobalContext();
346 EVENT(context, GLFramebufferParameteri, "context = %d, target = %s, pname = %s, param = %d",
347 CID(context), GLenumToString(GLESEnum::FramebufferTarget, target),
348 GLenumToString(GLESEnum::FramebufferParameterName, pname), param);
349
350 if (context)
351 {
352 SCOPED_SHARE_CONTEXT_LOCK(context);
353 bool isCallValid =
354 (context->skipValidation() ||
355 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
356 context->getMutableErrorSetForValidation(),
357 angle::EntryPoint::GLFramebufferParameteri) &&
358 ValidateFramebufferParameteri(context, angle::EntryPoint::GLFramebufferParameteri,
359 target, pname, param)));
360 if (isCallValid)
361 {
362 context->framebufferParameteri(target, pname, param);
363 }
364 ANGLE_CAPTURE_GL(FramebufferParameteri, isCallValid, context, target, pname, param);
365 }
366 else
367 {
368 GenerateContextLostErrorOnCurrentGlobalContext();
369 }
370 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
371 }
372
GL_GenProgramPipelines(GLsizei n,GLuint * pipelines)373 void GL_APIENTRY GL_GenProgramPipelines(GLsizei n, GLuint *pipelines)
374 {
375 Context *context = GetValidGlobalContext();
376 EVENT(context, GLGenProgramPipelines, "context = %d, n = %d, pipelines = 0x%016" PRIxPTR "",
377 CID(context), n, (uintptr_t)pipelines);
378
379 if (context)
380 {
381 ProgramPipelineID *pipelinesPacked = PackParam<ProgramPipelineID *>(pipelines);
382 SCOPED_SHARE_CONTEXT_LOCK(context);
383 bool isCallValid =
384 (context->skipValidation() ||
385 ValidateGenProgramPipelines(context, angle::EntryPoint::GLGenProgramPipelines, n,
386 pipelinesPacked));
387 if (isCallValid)
388 {
389 context->genProgramPipelines(n, pipelinesPacked);
390 }
391 ANGLE_CAPTURE_GL(GenProgramPipelines, isCallValid, context, n, pipelinesPacked);
392 }
393 else
394 {
395 GenerateContextLostErrorOnCurrentGlobalContext();
396 }
397 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
398 }
399
GL_GetBooleani_v(GLenum target,GLuint index,GLboolean * data)400 void GL_APIENTRY GL_GetBooleani_v(GLenum target, GLuint index, GLboolean *data)
401 {
402 Context *context = GetValidGlobalContext();
403 EVENT(context, GLGetBooleani_v,
404 "context = %d, target = %s, index = %u, data = 0x%016" PRIxPTR "", CID(context),
405 GLenumToString(GLESEnum::BufferTargetARB, target), index, (uintptr_t)data);
406
407 if (context)
408 {
409 SCOPED_SHARE_CONTEXT_LOCK(context);
410 bool isCallValid = (context->skipValidation() ||
411 ValidateGetBooleani_v(context, angle::EntryPoint::GLGetBooleani_v,
412 target, index, data));
413 if (isCallValid)
414 {
415 context->getBooleani_v(target, index, data);
416 }
417 ANGLE_CAPTURE_GL(GetBooleani_v, isCallValid, context, target, index, data);
418 }
419 else
420 {
421 GenerateContextLostErrorOnCurrentGlobalContext();
422 }
423 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
424 }
425
GL_GetFramebufferParameteriv(GLenum target,GLenum pname,GLint * params)426 void GL_APIENTRY GL_GetFramebufferParameteriv(GLenum target, GLenum pname, GLint *params)
427 {
428 Context *context = GetValidGlobalContext();
429 EVENT(context, GLGetFramebufferParameteriv,
430 "context = %d, target = %s, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
431 GLenumToString(GLESEnum::FramebufferTarget, target),
432 GLenumToString(GLESEnum::FramebufferAttachmentParameterName, pname), (uintptr_t)params);
433
434 if (context)
435 {
436 SCOPED_SHARE_CONTEXT_LOCK(context);
437 bool isCallValid =
438 (context->skipValidation() ||
439 ValidateGetFramebufferParameteriv(
440 context, angle::EntryPoint::GLGetFramebufferParameteriv, target, pname, params));
441 if (isCallValid)
442 {
443 context->getFramebufferParameteriv(target, pname, params);
444 }
445 ANGLE_CAPTURE_GL(GetFramebufferParameteriv, isCallValid, context, target, pname, params);
446 }
447 else
448 {
449 GenerateContextLostErrorOnCurrentGlobalContext();
450 }
451 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
452 }
453
GL_GetMultisamplefv(GLenum pname,GLuint index,GLfloat * val)454 void GL_APIENTRY GL_GetMultisamplefv(GLenum pname, GLuint index, GLfloat *val)
455 {
456 Context *context = GetValidGlobalContext();
457 EVENT(context, GLGetMultisamplefv,
458 "context = %d, pname = %s, index = %u, val = 0x%016" PRIxPTR "", CID(context),
459 GLenumToString(GLESEnum::AllEnums, pname), index, (uintptr_t)val);
460
461 if (context)
462 {
463 SCOPED_SHARE_CONTEXT_LOCK(context);
464 bool isCallValid = (context->skipValidation() ||
465 ValidateGetMultisamplefv(context, angle::EntryPoint::GLGetMultisamplefv,
466 pname, index, val));
467 if (isCallValid)
468 {
469 context->getMultisamplefv(pname, index, val);
470 }
471 ANGLE_CAPTURE_GL(GetMultisamplefv, isCallValid, context, pname, index, val);
472 }
473 else
474 {
475 GenerateContextLostErrorOnCurrentGlobalContext();
476 }
477 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
478 }
479
GL_GetProgramInterfaceiv(GLuint program,GLenum programInterface,GLenum pname,GLint * params)480 void GL_APIENTRY GL_GetProgramInterfaceiv(GLuint program,
481 GLenum programInterface,
482 GLenum pname,
483 GLint *params)
484 {
485 Context *context = GetValidGlobalContext();
486 EVENT(context, GLGetProgramInterfaceiv,
487 "context = %d, program = %u, programInterface = %s, pname = %s, params = 0x%016" PRIxPTR
488 "",
489 CID(context), program, GLenumToString(GLESEnum::ProgramInterface, programInterface),
490 GLenumToString(GLESEnum::ProgramInterfacePName, pname), (uintptr_t)params);
491
492 if (context)
493 {
494 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
495 SCOPED_SHARE_CONTEXT_LOCK(context);
496 bool isCallValid =
497 (context->skipValidation() ||
498 ValidateGetProgramInterfaceiv(context, angle::EntryPoint::GLGetProgramInterfaceiv,
499 programPacked, programInterface, pname, params));
500 if (isCallValid)
501 {
502 context->getProgramInterfaceiv(programPacked, programInterface, pname, params);
503 }
504 ANGLE_CAPTURE_GL(GetProgramInterfaceiv, isCallValid, context, programPacked,
505 programInterface, pname, params);
506 }
507 else
508 {
509 GenerateContextLostErrorOnCurrentGlobalContext();
510 }
511 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
512 }
513
GL_GetProgramPipelineInfoLog(GLuint pipeline,GLsizei bufSize,GLsizei * length,GLchar * infoLog)514 void GL_APIENTRY GL_GetProgramPipelineInfoLog(GLuint pipeline,
515 GLsizei bufSize,
516 GLsizei *length,
517 GLchar *infoLog)
518 {
519 Context *context = GetValidGlobalContext();
520 EVENT(context, GLGetProgramPipelineInfoLog,
521 "context = %d, pipeline = %u, bufSize = %d, length = 0x%016" PRIxPTR
522 ", infoLog = 0x%016" PRIxPTR "",
523 CID(context), pipeline, bufSize, (uintptr_t)length, (uintptr_t)infoLog);
524
525 if (context)
526 {
527 ProgramPipelineID pipelinePacked = PackParam<ProgramPipelineID>(pipeline);
528 SCOPED_SHARE_CONTEXT_LOCK(context);
529 bool isCallValid = (context->skipValidation() ||
530 ValidateGetProgramPipelineInfoLog(
531 context, angle::EntryPoint::GLGetProgramPipelineInfoLog,
532 pipelinePacked, bufSize, length, infoLog));
533 if (isCallValid)
534 {
535 context->getProgramPipelineInfoLog(pipelinePacked, bufSize, length, infoLog);
536 }
537 ANGLE_CAPTURE_GL(GetProgramPipelineInfoLog, isCallValid, context, pipelinePacked, bufSize,
538 length, infoLog);
539 }
540 else
541 {
542 GenerateContextLostErrorOnCurrentGlobalContext();
543 }
544 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
545 }
546
GL_GetProgramPipelineiv(GLuint pipeline,GLenum pname,GLint * params)547 void GL_APIENTRY GL_GetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params)
548 {
549 Context *context = GetValidGlobalContext();
550 EVENT(context, GLGetProgramPipelineiv,
551 "context = %d, pipeline = %u, pname = %s, params = 0x%016" PRIxPTR "", CID(context),
552 pipeline, GLenumToString(GLESEnum::PipelineParameterName, pname), (uintptr_t)params);
553
554 if (context)
555 {
556 ProgramPipelineID pipelinePacked = PackParam<ProgramPipelineID>(pipeline);
557 SCOPED_SHARE_CONTEXT_LOCK(context);
558 bool isCallValid =
559 (context->skipValidation() ||
560 ValidateGetProgramPipelineiv(context, angle::EntryPoint::GLGetProgramPipelineiv,
561 pipelinePacked, pname, params));
562 if (isCallValid)
563 {
564 context->getProgramPipelineiv(pipelinePacked, pname, params);
565 }
566 ANGLE_CAPTURE_GL(GetProgramPipelineiv, isCallValid, context, pipelinePacked, pname, params);
567 }
568 else
569 {
570 GenerateContextLostErrorOnCurrentGlobalContext();
571 }
572 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
573 }
574
GL_GetProgramResourceIndex(GLuint program,GLenum programInterface,const GLchar * name)575 GLuint GL_APIENTRY GL_GetProgramResourceIndex(GLuint program,
576 GLenum programInterface,
577 const GLchar *name)
578 {
579 Context *context = GetValidGlobalContext();
580 EVENT(context, GLGetProgramResourceIndex,
581 "context = %d, program = %u, programInterface = %s, name = 0x%016" PRIxPTR "",
582 CID(context), program, GLenumToString(GLESEnum::ProgramInterface, programInterface),
583 (uintptr_t)name);
584
585 GLuint returnValue;
586 if (context)
587 {
588 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
589 SCOPED_SHARE_CONTEXT_LOCK(context);
590 bool isCallValid =
591 (context->skipValidation() ||
592 ValidateGetProgramResourceIndex(context, angle::EntryPoint::GLGetProgramResourceIndex,
593 programPacked, programInterface, name));
594 if (isCallValid)
595 {
596 returnValue = context->getProgramResourceIndex(programPacked, programInterface, name);
597 }
598 else
599 {
600 returnValue =
601 GetDefaultReturnValue<angle::EntryPoint::GLGetProgramResourceIndex, GLuint>();
602 }
603 ANGLE_CAPTURE_GL(GetProgramResourceIndex, isCallValid, context, programPacked,
604 programInterface, name, returnValue);
605 }
606 else
607 {
608 GenerateContextLostErrorOnCurrentGlobalContext();
609 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLGetProgramResourceIndex, GLuint>();
610 }
611 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
612 return returnValue;
613 }
614
GL_GetProgramResourceLocation(GLuint program,GLenum programInterface,const GLchar * name)615 GLint GL_APIENTRY GL_GetProgramResourceLocation(GLuint program,
616 GLenum programInterface,
617 const GLchar *name)
618 {
619 Context *context = GetValidGlobalContext();
620 EVENT(context, GLGetProgramResourceLocation,
621 "context = %d, program = %u, programInterface = %s, name = 0x%016" PRIxPTR "",
622 CID(context), program, GLenumToString(GLESEnum::ProgramInterface, programInterface),
623 (uintptr_t)name);
624
625 GLint returnValue;
626 if (context)
627 {
628 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
629 SCOPED_SHARE_CONTEXT_LOCK(context);
630 bool isCallValid = (context->skipValidation() ||
631 ValidateGetProgramResourceLocation(
632 context, angle::EntryPoint::GLGetProgramResourceLocation,
633 programPacked, programInterface, name));
634 if (isCallValid)
635 {
636 returnValue =
637 context->getProgramResourceLocation(programPacked, programInterface, name);
638 }
639 else
640 {
641 returnValue =
642 GetDefaultReturnValue<angle::EntryPoint::GLGetProgramResourceLocation, GLint>();
643 }
644 ANGLE_CAPTURE_GL(GetProgramResourceLocation, isCallValid, context, programPacked,
645 programInterface, name, returnValue);
646 }
647 else
648 {
649 GenerateContextLostErrorOnCurrentGlobalContext();
650 returnValue =
651 GetDefaultReturnValue<angle::EntryPoint::GLGetProgramResourceLocation, GLint>();
652 }
653 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
654 return returnValue;
655 }
656
GL_GetProgramResourceName(GLuint program,GLenum programInterface,GLuint index,GLsizei bufSize,GLsizei * length,GLchar * name)657 void GL_APIENTRY GL_GetProgramResourceName(GLuint program,
658 GLenum programInterface,
659 GLuint index,
660 GLsizei bufSize,
661 GLsizei *length,
662 GLchar *name)
663 {
664 Context *context = GetValidGlobalContext();
665 EVENT(context, GLGetProgramResourceName,
666 "context = %d, program = %u, programInterface = %s, index = %u, bufSize = %d, length = "
667 "0x%016" PRIxPTR ", name = 0x%016" PRIxPTR "",
668 CID(context), program, GLenumToString(GLESEnum::ProgramInterface, programInterface),
669 index, bufSize, (uintptr_t)length, (uintptr_t)name);
670
671 if (context)
672 {
673 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
674 SCOPED_SHARE_CONTEXT_LOCK(context);
675 bool isCallValid = (context->skipValidation() ||
676 ValidateGetProgramResourceName(
677 context, angle::EntryPoint::GLGetProgramResourceName, programPacked,
678 programInterface, index, bufSize, length, name));
679 if (isCallValid)
680 {
681 context->getProgramResourceName(programPacked, programInterface, index, bufSize, length,
682 name);
683 }
684 ANGLE_CAPTURE_GL(GetProgramResourceName, isCallValid, context, programPacked,
685 programInterface, index, bufSize, length, name);
686 }
687 else
688 {
689 GenerateContextLostErrorOnCurrentGlobalContext();
690 }
691 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
692 }
693
GL_GetProgramResourceiv(GLuint program,GLenum programInterface,GLuint index,GLsizei propCount,const GLenum * props,GLsizei count,GLsizei * length,GLint * params)694 void GL_APIENTRY GL_GetProgramResourceiv(GLuint program,
695 GLenum programInterface,
696 GLuint index,
697 GLsizei propCount,
698 const GLenum *props,
699 GLsizei count,
700 GLsizei *length,
701 GLint *params)
702 {
703 Context *context = GetValidGlobalContext();
704 EVENT(context, GLGetProgramResourceiv,
705 "context = %d, program = %u, programInterface = %s, index = %u, propCount = %d, props = "
706 "0x%016" PRIxPTR ", count = %d, length = 0x%016" PRIxPTR ", params = 0x%016" PRIxPTR "",
707 CID(context), program, GLenumToString(GLESEnum::ProgramInterface, programInterface),
708 index, propCount, (uintptr_t)props, count, (uintptr_t)length, (uintptr_t)params);
709
710 if (context)
711 {
712 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
713 SCOPED_SHARE_CONTEXT_LOCK(context);
714 bool isCallValid = (context->skipValidation() ||
715 ValidateGetProgramResourceiv(
716 context, angle::EntryPoint::GLGetProgramResourceiv, programPacked,
717 programInterface, index, propCount, props, count, length, params));
718 if (isCallValid)
719 {
720 context->getProgramResourceiv(programPacked, programInterface, index, propCount, props,
721 count, length, params);
722 }
723 ANGLE_CAPTURE_GL(GetProgramResourceiv, isCallValid, context, programPacked,
724 programInterface, index, propCount, props, count, length, params);
725 }
726 else
727 {
728 GenerateContextLostErrorOnCurrentGlobalContext();
729 }
730 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
731 }
732
GL_GetTexLevelParameterfv(GLenum target,GLint level,GLenum pname,GLfloat * params)733 void GL_APIENTRY GL_GetTexLevelParameterfv(GLenum target,
734 GLint level,
735 GLenum pname,
736 GLfloat *params)
737 {
738 Context *context = GetValidGlobalContext();
739 EVENT(context, GLGetTexLevelParameterfv,
740 "context = %d, target = %s, level = %d, pname = %s, params = 0x%016" PRIxPTR "",
741 CID(context), GLenumToString(GLESEnum::TextureTarget, target), level,
742 GLenumToString(GLESEnum::GetTextureParameter, pname), (uintptr_t)params);
743
744 if (context)
745 {
746 TextureTarget targetPacked = PackParam<TextureTarget>(target);
747 SCOPED_SHARE_CONTEXT_LOCK(context);
748 bool isCallValid =
749 (context->skipValidation() ||
750 ValidateGetTexLevelParameterfv(context, angle::EntryPoint::GLGetTexLevelParameterfv,
751 targetPacked, level, pname, params));
752 if (isCallValid)
753 {
754 context->getTexLevelParameterfv(targetPacked, level, pname, params);
755 }
756 ANGLE_CAPTURE_GL(GetTexLevelParameterfv, isCallValid, context, targetPacked, level, pname,
757 params);
758 }
759 else
760 {
761 GenerateContextLostErrorOnCurrentGlobalContext();
762 }
763 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
764 }
765
GL_GetTexLevelParameteriv(GLenum target,GLint level,GLenum pname,GLint * params)766 void GL_APIENTRY GL_GetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params)
767 {
768 Context *context = GetValidGlobalContext();
769 EVENT(context, GLGetTexLevelParameteriv,
770 "context = %d, target = %s, level = %d, pname = %s, params = 0x%016" PRIxPTR "",
771 CID(context), GLenumToString(GLESEnum::TextureTarget, target), level,
772 GLenumToString(GLESEnum::GetTextureParameter, pname), (uintptr_t)params);
773
774 if (context)
775 {
776 TextureTarget targetPacked = PackParam<TextureTarget>(target);
777 SCOPED_SHARE_CONTEXT_LOCK(context);
778 bool isCallValid =
779 (context->skipValidation() ||
780 ValidateGetTexLevelParameteriv(context, angle::EntryPoint::GLGetTexLevelParameteriv,
781 targetPacked, level, pname, params));
782 if (isCallValid)
783 {
784 context->getTexLevelParameteriv(targetPacked, level, pname, params);
785 }
786 ANGLE_CAPTURE_GL(GetTexLevelParameteriv, isCallValid, context, targetPacked, level, pname,
787 params);
788 }
789 else
790 {
791 GenerateContextLostErrorOnCurrentGlobalContext();
792 }
793 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
794 }
795
GL_IsProgramPipeline(GLuint pipeline)796 GLboolean GL_APIENTRY GL_IsProgramPipeline(GLuint pipeline)
797 {
798 Context *context = GetValidGlobalContext();
799 EVENT(context, GLIsProgramPipeline, "context = %d, pipeline = %u", CID(context), pipeline);
800
801 GLboolean returnValue;
802 if (context)
803 {
804 ProgramPipelineID pipelinePacked = PackParam<ProgramPipelineID>(pipeline);
805 SCOPED_SHARE_CONTEXT_LOCK(context);
806 bool isCallValid = (context->skipValidation() ||
807 ValidateIsProgramPipeline(
808 context, angle::EntryPoint::GLIsProgramPipeline, pipelinePacked));
809 if (isCallValid)
810 {
811 returnValue = context->isProgramPipeline(pipelinePacked);
812 }
813 else
814 {
815 returnValue =
816 GetDefaultReturnValue<angle::EntryPoint::GLIsProgramPipeline, GLboolean>();
817 }
818 ANGLE_CAPTURE_GL(IsProgramPipeline, isCallValid, context, pipelinePacked, returnValue);
819 }
820 else
821 {
822 GenerateContextLostErrorOnCurrentGlobalContext();
823 returnValue = GetDefaultReturnValue<angle::EntryPoint::GLIsProgramPipeline, GLboolean>();
824 }
825 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
826 return returnValue;
827 }
828
GL_MemoryBarrier(GLbitfield barriers)829 void GL_APIENTRY GL_MemoryBarrier(GLbitfield barriers)
830 {
831 Context *context = GetValidGlobalContext();
832 EVENT(context, GLMemoryBarrier, "context = %d, barriers = %s", CID(context),
833 GLbitfieldToString(GLESEnum::MemoryBarrierMask, barriers).c_str());
834
835 if (context)
836 {
837 SCOPED_SHARE_CONTEXT_LOCK(context);
838 bool isCallValid =
839 (context->skipValidation() ||
840 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
841 context->getMutableErrorSetForValidation(),
842 angle::EntryPoint::GLMemoryBarrier) &&
843 ValidateMemoryBarrier(context, angle::EntryPoint::GLMemoryBarrier, barriers)));
844 if (isCallValid)
845 {
846 context->memoryBarrier(barriers);
847 }
848 ANGLE_CAPTURE_GL(MemoryBarrier, isCallValid, context, barriers);
849 }
850 else
851 {
852 GenerateContextLostErrorOnCurrentGlobalContext();
853 }
854 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
855 }
856
GL_MemoryBarrierByRegion(GLbitfield barriers)857 void GL_APIENTRY GL_MemoryBarrierByRegion(GLbitfield barriers)
858 {
859 Context *context = GetValidGlobalContext();
860 EVENT(context, GLMemoryBarrierByRegion, "context = %d, barriers = %s", CID(context),
861 GLbitfieldToString(GLESEnum::MemoryBarrierMask, barriers).c_str());
862
863 if (context)
864 {
865 SCOPED_SHARE_CONTEXT_LOCK(context);
866 bool isCallValid =
867 (context->skipValidation() ||
868 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
869 context->getMutableErrorSetForValidation(),
870 angle::EntryPoint::GLMemoryBarrierByRegion) &&
871 ValidateMemoryBarrierByRegion(context, angle::EntryPoint::GLMemoryBarrierByRegion,
872 barriers)));
873 if (isCallValid)
874 {
875 context->memoryBarrierByRegion(barriers);
876 }
877 ANGLE_CAPTURE_GL(MemoryBarrierByRegion, isCallValid, context, barriers);
878 }
879 else
880 {
881 GenerateContextLostErrorOnCurrentGlobalContext();
882 }
883 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
884 }
885
GL_ProgramUniform1f(GLuint program,GLint location,GLfloat v0)886 void GL_APIENTRY GL_ProgramUniform1f(GLuint program, GLint location, GLfloat v0)
887 {
888 Context *context = GetValidGlobalContext();
889 EVENT(context, GLProgramUniform1f, "context = %d, program = %u, location = %d, v0 = %f",
890 CID(context), program, location, v0);
891
892 if (context)
893 {
894 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
895 UniformLocation locationPacked = PackParam<UniformLocation>(location);
896 SCOPED_SHARE_CONTEXT_LOCK(context);
897 bool isCallValid =
898 (context->skipValidation() ||
899 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
900 context->getMutableErrorSetForValidation(),
901 angle::EntryPoint::GLProgramUniform1f) &&
902 ValidateProgramUniform1f(context, angle::EntryPoint::GLProgramUniform1f,
903 programPacked, locationPacked, v0)));
904 if (isCallValid)
905 {
906 context->programUniform1f(programPacked, locationPacked, v0);
907 }
908 ANGLE_CAPTURE_GL(ProgramUniform1f, isCallValid, context, programPacked, locationPacked, v0);
909 }
910 else
911 {
912 GenerateContextLostErrorOnCurrentGlobalContext();
913 }
914 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
915 }
916
GL_ProgramUniform1fv(GLuint program,GLint location,GLsizei count,const GLfloat * value)917 void GL_APIENTRY GL_ProgramUniform1fv(GLuint program,
918 GLint location,
919 GLsizei count,
920 const GLfloat *value)
921 {
922 Context *context = GetValidGlobalContext();
923 EVENT(context, GLProgramUniform1fv,
924 "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
925 CID(context), program, location, count, (uintptr_t)value);
926
927 if (context)
928 {
929 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
930 UniformLocation locationPacked = PackParam<UniformLocation>(location);
931 SCOPED_SHARE_CONTEXT_LOCK(context);
932 bool isCallValid =
933 (context->skipValidation() ||
934 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
935 context->getMutableErrorSetForValidation(),
936 angle::EntryPoint::GLProgramUniform1fv) &&
937 ValidateProgramUniform1fv(context, angle::EntryPoint::GLProgramUniform1fv,
938 programPacked, locationPacked, count, value)));
939 if (isCallValid)
940 {
941 context->programUniform1fv(programPacked, locationPacked, count, value);
942 }
943 ANGLE_CAPTURE_GL(ProgramUniform1fv, isCallValid, context, programPacked, locationPacked,
944 count, value);
945 }
946 else
947 {
948 GenerateContextLostErrorOnCurrentGlobalContext();
949 }
950 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
951 }
952
GL_ProgramUniform1i(GLuint program,GLint location,GLint v0)953 void GL_APIENTRY GL_ProgramUniform1i(GLuint program, GLint location, GLint v0)
954 {
955 Context *context = GetValidGlobalContext();
956 EVENT(context, GLProgramUniform1i, "context = %d, program = %u, location = %d, v0 = %d",
957 CID(context), program, location, v0);
958
959 if (context)
960 {
961 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
962 UniformLocation locationPacked = PackParam<UniformLocation>(location);
963 SCOPED_SHARE_CONTEXT_LOCK(context);
964 bool isCallValid =
965 (context->skipValidation() ||
966 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
967 context->getMutableErrorSetForValidation(),
968 angle::EntryPoint::GLProgramUniform1i) &&
969 ValidateProgramUniform1i(context, angle::EntryPoint::GLProgramUniform1i,
970 programPacked, locationPacked, v0)));
971 if (isCallValid)
972 {
973 context->programUniform1i(programPacked, locationPacked, v0);
974 }
975 ANGLE_CAPTURE_GL(ProgramUniform1i, isCallValid, context, programPacked, locationPacked, v0);
976 }
977 else
978 {
979 GenerateContextLostErrorOnCurrentGlobalContext();
980 }
981 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
982 }
983
GL_ProgramUniform1iv(GLuint program,GLint location,GLsizei count,const GLint * value)984 void GL_APIENTRY GL_ProgramUniform1iv(GLuint program,
985 GLint location,
986 GLsizei count,
987 const GLint *value)
988 {
989 Context *context = GetValidGlobalContext();
990 EVENT(context, GLProgramUniform1iv,
991 "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
992 CID(context), program, location, count, (uintptr_t)value);
993
994 if (context)
995 {
996 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
997 UniformLocation locationPacked = PackParam<UniformLocation>(location);
998 SCOPED_SHARE_CONTEXT_LOCK(context);
999 bool isCallValid =
1000 (context->skipValidation() ||
1001 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1002 context->getMutableErrorSetForValidation(),
1003 angle::EntryPoint::GLProgramUniform1iv) &&
1004 ValidateProgramUniform1iv(context, angle::EntryPoint::GLProgramUniform1iv,
1005 programPacked, locationPacked, count, value)));
1006 if (isCallValid)
1007 {
1008 context->programUniform1iv(programPacked, locationPacked, count, value);
1009 }
1010 ANGLE_CAPTURE_GL(ProgramUniform1iv, isCallValid, context, programPacked, locationPacked,
1011 count, value);
1012 }
1013 else
1014 {
1015 GenerateContextLostErrorOnCurrentGlobalContext();
1016 }
1017 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1018 }
1019
GL_ProgramUniform1ui(GLuint program,GLint location,GLuint v0)1020 void GL_APIENTRY GL_ProgramUniform1ui(GLuint program, GLint location, GLuint v0)
1021 {
1022 Context *context = GetValidGlobalContext();
1023 EVENT(context, GLProgramUniform1ui, "context = %d, program = %u, location = %d, v0 = %u",
1024 CID(context), program, location, v0);
1025
1026 if (context)
1027 {
1028 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1029 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1030 SCOPED_SHARE_CONTEXT_LOCK(context);
1031 bool isCallValid =
1032 (context->skipValidation() ||
1033 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1034 context->getMutableErrorSetForValidation(),
1035 angle::EntryPoint::GLProgramUniform1ui) &&
1036 ValidateProgramUniform1ui(context, angle::EntryPoint::GLProgramUniform1ui,
1037 programPacked, locationPacked, v0)));
1038 if (isCallValid)
1039 {
1040 context->programUniform1ui(programPacked, locationPacked, v0);
1041 }
1042 ANGLE_CAPTURE_GL(ProgramUniform1ui, isCallValid, context, programPacked, locationPacked,
1043 v0);
1044 }
1045 else
1046 {
1047 GenerateContextLostErrorOnCurrentGlobalContext();
1048 }
1049 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1050 }
1051
GL_ProgramUniform1uiv(GLuint program,GLint location,GLsizei count,const GLuint * value)1052 void GL_APIENTRY GL_ProgramUniform1uiv(GLuint program,
1053 GLint location,
1054 GLsizei count,
1055 const GLuint *value)
1056 {
1057 Context *context = GetValidGlobalContext();
1058 EVENT(context, GLProgramUniform1uiv,
1059 "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
1060 CID(context), program, location, count, (uintptr_t)value);
1061
1062 if (context)
1063 {
1064 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1065 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1066 SCOPED_SHARE_CONTEXT_LOCK(context);
1067 bool isCallValid =
1068 (context->skipValidation() ||
1069 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1070 context->getMutableErrorSetForValidation(),
1071 angle::EntryPoint::GLProgramUniform1uiv) &&
1072 ValidateProgramUniform1uiv(context, angle::EntryPoint::GLProgramUniform1uiv,
1073 programPacked, locationPacked, count, value)));
1074 if (isCallValid)
1075 {
1076 context->programUniform1uiv(programPacked, locationPacked, count, value);
1077 }
1078 ANGLE_CAPTURE_GL(ProgramUniform1uiv, isCallValid, context, programPacked, locationPacked,
1079 count, value);
1080 }
1081 else
1082 {
1083 GenerateContextLostErrorOnCurrentGlobalContext();
1084 }
1085 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1086 }
1087
GL_ProgramUniform2f(GLuint program,GLint location,GLfloat v0,GLfloat v1)1088 void GL_APIENTRY GL_ProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1)
1089 {
1090 Context *context = GetValidGlobalContext();
1091 EVENT(context, GLProgramUniform2f,
1092 "context = %d, program = %u, location = %d, v0 = %f, v1 = %f", CID(context), program,
1093 location, v0, v1);
1094
1095 if (context)
1096 {
1097 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1098 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1099 SCOPED_SHARE_CONTEXT_LOCK(context);
1100 bool isCallValid =
1101 (context->skipValidation() ||
1102 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1103 context->getMutableErrorSetForValidation(),
1104 angle::EntryPoint::GLProgramUniform2f) &&
1105 ValidateProgramUniform2f(context, angle::EntryPoint::GLProgramUniform2f,
1106 programPacked, locationPacked, v0, v1)));
1107 if (isCallValid)
1108 {
1109 context->programUniform2f(programPacked, locationPacked, v0, v1);
1110 }
1111 ANGLE_CAPTURE_GL(ProgramUniform2f, isCallValid, context, programPacked, locationPacked, v0,
1112 v1);
1113 }
1114 else
1115 {
1116 GenerateContextLostErrorOnCurrentGlobalContext();
1117 }
1118 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1119 }
1120
GL_ProgramUniform2fv(GLuint program,GLint location,GLsizei count,const GLfloat * value)1121 void GL_APIENTRY GL_ProgramUniform2fv(GLuint program,
1122 GLint location,
1123 GLsizei count,
1124 const GLfloat *value)
1125 {
1126 Context *context = GetValidGlobalContext();
1127 EVENT(context, GLProgramUniform2fv,
1128 "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
1129 CID(context), program, location, count, (uintptr_t)value);
1130
1131 if (context)
1132 {
1133 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1134 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1135 SCOPED_SHARE_CONTEXT_LOCK(context);
1136 bool isCallValid =
1137 (context->skipValidation() ||
1138 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1139 context->getMutableErrorSetForValidation(),
1140 angle::EntryPoint::GLProgramUniform2fv) &&
1141 ValidateProgramUniform2fv(context, angle::EntryPoint::GLProgramUniform2fv,
1142 programPacked, locationPacked, count, value)));
1143 if (isCallValid)
1144 {
1145 context->programUniform2fv(programPacked, locationPacked, count, value);
1146 }
1147 ANGLE_CAPTURE_GL(ProgramUniform2fv, isCallValid, context, programPacked, locationPacked,
1148 count, value);
1149 }
1150 else
1151 {
1152 GenerateContextLostErrorOnCurrentGlobalContext();
1153 }
1154 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1155 }
1156
GL_ProgramUniform2i(GLuint program,GLint location,GLint v0,GLint v1)1157 void GL_APIENTRY GL_ProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1)
1158 {
1159 Context *context = GetValidGlobalContext();
1160 EVENT(context, GLProgramUniform2i,
1161 "context = %d, program = %u, location = %d, v0 = %d, v1 = %d", CID(context), program,
1162 location, v0, v1);
1163
1164 if (context)
1165 {
1166 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1167 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1168 SCOPED_SHARE_CONTEXT_LOCK(context);
1169 bool isCallValid =
1170 (context->skipValidation() ||
1171 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1172 context->getMutableErrorSetForValidation(),
1173 angle::EntryPoint::GLProgramUniform2i) &&
1174 ValidateProgramUniform2i(context, angle::EntryPoint::GLProgramUniform2i,
1175 programPacked, locationPacked, v0, v1)));
1176 if (isCallValid)
1177 {
1178 context->programUniform2i(programPacked, locationPacked, v0, v1);
1179 }
1180 ANGLE_CAPTURE_GL(ProgramUniform2i, isCallValid, context, programPacked, locationPacked, v0,
1181 v1);
1182 }
1183 else
1184 {
1185 GenerateContextLostErrorOnCurrentGlobalContext();
1186 }
1187 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1188 }
1189
GL_ProgramUniform2iv(GLuint program,GLint location,GLsizei count,const GLint * value)1190 void GL_APIENTRY GL_ProgramUniform2iv(GLuint program,
1191 GLint location,
1192 GLsizei count,
1193 const GLint *value)
1194 {
1195 Context *context = GetValidGlobalContext();
1196 EVENT(context, GLProgramUniform2iv,
1197 "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
1198 CID(context), program, location, count, (uintptr_t)value);
1199
1200 if (context)
1201 {
1202 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1203 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1204 SCOPED_SHARE_CONTEXT_LOCK(context);
1205 bool isCallValid =
1206 (context->skipValidation() ||
1207 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1208 context->getMutableErrorSetForValidation(),
1209 angle::EntryPoint::GLProgramUniform2iv) &&
1210 ValidateProgramUniform2iv(context, angle::EntryPoint::GLProgramUniform2iv,
1211 programPacked, locationPacked, count, value)));
1212 if (isCallValid)
1213 {
1214 context->programUniform2iv(programPacked, locationPacked, count, value);
1215 }
1216 ANGLE_CAPTURE_GL(ProgramUniform2iv, isCallValid, context, programPacked, locationPacked,
1217 count, value);
1218 }
1219 else
1220 {
1221 GenerateContextLostErrorOnCurrentGlobalContext();
1222 }
1223 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1224 }
1225
GL_ProgramUniform2ui(GLuint program,GLint location,GLuint v0,GLuint v1)1226 void GL_APIENTRY GL_ProgramUniform2ui(GLuint program, GLint location, GLuint v0, GLuint v1)
1227 {
1228 Context *context = GetValidGlobalContext();
1229 EVENT(context, GLProgramUniform2ui,
1230 "context = %d, program = %u, location = %d, v0 = %u, v1 = %u", CID(context), program,
1231 location, v0, v1);
1232
1233 if (context)
1234 {
1235 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1236 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1237 SCOPED_SHARE_CONTEXT_LOCK(context);
1238 bool isCallValid =
1239 (context->skipValidation() ||
1240 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1241 context->getMutableErrorSetForValidation(),
1242 angle::EntryPoint::GLProgramUniform2ui) &&
1243 ValidateProgramUniform2ui(context, angle::EntryPoint::GLProgramUniform2ui,
1244 programPacked, locationPacked, v0, v1)));
1245 if (isCallValid)
1246 {
1247 context->programUniform2ui(programPacked, locationPacked, v0, v1);
1248 }
1249 ANGLE_CAPTURE_GL(ProgramUniform2ui, isCallValid, context, programPacked, locationPacked, v0,
1250 v1);
1251 }
1252 else
1253 {
1254 GenerateContextLostErrorOnCurrentGlobalContext();
1255 }
1256 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1257 }
1258
GL_ProgramUniform2uiv(GLuint program,GLint location,GLsizei count,const GLuint * value)1259 void GL_APIENTRY GL_ProgramUniform2uiv(GLuint program,
1260 GLint location,
1261 GLsizei count,
1262 const GLuint *value)
1263 {
1264 Context *context = GetValidGlobalContext();
1265 EVENT(context, GLProgramUniform2uiv,
1266 "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
1267 CID(context), program, location, count, (uintptr_t)value);
1268
1269 if (context)
1270 {
1271 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1272 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1273 SCOPED_SHARE_CONTEXT_LOCK(context);
1274 bool isCallValid =
1275 (context->skipValidation() ||
1276 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1277 context->getMutableErrorSetForValidation(),
1278 angle::EntryPoint::GLProgramUniform2uiv) &&
1279 ValidateProgramUniform2uiv(context, angle::EntryPoint::GLProgramUniform2uiv,
1280 programPacked, locationPacked, count, value)));
1281 if (isCallValid)
1282 {
1283 context->programUniform2uiv(programPacked, locationPacked, count, value);
1284 }
1285 ANGLE_CAPTURE_GL(ProgramUniform2uiv, isCallValid, context, programPacked, locationPacked,
1286 count, value);
1287 }
1288 else
1289 {
1290 GenerateContextLostErrorOnCurrentGlobalContext();
1291 }
1292 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1293 }
1294
1295 void GL_APIENTRY
GL_ProgramUniform3f(GLuint program,GLint location,GLfloat v0,GLfloat v1,GLfloat v2)1296 GL_ProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
1297 {
1298 Context *context = GetValidGlobalContext();
1299 EVENT(context, GLProgramUniform3f,
1300 "context = %d, program = %u, location = %d, v0 = %f, v1 = %f, v2 = %f", CID(context),
1301 program, location, v0, v1, v2);
1302
1303 if (context)
1304 {
1305 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1306 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1307 SCOPED_SHARE_CONTEXT_LOCK(context);
1308 bool isCallValid =
1309 (context->skipValidation() ||
1310 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1311 context->getMutableErrorSetForValidation(),
1312 angle::EntryPoint::GLProgramUniform3f) &&
1313 ValidateProgramUniform3f(context, angle::EntryPoint::GLProgramUniform3f,
1314 programPacked, locationPacked, v0, v1, v2)));
1315 if (isCallValid)
1316 {
1317 context->programUniform3f(programPacked, locationPacked, v0, v1, v2);
1318 }
1319 ANGLE_CAPTURE_GL(ProgramUniform3f, isCallValid, context, programPacked, locationPacked, v0,
1320 v1, v2);
1321 }
1322 else
1323 {
1324 GenerateContextLostErrorOnCurrentGlobalContext();
1325 }
1326 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1327 }
1328
GL_ProgramUniform3fv(GLuint program,GLint location,GLsizei count,const GLfloat * value)1329 void GL_APIENTRY GL_ProgramUniform3fv(GLuint program,
1330 GLint location,
1331 GLsizei count,
1332 const GLfloat *value)
1333 {
1334 Context *context = GetValidGlobalContext();
1335 EVENT(context, GLProgramUniform3fv,
1336 "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
1337 CID(context), program, location, count, (uintptr_t)value);
1338
1339 if (context)
1340 {
1341 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1342 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1343 SCOPED_SHARE_CONTEXT_LOCK(context);
1344 bool isCallValid =
1345 (context->skipValidation() ||
1346 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1347 context->getMutableErrorSetForValidation(),
1348 angle::EntryPoint::GLProgramUniform3fv) &&
1349 ValidateProgramUniform3fv(context, angle::EntryPoint::GLProgramUniform3fv,
1350 programPacked, locationPacked, count, value)));
1351 if (isCallValid)
1352 {
1353 context->programUniform3fv(programPacked, locationPacked, count, value);
1354 }
1355 ANGLE_CAPTURE_GL(ProgramUniform3fv, isCallValid, context, programPacked, locationPacked,
1356 count, value);
1357 }
1358 else
1359 {
1360 GenerateContextLostErrorOnCurrentGlobalContext();
1361 }
1362 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1363 }
1364
GL_ProgramUniform3i(GLuint program,GLint location,GLint v0,GLint v1,GLint v2)1365 void GL_APIENTRY GL_ProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2)
1366 {
1367 Context *context = GetValidGlobalContext();
1368 EVENT(context, GLProgramUniform3i,
1369 "context = %d, program = %u, location = %d, v0 = %d, v1 = %d, v2 = %d", CID(context),
1370 program, location, v0, v1, v2);
1371
1372 if (context)
1373 {
1374 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1375 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1376 SCOPED_SHARE_CONTEXT_LOCK(context);
1377 bool isCallValid =
1378 (context->skipValidation() ||
1379 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1380 context->getMutableErrorSetForValidation(),
1381 angle::EntryPoint::GLProgramUniform3i) &&
1382 ValidateProgramUniform3i(context, angle::EntryPoint::GLProgramUniform3i,
1383 programPacked, locationPacked, v0, v1, v2)));
1384 if (isCallValid)
1385 {
1386 context->programUniform3i(programPacked, locationPacked, v0, v1, v2);
1387 }
1388 ANGLE_CAPTURE_GL(ProgramUniform3i, isCallValid, context, programPacked, locationPacked, v0,
1389 v1, v2);
1390 }
1391 else
1392 {
1393 GenerateContextLostErrorOnCurrentGlobalContext();
1394 }
1395 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1396 }
1397
GL_ProgramUniform3iv(GLuint program,GLint location,GLsizei count,const GLint * value)1398 void GL_APIENTRY GL_ProgramUniform3iv(GLuint program,
1399 GLint location,
1400 GLsizei count,
1401 const GLint *value)
1402 {
1403 Context *context = GetValidGlobalContext();
1404 EVENT(context, GLProgramUniform3iv,
1405 "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
1406 CID(context), program, location, count, (uintptr_t)value);
1407
1408 if (context)
1409 {
1410 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1411 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1412 SCOPED_SHARE_CONTEXT_LOCK(context);
1413 bool isCallValid =
1414 (context->skipValidation() ||
1415 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1416 context->getMutableErrorSetForValidation(),
1417 angle::EntryPoint::GLProgramUniform3iv) &&
1418 ValidateProgramUniform3iv(context, angle::EntryPoint::GLProgramUniform3iv,
1419 programPacked, locationPacked, count, value)));
1420 if (isCallValid)
1421 {
1422 context->programUniform3iv(programPacked, locationPacked, count, value);
1423 }
1424 ANGLE_CAPTURE_GL(ProgramUniform3iv, isCallValid, context, programPacked, locationPacked,
1425 count, value);
1426 }
1427 else
1428 {
1429 GenerateContextLostErrorOnCurrentGlobalContext();
1430 }
1431 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1432 }
1433
1434 void GL_APIENTRY
GL_ProgramUniform3ui(GLuint program,GLint location,GLuint v0,GLuint v1,GLuint v2)1435 GL_ProgramUniform3ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2)
1436 {
1437 Context *context = GetValidGlobalContext();
1438 EVENT(context, GLProgramUniform3ui,
1439 "context = %d, program = %u, location = %d, v0 = %u, v1 = %u, v2 = %u", CID(context),
1440 program, location, v0, v1, v2);
1441
1442 if (context)
1443 {
1444 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1445 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1446 SCOPED_SHARE_CONTEXT_LOCK(context);
1447 bool isCallValid =
1448 (context->skipValidation() ||
1449 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1450 context->getMutableErrorSetForValidation(),
1451 angle::EntryPoint::GLProgramUniform3ui) &&
1452 ValidateProgramUniform3ui(context, angle::EntryPoint::GLProgramUniform3ui,
1453 programPacked, locationPacked, v0, v1, v2)));
1454 if (isCallValid)
1455 {
1456 context->programUniform3ui(programPacked, locationPacked, v0, v1, v2);
1457 }
1458 ANGLE_CAPTURE_GL(ProgramUniform3ui, isCallValid, context, programPacked, locationPacked, v0,
1459 v1, v2);
1460 }
1461 else
1462 {
1463 GenerateContextLostErrorOnCurrentGlobalContext();
1464 }
1465 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1466 }
1467
GL_ProgramUniform3uiv(GLuint program,GLint location,GLsizei count,const GLuint * value)1468 void GL_APIENTRY GL_ProgramUniform3uiv(GLuint program,
1469 GLint location,
1470 GLsizei count,
1471 const GLuint *value)
1472 {
1473 Context *context = GetValidGlobalContext();
1474 EVENT(context, GLProgramUniform3uiv,
1475 "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
1476 CID(context), program, location, count, (uintptr_t)value);
1477
1478 if (context)
1479 {
1480 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1481 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1482 SCOPED_SHARE_CONTEXT_LOCK(context);
1483 bool isCallValid =
1484 (context->skipValidation() ||
1485 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1486 context->getMutableErrorSetForValidation(),
1487 angle::EntryPoint::GLProgramUniform3uiv) &&
1488 ValidateProgramUniform3uiv(context, angle::EntryPoint::GLProgramUniform3uiv,
1489 programPacked, locationPacked, count, value)));
1490 if (isCallValid)
1491 {
1492 context->programUniform3uiv(programPacked, locationPacked, count, value);
1493 }
1494 ANGLE_CAPTURE_GL(ProgramUniform3uiv, isCallValid, context, programPacked, locationPacked,
1495 count, value);
1496 }
1497 else
1498 {
1499 GenerateContextLostErrorOnCurrentGlobalContext();
1500 }
1501 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1502 }
1503
1504 void GL_APIENTRY
GL_ProgramUniform4f(GLuint program,GLint location,GLfloat v0,GLfloat v1,GLfloat v2,GLfloat v3)1505 GL_ProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
1506 {
1507 Context *context = GetValidGlobalContext();
1508 EVENT(context, GLProgramUniform4f,
1509 "context = %d, program = %u, location = %d, v0 = %f, v1 = %f, v2 = %f, v3 = %f",
1510 CID(context), program, location, v0, v1, v2, v3);
1511
1512 if (context)
1513 {
1514 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1515 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1516 SCOPED_SHARE_CONTEXT_LOCK(context);
1517 bool isCallValid =
1518 (context->skipValidation() ||
1519 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1520 context->getMutableErrorSetForValidation(),
1521 angle::EntryPoint::GLProgramUniform4f) &&
1522 ValidateProgramUniform4f(context, angle::EntryPoint::GLProgramUniform4f,
1523 programPacked, locationPacked, v0, v1, v2, v3)));
1524 if (isCallValid)
1525 {
1526 context->programUniform4f(programPacked, locationPacked, v0, v1, v2, v3);
1527 }
1528 ANGLE_CAPTURE_GL(ProgramUniform4f, isCallValid, context, programPacked, locationPacked, v0,
1529 v1, v2, v3);
1530 }
1531 else
1532 {
1533 GenerateContextLostErrorOnCurrentGlobalContext();
1534 }
1535 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1536 }
1537
GL_ProgramUniform4fv(GLuint program,GLint location,GLsizei count,const GLfloat * value)1538 void GL_APIENTRY GL_ProgramUniform4fv(GLuint program,
1539 GLint location,
1540 GLsizei count,
1541 const GLfloat *value)
1542 {
1543 Context *context = GetValidGlobalContext();
1544 EVENT(context, GLProgramUniform4fv,
1545 "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
1546 CID(context), program, location, count, (uintptr_t)value);
1547
1548 if (context)
1549 {
1550 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1551 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1552 SCOPED_SHARE_CONTEXT_LOCK(context);
1553 bool isCallValid =
1554 (context->skipValidation() ||
1555 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1556 context->getMutableErrorSetForValidation(),
1557 angle::EntryPoint::GLProgramUniform4fv) &&
1558 ValidateProgramUniform4fv(context, angle::EntryPoint::GLProgramUniform4fv,
1559 programPacked, locationPacked, count, value)));
1560 if (isCallValid)
1561 {
1562 context->programUniform4fv(programPacked, locationPacked, count, value);
1563 }
1564 ANGLE_CAPTURE_GL(ProgramUniform4fv, isCallValid, context, programPacked, locationPacked,
1565 count, value);
1566 }
1567 else
1568 {
1569 GenerateContextLostErrorOnCurrentGlobalContext();
1570 }
1571 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1572 }
1573
1574 void GL_APIENTRY
GL_ProgramUniform4i(GLuint program,GLint location,GLint v0,GLint v1,GLint v2,GLint v3)1575 GL_ProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
1576 {
1577 Context *context = GetValidGlobalContext();
1578 EVENT(context, GLProgramUniform4i,
1579 "context = %d, program = %u, location = %d, v0 = %d, v1 = %d, v2 = %d, v3 = %d",
1580 CID(context), program, location, v0, v1, v2, v3);
1581
1582 if (context)
1583 {
1584 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1585 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1586 SCOPED_SHARE_CONTEXT_LOCK(context);
1587 bool isCallValid =
1588 (context->skipValidation() ||
1589 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1590 context->getMutableErrorSetForValidation(),
1591 angle::EntryPoint::GLProgramUniform4i) &&
1592 ValidateProgramUniform4i(context, angle::EntryPoint::GLProgramUniform4i,
1593 programPacked, locationPacked, v0, v1, v2, v3)));
1594 if (isCallValid)
1595 {
1596 context->programUniform4i(programPacked, locationPacked, v0, v1, v2, v3);
1597 }
1598 ANGLE_CAPTURE_GL(ProgramUniform4i, isCallValid, context, programPacked, locationPacked, v0,
1599 v1, v2, v3);
1600 }
1601 else
1602 {
1603 GenerateContextLostErrorOnCurrentGlobalContext();
1604 }
1605 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1606 }
1607
GL_ProgramUniform4iv(GLuint program,GLint location,GLsizei count,const GLint * value)1608 void GL_APIENTRY GL_ProgramUniform4iv(GLuint program,
1609 GLint location,
1610 GLsizei count,
1611 const GLint *value)
1612 {
1613 Context *context = GetValidGlobalContext();
1614 EVENT(context, GLProgramUniform4iv,
1615 "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
1616 CID(context), program, location, count, (uintptr_t)value);
1617
1618 if (context)
1619 {
1620 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1621 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1622 SCOPED_SHARE_CONTEXT_LOCK(context);
1623 bool isCallValid =
1624 (context->skipValidation() ||
1625 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1626 context->getMutableErrorSetForValidation(),
1627 angle::EntryPoint::GLProgramUniform4iv) &&
1628 ValidateProgramUniform4iv(context, angle::EntryPoint::GLProgramUniform4iv,
1629 programPacked, locationPacked, count, value)));
1630 if (isCallValid)
1631 {
1632 context->programUniform4iv(programPacked, locationPacked, count, value);
1633 }
1634 ANGLE_CAPTURE_GL(ProgramUniform4iv, isCallValid, context, programPacked, locationPacked,
1635 count, value);
1636 }
1637 else
1638 {
1639 GenerateContextLostErrorOnCurrentGlobalContext();
1640 }
1641 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1642 }
1643
1644 void GL_APIENTRY
GL_ProgramUniform4ui(GLuint program,GLint location,GLuint v0,GLuint v1,GLuint v2,GLuint v3)1645 GL_ProgramUniform4ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
1646 {
1647 Context *context = GetValidGlobalContext();
1648 EVENT(context, GLProgramUniform4ui,
1649 "context = %d, program = %u, location = %d, v0 = %u, v1 = %u, v2 = %u, v3 = %u",
1650 CID(context), program, location, v0, v1, v2, v3);
1651
1652 if (context)
1653 {
1654 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1655 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1656 SCOPED_SHARE_CONTEXT_LOCK(context);
1657 bool isCallValid =
1658 (context->skipValidation() ||
1659 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1660 context->getMutableErrorSetForValidation(),
1661 angle::EntryPoint::GLProgramUniform4ui) &&
1662 ValidateProgramUniform4ui(context, angle::EntryPoint::GLProgramUniform4ui,
1663 programPacked, locationPacked, v0, v1, v2, v3)));
1664 if (isCallValid)
1665 {
1666 context->programUniform4ui(programPacked, locationPacked, v0, v1, v2, v3);
1667 }
1668 ANGLE_CAPTURE_GL(ProgramUniform4ui, isCallValid, context, programPacked, locationPacked, v0,
1669 v1, v2, v3);
1670 }
1671 else
1672 {
1673 GenerateContextLostErrorOnCurrentGlobalContext();
1674 }
1675 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1676 }
1677
GL_ProgramUniform4uiv(GLuint program,GLint location,GLsizei count,const GLuint * value)1678 void GL_APIENTRY GL_ProgramUniform4uiv(GLuint program,
1679 GLint location,
1680 GLsizei count,
1681 const GLuint *value)
1682 {
1683 Context *context = GetValidGlobalContext();
1684 EVENT(context, GLProgramUniform4uiv,
1685 "context = %d, program = %u, location = %d, count = %d, value = 0x%016" PRIxPTR "",
1686 CID(context), program, location, count, (uintptr_t)value);
1687
1688 if (context)
1689 {
1690 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1691 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1692 SCOPED_SHARE_CONTEXT_LOCK(context);
1693 bool isCallValid =
1694 (context->skipValidation() ||
1695 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1696 context->getMutableErrorSetForValidation(),
1697 angle::EntryPoint::GLProgramUniform4uiv) &&
1698 ValidateProgramUniform4uiv(context, angle::EntryPoint::GLProgramUniform4uiv,
1699 programPacked, locationPacked, count, value)));
1700 if (isCallValid)
1701 {
1702 context->programUniform4uiv(programPacked, locationPacked, count, value);
1703 }
1704 ANGLE_CAPTURE_GL(ProgramUniform4uiv, isCallValid, context, programPacked, locationPacked,
1705 count, value);
1706 }
1707 else
1708 {
1709 GenerateContextLostErrorOnCurrentGlobalContext();
1710 }
1711 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1712 }
1713
GL_ProgramUniformMatrix2fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)1714 void GL_APIENTRY GL_ProgramUniformMatrix2fv(GLuint program,
1715 GLint location,
1716 GLsizei count,
1717 GLboolean transpose,
1718 const GLfloat *value)
1719 {
1720 Context *context = GetValidGlobalContext();
1721 EVENT(context, GLProgramUniformMatrix2fv,
1722 "context = %d, program = %u, location = %d, count = %d, transpose = %s, value = "
1723 "0x%016" PRIxPTR "",
1724 CID(context), program, location, count, GLbooleanToString(transpose), (uintptr_t)value);
1725
1726 if (context)
1727 {
1728 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1729 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1730 SCOPED_SHARE_CONTEXT_LOCK(context);
1731 bool isCallValid =
1732 (context->skipValidation() ||
1733 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1734 context->getMutableErrorSetForValidation(),
1735 angle::EntryPoint::GLProgramUniformMatrix2fv) &&
1736 ValidateProgramUniformMatrix2fv(context, angle::EntryPoint::GLProgramUniformMatrix2fv,
1737 programPacked, locationPacked, count, transpose,
1738 value)));
1739 if (isCallValid)
1740 {
1741 context->programUniformMatrix2fv(programPacked, locationPacked, count, transpose,
1742 value);
1743 }
1744 ANGLE_CAPTURE_GL(ProgramUniformMatrix2fv, isCallValid, context, programPacked,
1745 locationPacked, count, transpose, value);
1746 }
1747 else
1748 {
1749 GenerateContextLostErrorOnCurrentGlobalContext();
1750 }
1751 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1752 }
1753
GL_ProgramUniformMatrix2x3fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)1754 void GL_APIENTRY GL_ProgramUniformMatrix2x3fv(GLuint program,
1755 GLint location,
1756 GLsizei count,
1757 GLboolean transpose,
1758 const GLfloat *value)
1759 {
1760 Context *context = GetValidGlobalContext();
1761 EVENT(context, GLProgramUniformMatrix2x3fv,
1762 "context = %d, program = %u, location = %d, count = %d, transpose = %s, value = "
1763 "0x%016" PRIxPTR "",
1764 CID(context), program, location, count, GLbooleanToString(transpose), (uintptr_t)value);
1765
1766 if (context)
1767 {
1768 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1769 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1770 SCOPED_SHARE_CONTEXT_LOCK(context);
1771 bool isCallValid =
1772 (context->skipValidation() ||
1773 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1774 context->getMutableErrorSetForValidation(),
1775 angle::EntryPoint::GLProgramUniformMatrix2x3fv) &&
1776 ValidateProgramUniformMatrix2x3fv(
1777 context, angle::EntryPoint::GLProgramUniformMatrix2x3fv, programPacked,
1778 locationPacked, count, transpose, value)));
1779 if (isCallValid)
1780 {
1781 context->programUniformMatrix2x3fv(programPacked, locationPacked, count, transpose,
1782 value);
1783 }
1784 ANGLE_CAPTURE_GL(ProgramUniformMatrix2x3fv, isCallValid, context, programPacked,
1785 locationPacked, count, transpose, value);
1786 }
1787 else
1788 {
1789 GenerateContextLostErrorOnCurrentGlobalContext();
1790 }
1791 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1792 }
1793
GL_ProgramUniformMatrix2x4fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)1794 void GL_APIENTRY GL_ProgramUniformMatrix2x4fv(GLuint program,
1795 GLint location,
1796 GLsizei count,
1797 GLboolean transpose,
1798 const GLfloat *value)
1799 {
1800 Context *context = GetValidGlobalContext();
1801 EVENT(context, GLProgramUniformMatrix2x4fv,
1802 "context = %d, program = %u, location = %d, count = %d, transpose = %s, value = "
1803 "0x%016" PRIxPTR "",
1804 CID(context), program, location, count, GLbooleanToString(transpose), (uintptr_t)value);
1805
1806 if (context)
1807 {
1808 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1809 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1810 SCOPED_SHARE_CONTEXT_LOCK(context);
1811 bool isCallValid =
1812 (context->skipValidation() ||
1813 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1814 context->getMutableErrorSetForValidation(),
1815 angle::EntryPoint::GLProgramUniformMatrix2x4fv) &&
1816 ValidateProgramUniformMatrix2x4fv(
1817 context, angle::EntryPoint::GLProgramUniformMatrix2x4fv, programPacked,
1818 locationPacked, count, transpose, value)));
1819 if (isCallValid)
1820 {
1821 context->programUniformMatrix2x4fv(programPacked, locationPacked, count, transpose,
1822 value);
1823 }
1824 ANGLE_CAPTURE_GL(ProgramUniformMatrix2x4fv, isCallValid, context, programPacked,
1825 locationPacked, count, transpose, value);
1826 }
1827 else
1828 {
1829 GenerateContextLostErrorOnCurrentGlobalContext();
1830 }
1831 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1832 }
1833
GL_ProgramUniformMatrix3fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)1834 void GL_APIENTRY GL_ProgramUniformMatrix3fv(GLuint program,
1835 GLint location,
1836 GLsizei count,
1837 GLboolean transpose,
1838 const GLfloat *value)
1839 {
1840 Context *context = GetValidGlobalContext();
1841 EVENT(context, GLProgramUniformMatrix3fv,
1842 "context = %d, program = %u, location = %d, count = %d, transpose = %s, value = "
1843 "0x%016" PRIxPTR "",
1844 CID(context), program, location, count, GLbooleanToString(transpose), (uintptr_t)value);
1845
1846 if (context)
1847 {
1848 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1849 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1850 SCOPED_SHARE_CONTEXT_LOCK(context);
1851 bool isCallValid =
1852 (context->skipValidation() ||
1853 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1854 context->getMutableErrorSetForValidation(),
1855 angle::EntryPoint::GLProgramUniformMatrix3fv) &&
1856 ValidateProgramUniformMatrix3fv(context, angle::EntryPoint::GLProgramUniformMatrix3fv,
1857 programPacked, locationPacked, count, transpose,
1858 value)));
1859 if (isCallValid)
1860 {
1861 context->programUniformMatrix3fv(programPacked, locationPacked, count, transpose,
1862 value);
1863 }
1864 ANGLE_CAPTURE_GL(ProgramUniformMatrix3fv, isCallValid, context, programPacked,
1865 locationPacked, count, transpose, value);
1866 }
1867 else
1868 {
1869 GenerateContextLostErrorOnCurrentGlobalContext();
1870 }
1871 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1872 }
1873
GL_ProgramUniformMatrix3x2fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)1874 void GL_APIENTRY GL_ProgramUniformMatrix3x2fv(GLuint program,
1875 GLint location,
1876 GLsizei count,
1877 GLboolean transpose,
1878 const GLfloat *value)
1879 {
1880 Context *context = GetValidGlobalContext();
1881 EVENT(context, GLProgramUniformMatrix3x2fv,
1882 "context = %d, program = %u, location = %d, count = %d, transpose = %s, value = "
1883 "0x%016" PRIxPTR "",
1884 CID(context), program, location, count, GLbooleanToString(transpose), (uintptr_t)value);
1885
1886 if (context)
1887 {
1888 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1889 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1890 SCOPED_SHARE_CONTEXT_LOCK(context);
1891 bool isCallValid =
1892 (context->skipValidation() ||
1893 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1894 context->getMutableErrorSetForValidation(),
1895 angle::EntryPoint::GLProgramUniformMatrix3x2fv) &&
1896 ValidateProgramUniformMatrix3x2fv(
1897 context, angle::EntryPoint::GLProgramUniformMatrix3x2fv, programPacked,
1898 locationPacked, count, transpose, value)));
1899 if (isCallValid)
1900 {
1901 context->programUniformMatrix3x2fv(programPacked, locationPacked, count, transpose,
1902 value);
1903 }
1904 ANGLE_CAPTURE_GL(ProgramUniformMatrix3x2fv, isCallValid, context, programPacked,
1905 locationPacked, count, transpose, value);
1906 }
1907 else
1908 {
1909 GenerateContextLostErrorOnCurrentGlobalContext();
1910 }
1911 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1912 }
1913
GL_ProgramUniformMatrix3x4fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)1914 void GL_APIENTRY GL_ProgramUniformMatrix3x4fv(GLuint program,
1915 GLint location,
1916 GLsizei count,
1917 GLboolean transpose,
1918 const GLfloat *value)
1919 {
1920 Context *context = GetValidGlobalContext();
1921 EVENT(context, GLProgramUniformMatrix3x4fv,
1922 "context = %d, program = %u, location = %d, count = %d, transpose = %s, value = "
1923 "0x%016" PRIxPTR "",
1924 CID(context), program, location, count, GLbooleanToString(transpose), (uintptr_t)value);
1925
1926 if (context)
1927 {
1928 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1929 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1930 SCOPED_SHARE_CONTEXT_LOCK(context);
1931 bool isCallValid =
1932 (context->skipValidation() ||
1933 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1934 context->getMutableErrorSetForValidation(),
1935 angle::EntryPoint::GLProgramUniformMatrix3x4fv) &&
1936 ValidateProgramUniformMatrix3x4fv(
1937 context, angle::EntryPoint::GLProgramUniformMatrix3x4fv, programPacked,
1938 locationPacked, count, transpose, value)));
1939 if (isCallValid)
1940 {
1941 context->programUniformMatrix3x4fv(programPacked, locationPacked, count, transpose,
1942 value);
1943 }
1944 ANGLE_CAPTURE_GL(ProgramUniformMatrix3x4fv, isCallValid, context, programPacked,
1945 locationPacked, count, transpose, value);
1946 }
1947 else
1948 {
1949 GenerateContextLostErrorOnCurrentGlobalContext();
1950 }
1951 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1952 }
1953
GL_ProgramUniformMatrix4fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)1954 void GL_APIENTRY GL_ProgramUniformMatrix4fv(GLuint program,
1955 GLint location,
1956 GLsizei count,
1957 GLboolean transpose,
1958 const GLfloat *value)
1959 {
1960 Context *context = GetValidGlobalContext();
1961 EVENT(context, GLProgramUniformMatrix4fv,
1962 "context = %d, program = %u, location = %d, count = %d, transpose = %s, value = "
1963 "0x%016" PRIxPTR "",
1964 CID(context), program, location, count, GLbooleanToString(transpose), (uintptr_t)value);
1965
1966 if (context)
1967 {
1968 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
1969 UniformLocation locationPacked = PackParam<UniformLocation>(location);
1970 SCOPED_SHARE_CONTEXT_LOCK(context);
1971 bool isCallValid =
1972 (context->skipValidation() ||
1973 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
1974 context->getMutableErrorSetForValidation(),
1975 angle::EntryPoint::GLProgramUniformMatrix4fv) &&
1976 ValidateProgramUniformMatrix4fv(context, angle::EntryPoint::GLProgramUniformMatrix4fv,
1977 programPacked, locationPacked, count, transpose,
1978 value)));
1979 if (isCallValid)
1980 {
1981 context->programUniformMatrix4fv(programPacked, locationPacked, count, transpose,
1982 value);
1983 }
1984 ANGLE_CAPTURE_GL(ProgramUniformMatrix4fv, isCallValid, context, programPacked,
1985 locationPacked, count, transpose, value);
1986 }
1987 else
1988 {
1989 GenerateContextLostErrorOnCurrentGlobalContext();
1990 }
1991 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
1992 }
1993
GL_ProgramUniformMatrix4x2fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)1994 void GL_APIENTRY GL_ProgramUniformMatrix4x2fv(GLuint program,
1995 GLint location,
1996 GLsizei count,
1997 GLboolean transpose,
1998 const GLfloat *value)
1999 {
2000 Context *context = GetValidGlobalContext();
2001 EVENT(context, GLProgramUniformMatrix4x2fv,
2002 "context = %d, program = %u, location = %d, count = %d, transpose = %s, value = "
2003 "0x%016" PRIxPTR "",
2004 CID(context), program, location, count, GLbooleanToString(transpose), (uintptr_t)value);
2005
2006 if (context)
2007 {
2008 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
2009 UniformLocation locationPacked = PackParam<UniformLocation>(location);
2010 SCOPED_SHARE_CONTEXT_LOCK(context);
2011 bool isCallValid =
2012 (context->skipValidation() ||
2013 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
2014 context->getMutableErrorSetForValidation(),
2015 angle::EntryPoint::GLProgramUniformMatrix4x2fv) &&
2016 ValidateProgramUniformMatrix4x2fv(
2017 context, angle::EntryPoint::GLProgramUniformMatrix4x2fv, programPacked,
2018 locationPacked, count, transpose, value)));
2019 if (isCallValid)
2020 {
2021 context->programUniformMatrix4x2fv(programPacked, locationPacked, count, transpose,
2022 value);
2023 }
2024 ANGLE_CAPTURE_GL(ProgramUniformMatrix4x2fv, isCallValid, context, programPacked,
2025 locationPacked, count, transpose, value);
2026 }
2027 else
2028 {
2029 GenerateContextLostErrorOnCurrentGlobalContext();
2030 }
2031 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
2032 }
2033
GL_ProgramUniformMatrix4x3fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)2034 void GL_APIENTRY GL_ProgramUniformMatrix4x3fv(GLuint program,
2035 GLint location,
2036 GLsizei count,
2037 GLboolean transpose,
2038 const GLfloat *value)
2039 {
2040 Context *context = GetValidGlobalContext();
2041 EVENT(context, GLProgramUniformMatrix4x3fv,
2042 "context = %d, program = %u, location = %d, count = %d, transpose = %s, value = "
2043 "0x%016" PRIxPTR "",
2044 CID(context), program, location, count, GLbooleanToString(transpose), (uintptr_t)value);
2045
2046 if (context)
2047 {
2048 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
2049 UniformLocation locationPacked = PackParam<UniformLocation>(location);
2050 SCOPED_SHARE_CONTEXT_LOCK(context);
2051 bool isCallValid =
2052 (context->skipValidation() ||
2053 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
2054 context->getMutableErrorSetForValidation(),
2055 angle::EntryPoint::GLProgramUniformMatrix4x3fv) &&
2056 ValidateProgramUniformMatrix4x3fv(
2057 context, angle::EntryPoint::GLProgramUniformMatrix4x3fv, programPacked,
2058 locationPacked, count, transpose, value)));
2059 if (isCallValid)
2060 {
2061 context->programUniformMatrix4x3fv(programPacked, locationPacked, count, transpose,
2062 value);
2063 }
2064 ANGLE_CAPTURE_GL(ProgramUniformMatrix4x3fv, isCallValid, context, programPacked,
2065 locationPacked, count, transpose, value);
2066 }
2067 else
2068 {
2069 GenerateContextLostErrorOnCurrentGlobalContext();
2070 }
2071 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
2072 }
2073
GL_SampleMaski(GLuint maskNumber,GLbitfield mask)2074 void GL_APIENTRY GL_SampleMaski(GLuint maskNumber, GLbitfield mask)
2075 {
2076 Context *context = GetValidGlobalContext();
2077 EVENT(context, GLSampleMaski, "context = %d, maskNumber = %u, mask = %s", CID(context),
2078 maskNumber, GLbitfieldToString(GLESEnum::AllEnums, mask).c_str());
2079
2080 if (context)
2081 {
2082 bool isCallValid =
2083 (context->skipValidation() ||
2084 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
2085 context->getMutableErrorSetForValidation(),
2086 angle::EntryPoint::GLSampleMaski) &&
2087 ValidateSampleMaski(context->getPrivateState(),
2088 context->getMutableErrorSetForValidation(),
2089 angle::EntryPoint::GLSampleMaski, maskNumber, mask)));
2090 if (isCallValid)
2091 {
2092 ContextPrivateSampleMaski(context->getMutablePrivateState(),
2093 context->getMutablePrivateStateCache(), maskNumber, mask);
2094 }
2095 ANGLE_CAPTURE_GL(SampleMaski, isCallValid, context, maskNumber, mask);
2096 }
2097 else
2098 {
2099 GenerateContextLostErrorOnCurrentGlobalContext();
2100 }
2101 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
2102 }
2103
GL_TexStorage2DMultisample(GLenum target,GLsizei samples,GLenum internalformat,GLsizei width,GLsizei height,GLboolean fixedsamplelocations)2104 void GL_APIENTRY GL_TexStorage2DMultisample(GLenum target,
2105 GLsizei samples,
2106 GLenum internalformat,
2107 GLsizei width,
2108 GLsizei height,
2109 GLboolean fixedsamplelocations)
2110 {
2111 Context *context = GetValidGlobalContext();
2112 EVENT(context, GLTexStorage2DMultisample,
2113 "context = %d, target = %s, samples = %d, internalformat = %s, width = %d, height = %d, "
2114 "fixedsamplelocations = %s",
2115 CID(context), GLenumToString(GLESEnum::TextureTarget, target), samples,
2116 GLenumToString(GLESEnum::SizedInternalFormat, internalformat), width, height,
2117 GLbooleanToString(fixedsamplelocations));
2118
2119 if (context)
2120 {
2121 TextureType targetPacked = PackParam<TextureType>(target);
2122 SCOPED_SHARE_CONTEXT_LOCK(context);
2123 bool isCallValid =
2124 (context->skipValidation() ||
2125 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
2126 context->getMutableErrorSetForValidation(),
2127 angle::EntryPoint::GLTexStorage2DMultisample) &&
2128 ValidateTexStorage2DMultisample(context, angle::EntryPoint::GLTexStorage2DMultisample,
2129 targetPacked, samples, internalformat, width, height,
2130 fixedsamplelocations)));
2131 if (isCallValid)
2132 {
2133 context->texStorage2DMultisample(targetPacked, samples, internalformat, width, height,
2134 fixedsamplelocations);
2135 }
2136 ANGLE_CAPTURE_GL(TexStorage2DMultisample, isCallValid, context, targetPacked, samples,
2137 internalformat, width, height, fixedsamplelocations);
2138 }
2139 else
2140 {
2141 GenerateContextLostErrorOnCurrentGlobalContext();
2142 }
2143 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
2144 }
2145
GL_UseProgramStages(GLuint pipeline,GLbitfield stages,GLuint program)2146 void GL_APIENTRY GL_UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program)
2147 {
2148 Context *context = GetValidGlobalContext();
2149 EVENT(context, GLUseProgramStages, "context = %d, pipeline = %u, stages = %s, program = %u",
2150 CID(context), pipeline, GLbitfieldToString(GLESEnum::UseProgramStageMask, stages).c_str(),
2151 program);
2152
2153 if (context)
2154 {
2155 ProgramPipelineID pipelinePacked = PackParam<ProgramPipelineID>(pipeline);
2156 ShaderProgramID programPacked = PackParam<ShaderProgramID>(program);
2157 SCOPED_SHARE_CONTEXT_LOCK(context);
2158 bool isCallValid =
2159 (context->skipValidation() ||
2160 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
2161 context->getMutableErrorSetForValidation(),
2162 angle::EntryPoint::GLUseProgramStages) &&
2163 ValidateUseProgramStages(context, angle::EntryPoint::GLUseProgramStages,
2164 pipelinePacked, stages, programPacked)));
2165 if (isCallValid)
2166 {
2167 context->useProgramStages(pipelinePacked, stages, programPacked);
2168 }
2169 ANGLE_CAPTURE_GL(UseProgramStages, isCallValid, context, pipelinePacked, stages,
2170 programPacked);
2171 }
2172 else
2173 {
2174 GenerateContextLostErrorOnCurrentGlobalContext();
2175 }
2176 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
2177 }
2178
GL_ValidateProgramPipeline(GLuint pipeline)2179 void GL_APIENTRY GL_ValidateProgramPipeline(GLuint pipeline)
2180 {
2181 Context *context = GetValidGlobalContext();
2182 EVENT(context, GLValidateProgramPipeline, "context = %d, pipeline = %u", CID(context),
2183 pipeline);
2184
2185 if (context)
2186 {
2187 ProgramPipelineID pipelinePacked = PackParam<ProgramPipelineID>(pipeline);
2188 SCOPED_SHARE_CONTEXT_LOCK(context);
2189 bool isCallValid =
2190 (context->skipValidation() ||
2191 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
2192 context->getMutableErrorSetForValidation(),
2193 angle::EntryPoint::GLValidateProgramPipeline) &&
2194 ValidateValidateProgramPipeline(context, angle::EntryPoint::GLValidateProgramPipeline,
2195 pipelinePacked)));
2196 if (isCallValid)
2197 {
2198 context->validateProgramPipeline(pipelinePacked);
2199 }
2200 ANGLE_CAPTURE_GL(ValidateProgramPipeline, isCallValid, context, pipelinePacked);
2201 }
2202 else
2203 {
2204 GenerateContextLostErrorOnCurrentGlobalContext();
2205 }
2206 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
2207 }
2208
GL_VertexAttribBinding(GLuint attribindex,GLuint bindingindex)2209 void GL_APIENTRY GL_VertexAttribBinding(GLuint attribindex, GLuint bindingindex)
2210 {
2211 Context *context = GetValidGlobalContext();
2212 EVENT(context, GLVertexAttribBinding, "context = %d, attribindex = %u, bindingindex = %u",
2213 CID(context), attribindex, bindingindex);
2214
2215 if (context)
2216 {
2217 SCOPED_SHARE_CONTEXT_LOCK(context);
2218 bool isCallValid =
2219 (context->skipValidation() ||
2220 ValidateVertexAttribBinding(context, angle::EntryPoint::GLVertexAttribBinding,
2221 attribindex, bindingindex));
2222 if (isCallValid)
2223 {
2224 context->vertexAttribBinding(attribindex, bindingindex);
2225 }
2226 ANGLE_CAPTURE_GL(VertexAttribBinding, isCallValid, context, attribindex, bindingindex);
2227 }
2228 else
2229 {
2230 GenerateContextLostErrorOnCurrentGlobalContext();
2231 }
2232 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
2233 }
2234
GL_VertexAttribFormat(GLuint attribindex,GLint size,GLenum type,GLboolean normalized,GLuint relativeoffset)2235 void GL_APIENTRY GL_VertexAttribFormat(GLuint attribindex,
2236 GLint size,
2237 GLenum type,
2238 GLboolean normalized,
2239 GLuint relativeoffset)
2240 {
2241 Context *context = GetValidGlobalContext();
2242 EVENT(context, GLVertexAttribFormat,
2243 "context = %d, attribindex = %u, size = %d, type = %s, normalized = %s, relativeoffset = "
2244 "%u",
2245 CID(context), attribindex, size, GLenumToString(GLESEnum::VertexAttribType, type),
2246 GLbooleanToString(normalized), relativeoffset);
2247
2248 if (context)
2249 {
2250 VertexAttribType typePacked = PackParam<VertexAttribType>(type);
2251 SCOPED_SHARE_CONTEXT_LOCK(context);
2252 bool isCallValid =
2253 (context->skipValidation() ||
2254 ValidateVertexAttribFormat(context, angle::EntryPoint::GLVertexAttribFormat,
2255 attribindex, size, typePacked, normalized, relativeoffset));
2256 if (isCallValid)
2257 {
2258 context->vertexAttribFormat(attribindex, size, typePacked, normalized, relativeoffset);
2259 }
2260 ANGLE_CAPTURE_GL(VertexAttribFormat, isCallValid, context, attribindex, size, typePacked,
2261 normalized, relativeoffset);
2262 }
2263 else
2264 {
2265 GenerateContextLostErrorOnCurrentGlobalContext();
2266 }
2267 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
2268 }
2269
GL_VertexAttribIFormat(GLuint attribindex,GLint size,GLenum type,GLuint relativeoffset)2270 void GL_APIENTRY GL_VertexAttribIFormat(GLuint attribindex,
2271 GLint size,
2272 GLenum type,
2273 GLuint relativeoffset)
2274 {
2275 Context *context = GetValidGlobalContext();
2276 EVENT(context, GLVertexAttribIFormat,
2277 "context = %d, attribindex = %u, size = %d, type = %s, relativeoffset = %u", CID(context),
2278 attribindex, size, GLenumToString(GLESEnum::VertexAttribIType, type), relativeoffset);
2279
2280 if (context)
2281 {
2282 VertexAttribType typePacked = PackParam<VertexAttribType>(type);
2283 SCOPED_SHARE_CONTEXT_LOCK(context);
2284 bool isCallValid =
2285 (context->skipValidation() ||
2286 ValidateVertexAttribIFormat(context, angle::EntryPoint::GLVertexAttribIFormat,
2287 attribindex, size, typePacked, relativeoffset));
2288 if (isCallValid)
2289 {
2290 context->vertexAttribIFormat(attribindex, size, typePacked, relativeoffset);
2291 }
2292 ANGLE_CAPTURE_GL(VertexAttribIFormat, isCallValid, context, attribindex, size, typePacked,
2293 relativeoffset);
2294 }
2295 else
2296 {
2297 GenerateContextLostErrorOnCurrentGlobalContext();
2298 }
2299 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
2300 }
2301
GL_VertexBindingDivisor(GLuint bindingindex,GLuint divisor)2302 void GL_APIENTRY GL_VertexBindingDivisor(GLuint bindingindex, GLuint divisor)
2303 {
2304 Context *context = GetValidGlobalContext();
2305 EVENT(context, GLVertexBindingDivisor, "context = %d, bindingindex = %u, divisor = %u",
2306 CID(context), bindingindex, divisor);
2307
2308 if (context)
2309 {
2310 SCOPED_SHARE_CONTEXT_LOCK(context);
2311 bool isCallValid =
2312 (context->skipValidation() ||
2313 (ValidatePixelLocalStorageInactive(context->getPrivateState(),
2314 context->getMutableErrorSetForValidation(),
2315 angle::EntryPoint::GLVertexBindingDivisor) &&
2316 ValidateVertexBindingDivisor(context, angle::EntryPoint::GLVertexBindingDivisor,
2317 bindingindex, divisor)));
2318 if (isCallValid)
2319 {
2320 context->vertexBindingDivisor(bindingindex, divisor);
2321 }
2322 ANGLE_CAPTURE_GL(VertexBindingDivisor, isCallValid, context, bindingindex, divisor);
2323 }
2324 else
2325 {
2326 GenerateContextLostErrorOnCurrentGlobalContext();
2327 }
2328 ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any());
2329 }
2330
2331 } // extern "C"
2332