• 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 2019 The ANGLE Project Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style license that can be
6 // found in the LICENSE file.
7 //
8 // entry_points_gl_3_2_autogen.cpp:
9 //   Defines the GL 3.2 entry points.
10 
11 #include "libGL/entry_points_gl_3_2_autogen.h"
12 
13 #include "libANGLE/Context.h"
14 #include "libANGLE/Context.inl.h"
15 #include "libANGLE/entry_points_utils.h"
16 #include "libANGLE/gl_enum_utils_autogen.h"
17 #include "libANGLE/validationEGL.h"
18 #include "libANGLE/validationES.h"
19 #include "libANGLE/validationES1.h"
20 #include "libANGLE/validationES2.h"
21 #include "libANGLE/validationES3.h"
22 #include "libANGLE/validationES31.h"
23 #include "libANGLE/validationESEXT.h"
24 #include "libANGLE/validationGL32_autogen.h"
25 #include "libGLESv2/global_state.h"
26 
27 namespace gl
28 {
ClientWaitSync(GLsync sync,GLbitfield flags,GLuint64 timeout)29 GLenum GL_APIENTRY ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
30 {
31     EVENT("(GLsync sync = 0x%016" PRIxPTR ", GLbitfield flags = %s, GLuint64 timeout = %llu)",
32           (uintptr_t)sync, GLbitfieldToString(GLenumGroup::SyncObjectMask, flags).c_str(),
33           static_cast<unsigned long long>(timeout));
34 
35     Context *context = GetValidGlobalContext();
36     GLenum returnValue;
37     if (context)
38     {
39         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
40         bool isCallValid =
41             (context->skipValidation() || ValidateClientWaitSync(context, sync, flags, timeout));
42         if (isCallValid)
43         {
44             returnValue = context->clientWaitSync(sync, flags, timeout);
45         }
46         else
47         {
48             returnValue = GetDefaultReturnValue<EntryPoint::ClientWaitSync, GLenum>();
49         }
50         ANGLE_CAPTURE(ClientWaitSync, isCallValid, context, sync, flags, timeout, returnValue);
51     }
52     else
53     {
54         returnValue = GetDefaultReturnValue<EntryPoint::ClientWaitSync, GLenum>();
55     }
56     return returnValue;
57 }
58 
DeleteSync(GLsync sync)59 void GL_APIENTRY DeleteSync(GLsync sync)
60 {
61     EVENT("(GLsync sync = 0x%016" PRIxPTR ")", (uintptr_t)sync);
62 
63     Context *context = GetValidGlobalContext();
64     if (context)
65     {
66         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
67         bool isCallValid = (context->skipValidation() || ValidateDeleteSync(context, sync));
68         if (isCallValid)
69         {
70             context->deleteSync(sync);
71         }
72         ANGLE_CAPTURE(DeleteSync, isCallValid, context, sync);
73     }
74 }
75 
DrawElementsBaseVertex(GLenum mode,GLsizei count,GLenum type,const void * indices,GLint basevertex)76 void GL_APIENTRY DrawElementsBaseVertex(GLenum mode,
77                                         GLsizei count,
78                                         GLenum type,
79                                         const void *indices,
80                                         GLint basevertex)
81 {
82     EVENT(
83         "(GLenum mode = %s, GLsizei count = %d, GLenum type = %s, const void *indices = "
84         "0x%016" PRIxPTR ", GLint basevertex = %d)",
85         GLenumToString(GLenumGroup::PrimitiveType, mode), count,
86         GLenumToString(GLenumGroup::DrawElementsType, type), (uintptr_t)indices, basevertex);
87 
88     Context *context = GetValidGlobalContext();
89     if (context)
90     {
91         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
92         bool isCallValid =
93             (context->skipValidation() ||
94              ValidateDrawElementsBaseVertex(context, mode, count, type, indices, basevertex));
95         if (isCallValid)
96         {
97             context->drawElementsBaseVertex(mode, count, type, indices, basevertex);
98         }
99         ANGLE_CAPTURE(DrawElementsBaseVertex, isCallValid, context, mode, count, type, indices,
100                       basevertex);
101     }
102 }
103 
DrawElementsInstancedBaseVertex(GLenum mode,GLsizei count,GLenum type,const void * indices,GLsizei instancecount,GLint basevertex)104 void GL_APIENTRY DrawElementsInstancedBaseVertex(GLenum mode,
105                                                  GLsizei count,
106                                                  GLenum type,
107                                                  const void *indices,
108                                                  GLsizei instancecount,
109                                                  GLint basevertex)
110 {
111     EVENT(
112         "(GLenum mode = %s, GLsizei count = %d, GLenum type = %s, const void *indices = "
113         "0x%016" PRIxPTR ", GLsizei instancecount = %d, GLint basevertex = %d)",
114         GLenumToString(GLenumGroup::PrimitiveType, mode), count,
115         GLenumToString(GLenumGroup::DrawElementsType, type), (uintptr_t)indices, instancecount,
116         basevertex);
117 
118     Context *context = GetValidGlobalContext();
119     if (context)
120     {
121         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
122         bool isCallValid                              = (context->skipValidation() ||
123                             ValidateDrawElementsInstancedBaseVertex(
124                                 context, mode, count, type, indices, instancecount, basevertex));
125         if (isCallValid)
126         {
127             context->drawElementsInstancedBaseVertex(mode, count, type, indices, instancecount,
128                                                      basevertex);
129         }
130         ANGLE_CAPTURE(DrawElementsInstancedBaseVertex, isCallValid, context, mode, count, type,
131                       indices, instancecount, basevertex);
132     }
133 }
134 
DrawRangeElementsBaseVertex(GLenum mode,GLuint start,GLuint end,GLsizei count,GLenum type,const void * indices,GLint basevertex)135 void GL_APIENTRY DrawRangeElementsBaseVertex(GLenum mode,
136                                              GLuint start,
137                                              GLuint end,
138                                              GLsizei count,
139                                              GLenum type,
140                                              const void *indices,
141                                              GLint basevertex)
142 {
143     EVENT(
144         "(GLenum mode = %s, GLuint start = %u, GLuint end = %u, GLsizei count = %d, GLenum type = "
145         "%s, const void *indices = 0x%016" PRIxPTR ", GLint basevertex = %d)",
146         GLenumToString(GLenumGroup::PrimitiveType, mode), start, end, count,
147         GLenumToString(GLenumGroup::DrawElementsType, type), (uintptr_t)indices, basevertex);
148 
149     Context *context = GetValidGlobalContext();
150     if (context)
151     {
152         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
153         bool isCallValid                              = (context->skipValidation() ||
154                             ValidateDrawRangeElementsBaseVertex(context, mode, start, end, count,
155                                                                 type, indices, basevertex));
156         if (isCallValid)
157         {
158             context->drawRangeElementsBaseVertex(mode, start, end, count, type, indices,
159                                                  basevertex);
160         }
161         ANGLE_CAPTURE(DrawRangeElementsBaseVertex, isCallValid, context, mode, start, end, count,
162                       type, indices, basevertex);
163     }
164 }
165 
FenceSync(GLenum condition,GLbitfield flags)166 GLsync GL_APIENTRY FenceSync(GLenum condition, GLbitfield flags)
167 {
168     EVENT("(GLenum condition = %s, GLbitfield flags = %s)",
169           GLenumToString(GLenumGroup::SyncCondition, condition),
170           GLbitfieldToString(GLenumGroup::DefaultGroup, flags).c_str());
171 
172     Context *context = GetValidGlobalContext();
173     GLsync returnValue;
174     if (context)
175     {
176         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
177         bool isCallValid =
178             (context->skipValidation() || ValidateFenceSync(context, condition, flags));
179         if (isCallValid)
180         {
181             returnValue = context->fenceSync(condition, flags);
182         }
183         else
184         {
185             returnValue = GetDefaultReturnValue<EntryPoint::FenceSync, GLsync>();
186         }
187         ANGLE_CAPTURE(FenceSync, isCallValid, context, condition, flags, returnValue);
188     }
189     else
190     {
191         returnValue = GetDefaultReturnValue<EntryPoint::FenceSync, GLsync>();
192     }
193     return returnValue;
194 }
195 
FramebufferTexture(GLenum target,GLenum attachment,GLuint texture,GLint level)196 void GL_APIENTRY FramebufferTexture(GLenum target, GLenum attachment, GLuint texture, GLint level)
197 {
198     EVENT("(GLenum target = %s, GLenum attachment = %s, GLuint texture = %u, GLint level = %d)",
199           GLenumToString(GLenumGroup::FramebufferTarget, target),
200           GLenumToString(GLenumGroup::FramebufferAttachment, attachment), texture, level);
201 
202     Context *context = GetValidGlobalContext();
203     if (context)
204     {
205         TextureID texturePacked                       = FromGL<TextureID>(texture);
206         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
207         bool isCallValid =
208             (context->skipValidation() ||
209              ValidateFramebufferTexture(context, target, attachment, texturePacked, level));
210         if (isCallValid)
211         {
212             context->framebufferTexture(target, attachment, texturePacked, level);
213         }
214         ANGLE_CAPTURE(FramebufferTexture, isCallValid, context, target, attachment, texturePacked,
215                       level);
216     }
217 }
218 
GetBufferParameteri64v(GLenum target,GLenum pname,GLint64 * params)219 void GL_APIENTRY GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params)
220 {
221     EVENT("(GLenum target = %s, GLenum pname = %s, GLint64 *params = 0x%016" PRIxPTR ")",
222           GLenumToString(GLenumGroup::BufferTargetARB, target),
223           GLenumToString(GLenumGroup::DefaultGroup, pname), (uintptr_t)params);
224 
225     Context *context = GetValidGlobalContext();
226     if (context)
227     {
228         BufferBinding targetPacked                    = FromGL<BufferBinding>(target);
229         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
230         bool isCallValid                              = (context->skipValidation() ||
231                             ValidateGetBufferParameteri64v(context, targetPacked, pname, params));
232         if (isCallValid)
233         {
234             context->getBufferParameteri64v(targetPacked, pname, params);
235         }
236         ANGLE_CAPTURE(GetBufferParameteri64v, isCallValid, context, targetPacked, pname, params);
237     }
238 }
239 
GetInteger64i_v(GLenum target,GLuint index,GLint64 * data)240 void GL_APIENTRY GetInteger64i_v(GLenum target, GLuint index, GLint64 *data)
241 {
242     EVENT("(GLenum target = %s, GLuint index = %u, GLint64 *data = 0x%016" PRIxPTR ")",
243           GLenumToString(GLenumGroup::TypeEnum, target), index, (uintptr_t)data);
244 
245     Context *context = GetValidGlobalContext();
246     if (context)
247     {
248         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
249         bool isCallValid =
250             (context->skipValidation() || ValidateGetInteger64i_v(context, target, index, data));
251         if (isCallValid)
252         {
253             context->getInteger64i_v(target, index, data);
254         }
255         ANGLE_CAPTURE(GetInteger64i_v, isCallValid, context, target, index, data);
256     }
257 }
258 
GetInteger64v(GLenum pname,GLint64 * data)259 void GL_APIENTRY GetInteger64v(GLenum pname, GLint64 *data)
260 {
261     EVENT("(GLenum pname = %s, GLint64 *data = 0x%016" PRIxPTR ")",
262           GLenumToString(GLenumGroup::GetPName, pname), (uintptr_t)data);
263 
264     Context *context = GetValidGlobalContext();
265     if (context)
266     {
267         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
268         bool isCallValid =
269             (context->skipValidation() || ValidateGetInteger64v(context, pname, data));
270         if (isCallValid)
271         {
272             context->getInteger64v(pname, data);
273         }
274         ANGLE_CAPTURE(GetInteger64v, isCallValid, context, pname, data);
275     }
276 }
277 
GetMultisamplefv(GLenum pname,GLuint index,GLfloat * val)278 void GL_APIENTRY GetMultisamplefv(GLenum pname, GLuint index, GLfloat *val)
279 {
280     EVENT("(GLenum pname = %s, GLuint index = %u, GLfloat *val = 0x%016" PRIxPTR ")",
281           GLenumToString(GLenumGroup::DefaultGroup, pname), index, (uintptr_t)val);
282 
283     Context *context = GetValidGlobalContext();
284     if (context)
285     {
286         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
287         bool isCallValid =
288             (context->skipValidation() || ValidateGetMultisamplefv(context, pname, index, val));
289         if (isCallValid)
290         {
291             context->getMultisamplefv(pname, index, val);
292         }
293         ANGLE_CAPTURE(GetMultisamplefv, isCallValid, context, pname, index, val);
294     }
295 }
296 
297 void GL_APIENTRY
GetSynciv(GLsync sync,GLenum pname,GLsizei bufSize,GLsizei * length,GLint * values)298 GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values)
299 {
300     EVENT("(GLsync sync = 0x%016" PRIxPTR
301           ", GLenum pname = %s, GLsizei bufSize = %d, GLsizei *length = 0x%016" PRIxPTR
302           ", GLint *values = 0x%016" PRIxPTR ")",
303           (uintptr_t)sync, GLenumToString(GLenumGroup::SyncParameterName, pname), bufSize,
304           (uintptr_t)length, (uintptr_t)values);
305 
306     Context *context = GetGlobalContext();
307     if (context)
308     {
309         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
310         bool isCallValid                              = (context->skipValidation() ||
311                             ValidateGetSynciv(context, sync, pname, bufSize, length, values));
312         if (isCallValid)
313         {
314             context->getSynciv(sync, pname, bufSize, length, values);
315         }
316         ANGLE_CAPTURE(GetSynciv, isCallValid, context, sync, pname, bufSize, length, values);
317     }
318 }
319 
IsSync(GLsync sync)320 GLboolean GL_APIENTRY IsSync(GLsync sync)
321 {
322     EVENT("(GLsync sync = 0x%016" PRIxPTR ")", (uintptr_t)sync);
323 
324     Context *context = GetValidGlobalContext();
325     GLboolean returnValue;
326     if (context)
327     {
328         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
329         bool isCallValid = (context->skipValidation() || ValidateIsSync(context, sync));
330         if (isCallValid)
331         {
332             returnValue = context->isSync(sync);
333         }
334         else
335         {
336             returnValue = GetDefaultReturnValue<EntryPoint::IsSync, GLboolean>();
337         }
338         ANGLE_CAPTURE(IsSync, isCallValid, context, sync, returnValue);
339     }
340     else
341     {
342         returnValue = GetDefaultReturnValue<EntryPoint::IsSync, GLboolean>();
343     }
344     return returnValue;
345 }
346 
MultiDrawElementsBaseVertex(GLenum mode,const GLsizei * count,GLenum type,const void * const * indices,GLsizei drawcount,const GLint * basevertex)347 void GL_APIENTRY MultiDrawElementsBaseVertex(GLenum mode,
348                                              const GLsizei *count,
349                                              GLenum type,
350                                              const void *const *indices,
351                                              GLsizei drawcount,
352                                              const GLint *basevertex)
353 {
354     EVENT("(GLenum mode = %s, const GLsizei *count = 0x%016" PRIxPTR
355           ", GLenum type = %s, const void *const*indices = 0x%016" PRIxPTR
356           ", GLsizei drawcount = %d, const GLint *basevertex = 0x%016" PRIxPTR ")",
357           GLenumToString(GLenumGroup::PrimitiveType, mode), (uintptr_t)count,
358           GLenumToString(GLenumGroup::DrawElementsType, type), (uintptr_t)indices, drawcount,
359           (uintptr_t)basevertex);
360 
361     Context *context = GetValidGlobalContext();
362     if (context)
363     {
364         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
365         bool isCallValid                              = (context->skipValidation() ||
366                             ValidateMultiDrawElementsBaseVertex(context, mode, count, type, indices,
367                                                                 drawcount, basevertex));
368         if (isCallValid)
369         {
370             context->multiDrawElementsBaseVertex(mode, count, type, indices, drawcount, basevertex);
371         }
372         ANGLE_CAPTURE(MultiDrawElementsBaseVertex, isCallValid, context, mode, count, type, indices,
373                       drawcount, basevertex);
374     }
375 }
376 
ProvokingVertex(GLenum mode)377 void GL_APIENTRY ProvokingVertex(GLenum mode)
378 {
379     EVENT("(GLenum mode = %s)", GLenumToString(GLenumGroup::VertexProvokingMode, mode));
380 
381     Context *context = GetValidGlobalContext();
382     if (context)
383     {
384         ProvokingVertexConvention modePacked          = FromGL<ProvokingVertexConvention>(mode);
385         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
386         bool isCallValid =
387             (context->skipValidation() || ValidateProvokingVertex(context, modePacked));
388         if (isCallValid)
389         {
390             context->provokingVertex(modePacked);
391         }
392         ANGLE_CAPTURE(ProvokingVertex, isCallValid, context, modePacked);
393     }
394 }
395 
SampleMaski(GLuint maskNumber,GLbitfield mask)396 void GL_APIENTRY SampleMaski(GLuint maskNumber, GLbitfield mask)
397 {
398     EVENT("(GLuint maskNumber = %u, GLbitfield mask = %s)", maskNumber,
399           GLbitfieldToString(GLenumGroup::DefaultGroup, mask).c_str());
400 
401     Context *context = GetValidGlobalContext();
402     if (context)
403     {
404         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
405         bool isCallValid =
406             (context->skipValidation() || ValidateSampleMaski(context, maskNumber, mask));
407         if (isCallValid)
408         {
409             context->sampleMaski(maskNumber, mask);
410         }
411         ANGLE_CAPTURE(SampleMaski, isCallValid, context, maskNumber, mask);
412     }
413 }
414 
TexImage2DMultisample(GLenum target,GLsizei samples,GLenum internalformat,GLsizei width,GLsizei height,GLboolean fixedsamplelocations)415 void GL_APIENTRY TexImage2DMultisample(GLenum target,
416                                        GLsizei samples,
417                                        GLenum internalformat,
418                                        GLsizei width,
419                                        GLsizei height,
420                                        GLboolean fixedsamplelocations)
421 {
422     EVENT(
423         "(GLenum target = %s, GLsizei samples = %d, GLenum internalformat = %s, GLsizei width = "
424         "%d, GLsizei height = %d, GLboolean fixedsamplelocations = %s)",
425         GLenumToString(GLenumGroup::TextureTarget, target), samples,
426         GLenumToString(GLenumGroup::InternalFormat, internalformat), width, height,
427         GLbooleanToString(fixedsamplelocations));
428 
429     Context *context = GetValidGlobalContext();
430     if (context)
431     {
432         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
433         bool isCallValid                              = (context->skipValidation() ||
434                             ValidateTexImage2DMultisample(context, target, samples, internalformat,
435                                                           width, height, fixedsamplelocations));
436         if (isCallValid)
437         {
438             context->texImage2DMultisample(target, samples, internalformat, width, height,
439                                            fixedsamplelocations);
440         }
441         ANGLE_CAPTURE(TexImage2DMultisample, isCallValid, context, target, samples, internalformat,
442                       width, height, fixedsamplelocations);
443     }
444 }
445 
TexImage3DMultisample(GLenum target,GLsizei samples,GLenum internalformat,GLsizei width,GLsizei height,GLsizei depth,GLboolean fixedsamplelocations)446 void GL_APIENTRY TexImage3DMultisample(GLenum target,
447                                        GLsizei samples,
448                                        GLenum internalformat,
449                                        GLsizei width,
450                                        GLsizei height,
451                                        GLsizei depth,
452                                        GLboolean fixedsamplelocations)
453 {
454     EVENT(
455         "(GLenum target = %s, GLsizei samples = %d, GLenum internalformat = %s, GLsizei width = "
456         "%d, GLsizei height = %d, GLsizei depth = %d, GLboolean fixedsamplelocations = %s)",
457         GLenumToString(GLenumGroup::TextureTarget, target), samples,
458         GLenumToString(GLenumGroup::InternalFormat, internalformat), width, height, depth,
459         GLbooleanToString(fixedsamplelocations));
460 
461     Context *context = GetValidGlobalContext();
462     if (context)
463     {
464         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
465         bool isCallValid =
466             (context->skipValidation() ||
467              ValidateTexImage3DMultisample(context, target, samples, internalformat, width, height,
468                                            depth, fixedsamplelocations));
469         if (isCallValid)
470         {
471             context->texImage3DMultisample(target, samples, internalformat, width, height, depth,
472                                            fixedsamplelocations);
473         }
474         ANGLE_CAPTURE(TexImage3DMultisample, isCallValid, context, target, samples, internalformat,
475                       width, height, depth, fixedsamplelocations);
476     }
477 }
478 
WaitSync(GLsync sync,GLbitfield flags,GLuint64 timeout)479 void GL_APIENTRY WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
480 {
481     EVENT("(GLsync sync = 0x%016" PRIxPTR ", GLbitfield flags = %s, GLuint64 timeout = %llu)",
482           (uintptr_t)sync, GLbitfieldToString(GLenumGroup::DefaultGroup, flags).c_str(),
483           static_cast<unsigned long long>(timeout));
484 
485     Context *context = GetValidGlobalContext();
486     if (context)
487     {
488         std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
489         bool isCallValid =
490             (context->skipValidation() || ValidateWaitSync(context, sync, flags, timeout));
491         if (isCallValid)
492         {
493             context->waitSync(sync, flags, timeout);
494         }
495         ANGLE_CAPTURE(WaitSync, isCallValid, context, sync, flags, timeout);
496     }
497 }
498 }  // namespace gl
499