1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by generate_entry_points.py using data from gl.xml.
3 //
4 // Copyright 2020 The ANGLE Project Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style license that can be
6 // found in the LICENSE file.
7 //
8 // entry_points_gl_1_5_autogen.cpp:
9 // Defines the GL 1.5 entry points.
10
11 #include "libGL/entry_points_gl_1_5_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.h"
17 #include "libANGLE/validationEGL.h"
18 #include "libANGLE/validationES.h"
19 #include "libANGLE/validationES1.h"
20 #include "libANGLE/validationES2.h"
21 #include "libANGLE/validationES3.h"
22 #include "libANGLE/validationES31.h"
23 #include "libANGLE/validationES32.h"
24 #include "libANGLE/validationESEXT.h"
25 #include "libANGLE/validationGL15_autogen.h"
26 #include "libGLESv2/global_state.h"
27
28 namespace gl
29 {
BeginQuery(GLenum target,GLuint id)30 void GL_APIENTRY BeginQuery(GLenum target, GLuint id)
31 {
32 Context *context = GetValidGlobalContext();
33 EVENT("glBeginQuery", "context = %d, GLenum target = %s, GLuint id = %u", CID(context),
34 GLenumToString(GLenumGroup::QueryTarget, target), id);
35
36 if (context)
37 {
38 QueryType targetPacked = FromGL<QueryType>(target);
39 QueryID idPacked = FromGL<QueryID>(id);
40 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
41 bool isCallValid =
42 (context->skipValidation() || ValidateBeginQuery(context, targetPacked, idPacked));
43 if (isCallValid)
44 {
45 context->beginQuery(targetPacked, idPacked);
46 }
47 ANGLE_CAPTURE(BeginQuery, isCallValid, context, targetPacked, idPacked);
48 }
49 }
50
BindBuffer(GLenum target,GLuint buffer)51 void GL_APIENTRY BindBuffer(GLenum target, GLuint buffer)
52 {
53 Context *context = GetValidGlobalContext();
54 EVENT("glBindBuffer", "context = %d, GLenum target = %s, GLuint buffer = %u", CID(context),
55 GLenumToString(GLenumGroup::BufferTargetARB, target), buffer);
56
57 if (context)
58 {
59 BufferBinding targetPacked = FromGL<BufferBinding>(target);
60 BufferID bufferPacked = FromGL<BufferID>(buffer);
61 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
62 bool isCallValid =
63 (context->skipValidation() || ValidateBindBuffer(context, targetPacked, bufferPacked));
64 if (isCallValid)
65 {
66 context->bindBuffer(targetPacked, bufferPacked);
67 }
68 ANGLE_CAPTURE(BindBuffer, isCallValid, context, targetPacked, bufferPacked);
69 }
70 }
71
BufferData(GLenum target,GLsizeiptr size,const void * data,GLenum usage)72 void GL_APIENTRY BufferData(GLenum target, GLsizeiptr size, const void *data, GLenum usage)
73 {
74 Context *context = GetValidGlobalContext();
75 EVENT("glBufferData",
76 "context = %d, GLenum target = %s, GLsizeiptr size = %llu, const void *data = "
77 "0x%016" PRIxPTR ", GLenum usage = %s",
78 CID(context), GLenumToString(GLenumGroup::BufferTargetARB, target),
79 static_cast<unsigned long long>(size), (uintptr_t)data,
80 GLenumToString(GLenumGroup::BufferUsageARB, usage));
81
82 if (context)
83 {
84 BufferBinding targetPacked = FromGL<BufferBinding>(target);
85 BufferUsage usagePacked = FromGL<BufferUsage>(usage);
86 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
87 bool isCallValid = (context->skipValidation() ||
88 ValidateBufferData(context, targetPacked, size, data, usagePacked));
89 if (isCallValid)
90 {
91 context->bufferData(targetPacked, size, data, usagePacked);
92 }
93 ANGLE_CAPTURE(BufferData, isCallValid, context, targetPacked, size, data, usagePacked);
94 }
95 }
96
BufferSubData(GLenum target,GLintptr offset,GLsizeiptr size,const void * data)97 void GL_APIENTRY BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void *data)
98 {
99 Context *context = GetValidGlobalContext();
100 EVENT("glBufferSubData",
101 "context = %d, GLenum target = %s, GLintptr offset = %llu, GLsizeiptr size = %llu, const "
102 "void *data = 0x%016" PRIxPTR "",
103 CID(context), GLenumToString(GLenumGroup::BufferTargetARB, target),
104 static_cast<unsigned long long>(offset), static_cast<unsigned long long>(size),
105 (uintptr_t)data);
106
107 if (context)
108 {
109 BufferBinding targetPacked = FromGL<BufferBinding>(target);
110 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
111 bool isCallValid = (context->skipValidation() ||
112 ValidateBufferSubData(context, targetPacked, offset, size, data));
113 if (isCallValid)
114 {
115 context->bufferSubData(targetPacked, offset, size, data);
116 }
117 ANGLE_CAPTURE(BufferSubData, isCallValid, context, targetPacked, offset, size, data);
118 }
119 }
120
DeleteBuffers(GLsizei n,const GLuint * buffers)121 void GL_APIENTRY DeleteBuffers(GLsizei n, const GLuint *buffers)
122 {
123 Context *context = GetValidGlobalContext();
124 EVENT("glDeleteBuffers",
125 "context = %d, GLsizei n = %d, const GLuint *buffers = 0x%016" PRIxPTR "", CID(context),
126 n, (uintptr_t)buffers);
127
128 if (context)
129 {
130 const BufferID *buffersPacked = FromGL<const BufferID *>(buffers);
131 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
132 bool isCallValid =
133 (context->skipValidation() || ValidateDeleteBuffers(context, n, buffersPacked));
134 if (isCallValid)
135 {
136 context->deleteBuffers(n, buffersPacked);
137 }
138 ANGLE_CAPTURE(DeleteBuffers, isCallValid, context, n, buffersPacked);
139 }
140 }
141
DeleteQueries(GLsizei n,const GLuint * ids)142 void GL_APIENTRY DeleteQueries(GLsizei n, const GLuint *ids)
143 {
144 Context *context = GetValidGlobalContext();
145 EVENT("glDeleteQueries", "context = %d, GLsizei n = %d, const GLuint *ids = 0x%016" PRIxPTR "",
146 CID(context), n, (uintptr_t)ids);
147
148 if (context)
149 {
150 const QueryID *idsPacked = FromGL<const QueryID *>(ids);
151 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
152 bool isCallValid =
153 (context->skipValidation() || ValidateDeleteQueries(context, n, idsPacked));
154 if (isCallValid)
155 {
156 context->deleteQueries(n, idsPacked);
157 }
158 ANGLE_CAPTURE(DeleteQueries, isCallValid, context, n, idsPacked);
159 }
160 }
161
EndQuery(GLenum target)162 void GL_APIENTRY EndQuery(GLenum target)
163 {
164 Context *context = GetValidGlobalContext();
165 EVENT("glEndQuery", "context = %d, GLenum target = %s", CID(context),
166 GLenumToString(GLenumGroup::QueryTarget, target));
167
168 if (context)
169 {
170 QueryType targetPacked = FromGL<QueryType>(target);
171 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
172 bool isCallValid = (context->skipValidation() || ValidateEndQuery(context, targetPacked));
173 if (isCallValid)
174 {
175 context->endQuery(targetPacked);
176 }
177 ANGLE_CAPTURE(EndQuery, isCallValid, context, targetPacked);
178 }
179 }
180
GenBuffers(GLsizei n,GLuint * buffers)181 void GL_APIENTRY GenBuffers(GLsizei n, GLuint *buffers)
182 {
183 Context *context = GetValidGlobalContext();
184 EVENT("glGenBuffers", "context = %d, GLsizei n = %d, GLuint *buffers = 0x%016" PRIxPTR "",
185 CID(context), n, (uintptr_t)buffers);
186
187 if (context)
188 {
189 BufferID *buffersPacked = FromGL<BufferID *>(buffers);
190 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
191 bool isCallValid =
192 (context->skipValidation() || ValidateGenBuffers(context, n, buffersPacked));
193 if (isCallValid)
194 {
195 context->genBuffers(n, buffersPacked);
196 }
197 ANGLE_CAPTURE(GenBuffers, isCallValid, context, n, buffersPacked);
198 }
199 }
200
GenQueries(GLsizei n,GLuint * ids)201 void GL_APIENTRY GenQueries(GLsizei n, GLuint *ids)
202 {
203 Context *context = GetValidGlobalContext();
204 EVENT("glGenQueries", "context = %d, GLsizei n = %d, GLuint *ids = 0x%016" PRIxPTR "",
205 CID(context), n, (uintptr_t)ids);
206
207 if (context)
208 {
209 QueryID *idsPacked = FromGL<QueryID *>(ids);
210 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
211 bool isCallValid = (context->skipValidation() || ValidateGenQueries(context, n, idsPacked));
212 if (isCallValid)
213 {
214 context->genQueries(n, idsPacked);
215 }
216 ANGLE_CAPTURE(GenQueries, isCallValid, context, n, idsPacked);
217 }
218 }
219
GetBufferParameteriv(GLenum target,GLenum pname,GLint * params)220 void GL_APIENTRY GetBufferParameteriv(GLenum target, GLenum pname, GLint *params)
221 {
222 Context *context = GetValidGlobalContext();
223 EVENT("glGetBufferParameteriv",
224 "context = %d, GLenum target = %s, GLenum pname = %s, GLint *params = 0x%016" PRIxPTR "",
225 CID(context), GLenumToString(GLenumGroup::BufferTargetARB, target),
226 GLenumToString(GLenumGroup::DefaultGroup, pname), (uintptr_t)params);
227
228 if (context)
229 {
230 BufferBinding targetPacked = FromGL<BufferBinding>(target);
231 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
232 bool isCallValid = (context->skipValidation() ||
233 ValidateGetBufferParameteriv(context, targetPacked, pname, params));
234 if (isCallValid)
235 {
236 context->getBufferParameteriv(targetPacked, pname, params);
237 }
238 ANGLE_CAPTURE(GetBufferParameteriv, isCallValid, context, targetPacked, pname, params);
239 }
240 }
241
GetBufferPointerv(GLenum target,GLenum pname,void ** params)242 void GL_APIENTRY GetBufferPointerv(GLenum target, GLenum pname, void **params)
243 {
244 Context *context = GetValidGlobalContext();
245 EVENT("glGetBufferPointerv",
246 "context = %d, GLenum target = %s, GLenum pname = %s, void **params = 0x%016" PRIxPTR "",
247 CID(context), GLenumToString(GLenumGroup::BufferTargetARB, target),
248 GLenumToString(GLenumGroup::DefaultGroup, pname), (uintptr_t)params);
249
250 if (context)
251 {
252 BufferBinding targetPacked = FromGL<BufferBinding>(target);
253 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
254 bool isCallValid = (context->skipValidation() ||
255 ValidateGetBufferPointerv(context, targetPacked, pname, params));
256 if (isCallValid)
257 {
258 context->getBufferPointerv(targetPacked, pname, params);
259 }
260 ANGLE_CAPTURE(GetBufferPointerv, isCallValid, context, targetPacked, pname, params);
261 }
262 }
263
GetBufferSubData(GLenum target,GLintptr offset,GLsizeiptr size,void * data)264 void GL_APIENTRY GetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, void *data)
265 {
266 Context *context = GetValidGlobalContext();
267 EVENT("glGetBufferSubData",
268 "context = %d, GLenum target = %s, GLintptr offset = %llu, GLsizeiptr size = %llu, void "
269 "*data = 0x%016" PRIxPTR "",
270 CID(context), GLenumToString(GLenumGroup::BufferTargetARB, target),
271 static_cast<unsigned long long>(offset), static_cast<unsigned long long>(size),
272 (uintptr_t)data);
273
274 if (context)
275 {
276 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
277 bool isCallValid = (context->skipValidation() ||
278 ValidateGetBufferSubData(context, target, offset, size, data));
279 if (isCallValid)
280 {
281 context->getBufferSubData(target, offset, size, data);
282 }
283 ANGLE_CAPTURE(GetBufferSubData, isCallValid, context, target, offset, size, data);
284 }
285 }
286
GetQueryObjectiv(GLuint id,GLenum pname,GLint * params)287 void GL_APIENTRY GetQueryObjectiv(GLuint id, GLenum pname, GLint *params)
288 {
289 Context *context = GetGlobalContext();
290 EVENT("glGetQueryObjectiv",
291 "context = %d, GLuint id = %u, GLenum pname = %s, GLint *params = 0x%016" PRIxPTR "",
292 CID(context), id, GLenumToString(GLenumGroup::QueryObjectParameterName, pname),
293 (uintptr_t)params);
294
295 if (context)
296 {
297 QueryID idPacked = FromGL<QueryID>(id);
298 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
299 bool isCallValid = (context->skipValidation() ||
300 ValidateGetQueryObjectiv(context, idPacked, pname, params));
301 if (isCallValid)
302 {
303 context->getQueryObjectiv(idPacked, pname, params);
304 }
305 ANGLE_CAPTURE(GetQueryObjectiv, isCallValid, context, idPacked, pname, params);
306 }
307 }
308
GetQueryObjectuiv(GLuint id,GLenum pname,GLuint * params)309 void GL_APIENTRY GetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params)
310 {
311 Context *context = GetValidGlobalContext();
312 EVENT("glGetQueryObjectuiv",
313 "context = %d, GLuint id = %u, GLenum pname = %s, GLuint *params = 0x%016" PRIxPTR "",
314 CID(context), id, GLenumToString(GLenumGroup::QueryObjectParameterName, pname),
315 (uintptr_t)params);
316
317 if (context)
318 {
319 QueryID idPacked = FromGL<QueryID>(id);
320 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
321 bool isCallValid = (context->skipValidation() ||
322 ValidateGetQueryObjectuiv(context, idPacked, pname, params));
323 if (isCallValid)
324 {
325 context->getQueryObjectuiv(idPacked, pname, params);
326 }
327 ANGLE_CAPTURE(GetQueryObjectuiv, isCallValid, context, idPacked, pname, params);
328 }
329 }
330
GetQueryiv(GLenum target,GLenum pname,GLint * params)331 void GL_APIENTRY GetQueryiv(GLenum target, GLenum pname, GLint *params)
332 {
333 Context *context = GetValidGlobalContext();
334 EVENT("glGetQueryiv",
335 "context = %d, GLenum target = %s, GLenum pname = %s, GLint *params = 0x%016" PRIxPTR "",
336 CID(context), GLenumToString(GLenumGroup::QueryTarget, target),
337 GLenumToString(GLenumGroup::QueryParameterName, pname), (uintptr_t)params);
338
339 if (context)
340 {
341 QueryType targetPacked = FromGL<QueryType>(target);
342 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
343 bool isCallValid =
344 (context->skipValidation() || ValidateGetQueryiv(context, targetPacked, pname, params));
345 if (isCallValid)
346 {
347 context->getQueryiv(targetPacked, pname, params);
348 }
349 ANGLE_CAPTURE(GetQueryiv, isCallValid, context, targetPacked, pname, params);
350 }
351 }
352
IsBuffer(GLuint buffer)353 GLboolean GL_APIENTRY IsBuffer(GLuint buffer)
354 {
355 Context *context = GetValidGlobalContext();
356 EVENT("glIsBuffer", "context = %d, GLuint buffer = %u", CID(context), buffer);
357
358 GLboolean returnValue;
359 if (context)
360 {
361 BufferID bufferPacked = FromGL<BufferID>(buffer);
362 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
363 bool isCallValid = (context->skipValidation() || ValidateIsBuffer(context, bufferPacked));
364 if (isCallValid)
365 {
366 returnValue = context->isBuffer(bufferPacked);
367 }
368 else
369 {
370 returnValue = GetDefaultReturnValue<EntryPoint::IsBuffer, GLboolean>();
371 }
372 ANGLE_CAPTURE(IsBuffer, isCallValid, context, bufferPacked, returnValue);
373 }
374 else
375 {
376 returnValue = GetDefaultReturnValue<EntryPoint::IsBuffer, GLboolean>();
377 }
378 return returnValue;
379 }
380
IsQuery(GLuint id)381 GLboolean GL_APIENTRY IsQuery(GLuint id)
382 {
383 Context *context = GetValidGlobalContext();
384 EVENT("glIsQuery", "context = %d, GLuint id = %u", CID(context), id);
385
386 GLboolean returnValue;
387 if (context)
388 {
389 QueryID idPacked = FromGL<QueryID>(id);
390 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
391 bool isCallValid = (context->skipValidation() || ValidateIsQuery(context, idPacked));
392 if (isCallValid)
393 {
394 returnValue = context->isQuery(idPacked);
395 }
396 else
397 {
398 returnValue = GetDefaultReturnValue<EntryPoint::IsQuery, GLboolean>();
399 }
400 ANGLE_CAPTURE(IsQuery, isCallValid, context, idPacked, returnValue);
401 }
402 else
403 {
404 returnValue = GetDefaultReturnValue<EntryPoint::IsQuery, GLboolean>();
405 }
406 return returnValue;
407 }
408
MapBuffer(GLenum target,GLenum access)409 void *GL_APIENTRY MapBuffer(GLenum target, GLenum access)
410 {
411 Context *context = GetValidGlobalContext();
412 EVENT("glMapBuffer", "context = %d, GLenum target = %s, GLenum access = %s", CID(context),
413 GLenumToString(GLenumGroup::BufferTargetARB, target),
414 GLenumToString(GLenumGroup::BufferAccessARB, access));
415
416 void *returnValue;
417 if (context)
418 {
419 BufferBinding targetPacked = FromGL<BufferBinding>(target);
420 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
421 bool isCallValid =
422 (context->skipValidation() || ValidateMapBuffer(context, targetPacked, access));
423 if (isCallValid)
424 {
425 returnValue = context->mapBuffer(targetPacked, access);
426 }
427 else
428 {
429 returnValue = GetDefaultReturnValue<EntryPoint::MapBuffer, void *>();
430 }
431 ANGLE_CAPTURE(MapBuffer, isCallValid, context, targetPacked, access, returnValue);
432 }
433 else
434 {
435 returnValue = GetDefaultReturnValue<EntryPoint::MapBuffer, void *>();
436 }
437 return returnValue;
438 }
439
UnmapBuffer(GLenum target)440 GLboolean GL_APIENTRY UnmapBuffer(GLenum target)
441 {
442 Context *context = GetValidGlobalContext();
443 EVENT("glUnmapBuffer", "context = %d, GLenum target = %s", CID(context),
444 GLenumToString(GLenumGroup::BufferTargetARB, target));
445
446 GLboolean returnValue;
447 if (context)
448 {
449 BufferBinding targetPacked = FromGL<BufferBinding>(target);
450 std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
451 bool isCallValid =
452 (context->skipValidation() || ValidateUnmapBuffer(context, targetPacked));
453 if (isCallValid)
454 {
455 returnValue = context->unmapBuffer(targetPacked);
456 }
457 else
458 {
459 returnValue = GetDefaultReturnValue<EntryPoint::UnmapBuffer, GLboolean>();
460 }
461 ANGLE_CAPTURE(UnmapBuffer, isCallValid, context, targetPacked, returnValue);
462 }
463 else
464 {
465 returnValue = GetDefaultReturnValue<EntryPoint::UnmapBuffer, GLboolean>();
466 }
467 return returnValue;
468 }
469 } // namespace gl
470