• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by generate_entry_points.py using data from egl.xml and egl_angle_ext.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_egl_ext_autogen.cpp:
9 //   Defines the EGL Extension entry points.
10 
11 #include "libGLESv2/entry_points_egl_ext_autogen.h"
12 
13 #include "libANGLE/entry_points_utils.h"
14 #include "libANGLE/validationEGL_autogen.h"
15 #include "libGLESv2/egl_ext_stubs_autogen.h"
16 #include "libGLESv2/global_state.h"
17 
18 using namespace egl;
19 
20 extern "C" {
21 
22 // EGL_ANDROID_blob_cache
EGL_SetBlobCacheFuncsANDROID(EGLDisplay dpy,EGLSetBlobFuncANDROID set,EGLGetBlobFuncANDROID get)23 void EGLAPIENTRY EGL_SetBlobCacheFuncsANDROID(EGLDisplay dpy,
24                                               EGLSetBlobFuncANDROID set,
25                                               EGLGetBlobFuncANDROID get)
26 {
27     ANGLE_SCOPED_GLOBAL_LOCK();
28     EGL_EVENT(SetBlobCacheFuncsANDROID,
29               "dpy = 0x%016" PRIxPTR ", set = 0x%016" PRIxPTR ", get = 0x%016" PRIxPTR "",
30               (uintptr_t)dpy, (uintptr_t)set, (uintptr_t)get);
31 
32     Thread *thread = egl::GetCurrentThread();
33 
34     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
35 
36     ANGLE_EGL_VALIDATE_VOID(thread, SetBlobCacheFuncsANDROID, GetDisplayIfValid(dpyPacked),
37                             dpyPacked, set, get);
38 
39     SetBlobCacheFuncsANDROID(thread, dpyPacked, set, get);
40 }
41 
42 // EGL_ANDROID_create_native_client_buffer
EGL_CreateNativeClientBufferANDROID(const EGLint * attrib_list)43 EGLClientBuffer EGLAPIENTRY EGL_CreateNativeClientBufferANDROID(const EGLint *attrib_list)
44 {
45     ANGLE_SCOPED_GLOBAL_LOCK();
46     EGL_EVENT(CreateNativeClientBufferANDROID, "attrib_list = 0x%016" PRIxPTR "",
47               (uintptr_t)attrib_list);
48 
49     Thread *thread = egl::GetCurrentThread();
50 
51     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
52 
53     ANGLE_EGL_VALIDATE(thread, CreateNativeClientBufferANDROID, nullptr, EGLClientBuffer,
54                        attrib_listPacked);
55 
56     return CreateNativeClientBufferANDROID(thread, attrib_listPacked);
57 }
58 
59 // EGL_ANDROID_get_frame_timestamps
EGL_GetCompositorTimingSupportedANDROID(EGLDisplay dpy,EGLSurface surface,EGLint name)60 EGLBoolean EGLAPIENTRY EGL_GetCompositorTimingSupportedANDROID(EGLDisplay dpy,
61                                                                EGLSurface surface,
62                                                                EGLint name)
63 {
64     ANGLE_SCOPED_GLOBAL_LOCK();
65     EGL_EVENT(GetCompositorTimingSupportedANDROID,
66               "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", name = %d", (uintptr_t)dpy,
67               (uintptr_t)surface, name);
68 
69     Thread *thread = egl::GetCurrentThread();
70 
71     egl::Display *dpyPacked     = PackParam<egl::Display *>(dpy);
72     Surface *surfacePacked      = PackParam<Surface *>(surface);
73     CompositorTiming namePacked = PackParam<CompositorTiming>(name);
74 
75     ANGLE_EGL_VALIDATE(thread, GetCompositorTimingSupportedANDROID, GetDisplayIfValid(dpyPacked),
76                        EGLBoolean, dpyPacked, surfacePacked, namePacked);
77 
78     return GetCompositorTimingSupportedANDROID(thread, dpyPacked, surfacePacked, namePacked);
79 }
80 
EGL_GetCompositorTimingANDROID(EGLDisplay dpy,EGLSurface surface,EGLint numTimestamps,const EGLint * names,EGLnsecsANDROID * values)81 EGLBoolean EGLAPIENTRY EGL_GetCompositorTimingANDROID(EGLDisplay dpy,
82                                                       EGLSurface surface,
83                                                       EGLint numTimestamps,
84                                                       const EGLint *names,
85                                                       EGLnsecsANDROID *values)
86 {
87     ANGLE_SCOPED_GLOBAL_LOCK();
88     EGL_EVENT(GetCompositorTimingANDROID,
89               "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR
90               ", numTimestamps = %d, names = 0x%016" PRIxPTR ", values = 0x%016" PRIxPTR "",
91               (uintptr_t)dpy, (uintptr_t)surface, numTimestamps, (uintptr_t)names,
92               (uintptr_t)values);
93 
94     Thread *thread = egl::GetCurrentThread();
95 
96     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
97     Surface *surfacePacked  = PackParam<Surface *>(surface);
98 
99     ANGLE_EGL_VALIDATE(thread, GetCompositorTimingANDROID, GetDisplayIfValid(dpyPacked), EGLBoolean,
100                        dpyPacked, surfacePacked, numTimestamps, names, values);
101 
102     return GetCompositorTimingANDROID(thread, dpyPacked, surfacePacked, numTimestamps, names,
103                                       values);
104 }
105 
EGL_GetNextFrameIdANDROID(EGLDisplay dpy,EGLSurface surface,EGLuint64KHR * frameId)106 EGLBoolean EGLAPIENTRY EGL_GetNextFrameIdANDROID(EGLDisplay dpy,
107                                                  EGLSurface surface,
108                                                  EGLuint64KHR *frameId)
109 {
110     ANGLE_SCOPED_GLOBAL_LOCK();
111     EGL_EVENT(GetNextFrameIdANDROID,
112               "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", frameId = 0x%016" PRIxPTR "",
113               (uintptr_t)dpy, (uintptr_t)surface, (uintptr_t)frameId);
114 
115     Thread *thread = egl::GetCurrentThread();
116 
117     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
118     Surface *surfacePacked  = PackParam<Surface *>(surface);
119 
120     ANGLE_EGL_VALIDATE(thread, GetNextFrameIdANDROID, GetDisplayIfValid(dpyPacked), EGLBoolean,
121                        dpyPacked, surfacePacked, frameId);
122 
123     return GetNextFrameIdANDROID(thread, dpyPacked, surfacePacked, frameId);
124 }
125 
EGL_GetFrameTimestampSupportedANDROID(EGLDisplay dpy,EGLSurface surface,EGLint timestamp)126 EGLBoolean EGLAPIENTRY EGL_GetFrameTimestampSupportedANDROID(EGLDisplay dpy,
127                                                              EGLSurface surface,
128                                                              EGLint timestamp)
129 {
130     ANGLE_SCOPED_GLOBAL_LOCK();
131     EGL_EVENT(GetFrameTimestampSupportedANDROID,
132               "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", timestamp = %d",
133               (uintptr_t)dpy, (uintptr_t)surface, timestamp);
134 
135     Thread *thread = egl::GetCurrentThread();
136 
137     egl::Display *dpyPacked   = PackParam<egl::Display *>(dpy);
138     Surface *surfacePacked    = PackParam<Surface *>(surface);
139     Timestamp timestampPacked = PackParam<Timestamp>(timestamp);
140 
141     ANGLE_EGL_VALIDATE(thread, GetFrameTimestampSupportedANDROID, GetDisplayIfValid(dpyPacked),
142                        EGLBoolean, dpyPacked, surfacePacked, timestampPacked);
143 
144     return GetFrameTimestampSupportedANDROID(thread, dpyPacked, surfacePacked, timestampPacked);
145 }
146 
EGL_GetFrameTimestampsANDROID(EGLDisplay dpy,EGLSurface surface,EGLuint64KHR frameId,EGLint numTimestamps,const EGLint * timestamps,EGLnsecsANDROID * values)147 EGLBoolean EGLAPIENTRY EGL_GetFrameTimestampsANDROID(EGLDisplay dpy,
148                                                      EGLSurface surface,
149                                                      EGLuint64KHR frameId,
150                                                      EGLint numTimestamps,
151                                                      const EGLint *timestamps,
152                                                      EGLnsecsANDROID *values)
153 {
154     ANGLE_SCOPED_GLOBAL_LOCK();
155     EGL_EVENT(GetFrameTimestampsANDROID,
156               "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR
157               ", frameId = %llu, numTimestamps = %d, timestamps = 0x%016" PRIxPTR
158               ", values = 0x%016" PRIxPTR "",
159               (uintptr_t)dpy, (uintptr_t)surface, static_cast<unsigned long long>(frameId),
160               numTimestamps, (uintptr_t)timestamps, (uintptr_t)values);
161 
162     Thread *thread = egl::GetCurrentThread();
163 
164     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
165     Surface *surfacePacked  = PackParam<Surface *>(surface);
166 
167     ANGLE_EGL_VALIDATE(thread, GetFrameTimestampsANDROID, GetDisplayIfValid(dpyPacked), EGLBoolean,
168                        dpyPacked, surfacePacked, frameId, numTimestamps, timestamps, values);
169 
170     return GetFrameTimestampsANDROID(thread, dpyPacked, surfacePacked, frameId, numTimestamps,
171                                      timestamps, values);
172 }
173 
174 // EGL_ANDROID_get_native_client_buffer
EGL_GetNativeClientBufferANDROID(const struct AHardwareBuffer * buffer)175 EGLClientBuffer EGLAPIENTRY EGL_GetNativeClientBufferANDROID(const struct AHardwareBuffer *buffer)
176 {
177     ANGLE_SCOPED_GLOBAL_LOCK();
178     EGL_EVENT(GetNativeClientBufferANDROID, "buffer = 0x%016" PRIxPTR "", (uintptr_t)buffer);
179 
180     Thread *thread = egl::GetCurrentThread();
181 
182     ANGLE_EGL_VALIDATE(thread, GetNativeClientBufferANDROID, nullptr, EGLClientBuffer, buffer);
183 
184     return GetNativeClientBufferANDROID(thread, buffer);
185 }
186 
187 // EGL_ANDROID_native_fence_sync
EGL_DupNativeFenceFDANDROID(EGLDisplay dpy,EGLSyncKHR sync)188 EGLint EGLAPIENTRY EGL_DupNativeFenceFDANDROID(EGLDisplay dpy, EGLSyncKHR sync)
189 {
190     ANGLE_SCOPED_GLOBAL_LOCK();
191     EGL_EVENT(DupNativeFenceFDANDROID, "dpy = 0x%016" PRIxPTR ", sync = 0x%016" PRIxPTR "",
192               (uintptr_t)dpy, (uintptr_t)sync);
193 
194     Thread *thread = egl::GetCurrentThread();
195 
196     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
197     Sync *syncPacked        = PackParam<Sync *>(sync);
198 
199     ANGLE_EGL_VALIDATE(thread, DupNativeFenceFDANDROID, GetDisplayIfValid(dpyPacked), EGLint,
200                        dpyPacked, syncPacked);
201 
202     return DupNativeFenceFDANDROID(thread, dpyPacked, syncPacked);
203 }
204 
205 // EGL_ANDROID_presentation_time
EGL_PresentationTimeANDROID(EGLDisplay dpy,EGLSurface surface,EGLnsecsANDROID time)206 EGLBoolean EGLAPIENTRY EGL_PresentationTimeANDROID(EGLDisplay dpy,
207                                                    EGLSurface surface,
208                                                    EGLnsecsANDROID time)
209 {
210     ANGLE_SCOPED_GLOBAL_LOCK();
211     EGL_EVENT(PresentationTimeANDROID,
212               "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", time = %llu", (uintptr_t)dpy,
213               (uintptr_t)surface, static_cast<unsigned long long>(time));
214 
215     Thread *thread = egl::GetCurrentThread();
216 
217     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
218     Surface *surfacePacked  = PackParam<Surface *>(surface);
219 
220     ANGLE_EGL_VALIDATE(thread, PresentationTimeANDROID, GetDisplayIfValid(dpyPacked), EGLBoolean,
221                        dpyPacked, surfacePacked, time);
222 
223     return PresentationTimeANDROID(thread, dpyPacked, surfacePacked, time);
224 }
225 
226 // EGL_ANGLE_device_creation
EGL_CreateDeviceANGLE(EGLint device_type,void * native_device,const EGLAttrib * attrib_list)227 EGLDeviceEXT EGLAPIENTRY EGL_CreateDeviceANGLE(EGLint device_type,
228                                                void *native_device,
229                                                const EGLAttrib *attrib_list)
230 {
231     ANGLE_SCOPED_GLOBAL_LOCK();
232     EGL_EVENT(CreateDeviceANGLE,
233               "device_type = %d, native_device = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR
234               "",
235               device_type, (uintptr_t)native_device, (uintptr_t)attrib_list);
236 
237     Thread *thread = egl::GetCurrentThread();
238 
239     ANGLE_EGL_VALIDATE(thread, CreateDeviceANGLE, nullptr, EGLDeviceEXT, device_type, native_device,
240                        attrib_list);
241 
242     return CreateDeviceANGLE(thread, device_type, native_device, attrib_list);
243 }
244 
EGL_ReleaseDeviceANGLE(EGLDeviceEXT device)245 EGLBoolean EGLAPIENTRY EGL_ReleaseDeviceANGLE(EGLDeviceEXT device)
246 {
247     ANGLE_SCOPED_GLOBAL_LOCK();
248     EGL_EVENT(ReleaseDeviceANGLE, "device = 0x%016" PRIxPTR "", (uintptr_t)device);
249 
250     Thread *thread = egl::GetCurrentThread();
251 
252     Device *devicePacked = PackParam<Device *>(device);
253 
254     ANGLE_EGL_VALIDATE(thread, ReleaseDeviceANGLE, nullptr, EGLBoolean, devicePacked);
255 
256     return ReleaseDeviceANGLE(thread, devicePacked);
257 }
258 
259 // EGL_ANGLE_feature_control
EGL_QueryStringiANGLE(EGLDisplay dpy,EGLint name,EGLint index)260 const char *EGLAPIENTRY EGL_QueryStringiANGLE(EGLDisplay dpy, EGLint name, EGLint index)
261 {
262     ANGLE_SCOPED_GLOBAL_LOCK();
263     EGL_EVENT(QueryStringiANGLE, "dpy = 0x%016" PRIxPTR ", name = %d, index = %d", (uintptr_t)dpy,
264               name, index);
265 
266     Thread *thread = egl::GetCurrentThread();
267 
268     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
269 
270     ANGLE_EGL_VALIDATE(thread, QueryStringiANGLE, GetDisplayIfValid(dpyPacked), const char *,
271                        dpyPacked, name, index);
272 
273     return QueryStringiANGLE(thread, dpyPacked, name, index);
274 }
275 
EGL_QueryDisplayAttribANGLE(EGLDisplay dpy,EGLint attribute,EGLAttrib * value)276 EGLBoolean EGLAPIENTRY EGL_QueryDisplayAttribANGLE(EGLDisplay dpy,
277                                                    EGLint attribute,
278                                                    EGLAttrib *value)
279 {
280     ANGLE_SCOPED_GLOBAL_LOCK();
281     EGL_EVENT(QueryDisplayAttribANGLE,
282               "dpy = 0x%016" PRIxPTR ", attribute = %d, value = 0x%016" PRIxPTR "", (uintptr_t)dpy,
283               attribute, (uintptr_t)value);
284 
285     Thread *thread = egl::GetCurrentThread();
286 
287     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
288 
289     ANGLE_EGL_VALIDATE(thread, QueryDisplayAttribANGLE, GetDisplayIfValid(dpyPacked), EGLBoolean,
290                        dpyPacked, attribute, value);
291 
292     return QueryDisplayAttribANGLE(thread, dpyPacked, attribute, value);
293 }
294 
295 // EGL_ANGLE_power_preference
EGL_ReleaseHighPowerGPUANGLE(EGLDisplay dpy,EGLContext ctx)296 void EGLAPIENTRY EGL_ReleaseHighPowerGPUANGLE(EGLDisplay dpy, EGLContext ctx)
297 {
298     ANGLE_SCOPED_GLOBAL_LOCK();
299     EGL_EVENT(ReleaseHighPowerGPUANGLE, "dpy = 0x%016" PRIxPTR ", ctx = 0x%016" PRIxPTR "",
300               (uintptr_t)dpy, (uintptr_t)ctx);
301 
302     Thread *thread = egl::GetCurrentThread();
303 
304     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
305     gl::Context *ctxPacked  = PackParam<gl::Context *>(ctx);
306 
307     ANGLE_EGL_VALIDATE_VOID(thread, ReleaseHighPowerGPUANGLE, GetDisplayIfValid(dpyPacked),
308                             dpyPacked, ctxPacked);
309 
310     ReleaseHighPowerGPUANGLE(thread, dpyPacked, ctxPacked);
311 }
312 
EGL_ReacquireHighPowerGPUANGLE(EGLDisplay dpy,EGLContext ctx)313 void EGLAPIENTRY EGL_ReacquireHighPowerGPUANGLE(EGLDisplay dpy, EGLContext ctx)
314 {
315     ANGLE_SCOPED_GLOBAL_LOCK();
316     EGL_EVENT(ReacquireHighPowerGPUANGLE, "dpy = 0x%016" PRIxPTR ", ctx = 0x%016" PRIxPTR "",
317               (uintptr_t)dpy, (uintptr_t)ctx);
318 
319     Thread *thread = egl::GetCurrentThread();
320 
321     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
322     gl::Context *ctxPacked  = PackParam<gl::Context *>(ctx);
323 
324     ANGLE_EGL_VALIDATE_VOID(thread, ReacquireHighPowerGPUANGLE, GetDisplayIfValid(dpyPacked),
325                             dpyPacked, ctxPacked);
326 
327     ReacquireHighPowerGPUANGLE(thread, dpyPacked, ctxPacked);
328 }
329 
EGL_HandleGPUSwitchANGLE(EGLDisplay dpy)330 void EGLAPIENTRY EGL_HandleGPUSwitchANGLE(EGLDisplay dpy)
331 {
332     ANGLE_SCOPED_GLOBAL_LOCK();
333     EGL_EVENT(HandleGPUSwitchANGLE, "dpy = 0x%016" PRIxPTR "", (uintptr_t)dpy);
334 
335     Thread *thread = egl::GetCurrentThread();
336 
337     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
338 
339     ANGLE_EGL_VALIDATE_VOID(thread, HandleGPUSwitchANGLE, GetDisplayIfValid(dpyPacked), dpyPacked);
340 
341     HandleGPUSwitchANGLE(thread, dpyPacked);
342 }
343 
344 // EGL_ANGLE_program_cache_control
EGL_ProgramCacheGetAttribANGLE(EGLDisplay dpy,EGLenum attrib)345 EGLint EGLAPIENTRY EGL_ProgramCacheGetAttribANGLE(EGLDisplay dpy, EGLenum attrib)
346 {
347     ANGLE_SCOPED_GLOBAL_LOCK();
348     EGL_EVENT(ProgramCacheGetAttribANGLE, "dpy = 0x%016" PRIxPTR ", attrib = 0x%X", (uintptr_t)dpy,
349               attrib);
350 
351     Thread *thread = egl::GetCurrentThread();
352 
353     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
354 
355     ANGLE_EGL_VALIDATE(thread, ProgramCacheGetAttribANGLE, GetDisplayIfValid(dpyPacked), EGLint,
356                        dpyPacked, attrib);
357 
358     return ProgramCacheGetAttribANGLE(thread, dpyPacked, attrib);
359 }
360 
EGL_ProgramCacheQueryANGLE(EGLDisplay dpy,EGLint index,void * key,EGLint * keysize,void * binary,EGLint * binarysize)361 void EGLAPIENTRY EGL_ProgramCacheQueryANGLE(EGLDisplay dpy,
362                                             EGLint index,
363                                             void *key,
364                                             EGLint *keysize,
365                                             void *binary,
366                                             EGLint *binarysize)
367 {
368     ANGLE_SCOPED_GLOBAL_LOCK();
369     EGL_EVENT(ProgramCacheQueryANGLE,
370               "dpy = 0x%016" PRIxPTR ", index = %d, key = 0x%016" PRIxPTR
371               ", keysize = 0x%016" PRIxPTR ", binary = 0x%016" PRIxPTR
372               ", binarysize = 0x%016" PRIxPTR "",
373               (uintptr_t)dpy, index, (uintptr_t)key, (uintptr_t)keysize, (uintptr_t)binary,
374               (uintptr_t)binarysize);
375 
376     Thread *thread = egl::GetCurrentThread();
377 
378     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
379 
380     ANGLE_EGL_VALIDATE_VOID(thread, ProgramCacheQueryANGLE, GetDisplayIfValid(dpyPacked), dpyPacked,
381                             index, key, keysize, binary, binarysize);
382 
383     ProgramCacheQueryANGLE(thread, dpyPacked, index, key, keysize, binary, binarysize);
384 }
385 
EGL_ProgramCachePopulateANGLE(EGLDisplay dpy,const void * key,EGLint keysize,const void * binary,EGLint binarysize)386 void EGLAPIENTRY EGL_ProgramCachePopulateANGLE(EGLDisplay dpy,
387                                                const void *key,
388                                                EGLint keysize,
389                                                const void *binary,
390                                                EGLint binarysize)
391 {
392     ANGLE_SCOPED_GLOBAL_LOCK();
393     EGL_EVENT(ProgramCachePopulateANGLE,
394               "dpy = 0x%016" PRIxPTR ", key = 0x%016" PRIxPTR
395               ", keysize = %d, binary = 0x%016" PRIxPTR ", binarysize = %d",
396               (uintptr_t)dpy, (uintptr_t)key, keysize, (uintptr_t)binary, binarysize);
397 
398     Thread *thread = egl::GetCurrentThread();
399 
400     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
401 
402     ANGLE_EGL_VALIDATE_VOID(thread, ProgramCachePopulateANGLE, GetDisplayIfValid(dpyPacked),
403                             dpyPacked, key, keysize, binary, binarysize);
404 
405     ProgramCachePopulateANGLE(thread, dpyPacked, key, keysize, binary, binarysize);
406 }
407 
EGL_ProgramCacheResizeANGLE(EGLDisplay dpy,EGLint limit,EGLint mode)408 EGLint EGLAPIENTRY EGL_ProgramCacheResizeANGLE(EGLDisplay dpy, EGLint limit, EGLint mode)
409 {
410     ANGLE_SCOPED_GLOBAL_LOCK();
411     EGL_EVENT(ProgramCacheResizeANGLE, "dpy = 0x%016" PRIxPTR ", limit = %d, mode = %d",
412               (uintptr_t)dpy, limit, mode);
413 
414     Thread *thread = egl::GetCurrentThread();
415 
416     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
417 
418     ANGLE_EGL_VALIDATE(thread, ProgramCacheResizeANGLE, GetDisplayIfValid(dpyPacked), EGLint,
419                        dpyPacked, limit, mode);
420 
421     return ProgramCacheResizeANGLE(thread, dpyPacked, limit, mode);
422 }
423 
424 // EGL_ANGLE_query_surface_pointer
EGL_QuerySurfacePointerANGLE(EGLDisplay dpy,EGLSurface surface,EGLint attribute,void ** value)425 EGLBoolean EGLAPIENTRY EGL_QuerySurfacePointerANGLE(EGLDisplay dpy,
426                                                     EGLSurface surface,
427                                                     EGLint attribute,
428                                                     void **value)
429 {
430     ANGLE_SCOPED_GLOBAL_LOCK();
431     EGL_EVENT(QuerySurfacePointerANGLE,
432               "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR
433               ", attribute = %d, value = 0x%016" PRIxPTR "",
434               (uintptr_t)dpy, (uintptr_t)surface, attribute, (uintptr_t)value);
435 
436     Thread *thread = egl::GetCurrentThread();
437 
438     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
439     Surface *surfacePacked  = PackParam<Surface *>(surface);
440 
441     ANGLE_EGL_VALIDATE(thread, QuerySurfacePointerANGLE, GetDisplayIfValid(dpyPacked), EGLBoolean,
442                        dpyPacked, surfacePacked, attribute, value);
443 
444     return QuerySurfacePointerANGLE(thread, dpyPacked, surfacePacked, attribute, value);
445 }
446 
447 // EGL_ANGLE_stream_producer_d3d_texture
EGL_CreateStreamProducerD3DTextureANGLE(EGLDisplay dpy,EGLStreamKHR stream,const EGLAttrib * attrib_list)448 EGLBoolean EGLAPIENTRY EGL_CreateStreamProducerD3DTextureANGLE(EGLDisplay dpy,
449                                                                EGLStreamKHR stream,
450                                                                const EGLAttrib *attrib_list)
451 {
452     ANGLE_SCOPED_GLOBAL_LOCK();
453     EGL_EVENT(CreateStreamProducerD3DTextureANGLE,
454               "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR
455               "",
456               (uintptr_t)dpy, (uintptr_t)stream, (uintptr_t)attrib_list);
457 
458     Thread *thread = egl::GetCurrentThread();
459 
460     egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
461     Stream *streamPacked                  = PackParam<Stream *>(stream);
462     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
463 
464     ANGLE_EGL_VALIDATE(thread, CreateStreamProducerD3DTextureANGLE, GetDisplayIfValid(dpyPacked),
465                        EGLBoolean, dpyPacked, streamPacked, attrib_listPacked);
466 
467     return CreateStreamProducerD3DTextureANGLE(thread, dpyPacked, streamPacked, attrib_listPacked);
468 }
469 
EGL_StreamPostD3DTextureANGLE(EGLDisplay dpy,EGLStreamKHR stream,void * texture,const EGLAttrib * attrib_list)470 EGLBoolean EGLAPIENTRY EGL_StreamPostD3DTextureANGLE(EGLDisplay dpy,
471                                                      EGLStreamKHR stream,
472                                                      void *texture,
473                                                      const EGLAttrib *attrib_list)
474 {
475     ANGLE_SCOPED_GLOBAL_LOCK();
476     EGL_EVENT(StreamPostD3DTextureANGLE,
477               "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR ", texture = 0x%016" PRIxPTR
478               ", attrib_list = 0x%016" PRIxPTR "",
479               (uintptr_t)dpy, (uintptr_t)stream, (uintptr_t)texture, (uintptr_t)attrib_list);
480 
481     Thread *thread = egl::GetCurrentThread();
482 
483     egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
484     Stream *streamPacked                  = PackParam<Stream *>(stream);
485     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
486 
487     ANGLE_EGL_VALIDATE(thread, StreamPostD3DTextureANGLE, GetDisplayIfValid(dpyPacked), EGLBoolean,
488                        dpyPacked, streamPacked, texture, attrib_listPacked);
489 
490     return StreamPostD3DTextureANGLE(thread, dpyPacked, streamPacked, texture, attrib_listPacked);
491 }
492 
493 // EGL_ANGLE_swap_with_frame_token
EGL_SwapBuffersWithFrameTokenANGLE(EGLDisplay dpy,EGLSurface surface,EGLFrameTokenANGLE frametoken)494 EGLBoolean EGLAPIENTRY EGL_SwapBuffersWithFrameTokenANGLE(EGLDisplay dpy,
495                                                           EGLSurface surface,
496                                                           EGLFrameTokenANGLE frametoken)
497 {
498     ANGLE_SCOPED_GLOBAL_LOCK();
499     EGL_EVENT(SwapBuffersWithFrameTokenANGLE,
500               "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", frametoken = 0x%llX",
501               (uintptr_t)dpy, (uintptr_t)surface, static_cast<unsigned long long>(frametoken));
502 
503     Thread *thread = egl::GetCurrentThread();
504 
505     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
506     Surface *surfacePacked  = PackParam<Surface *>(surface);
507 
508     ANGLE_EGL_VALIDATE(thread, SwapBuffersWithFrameTokenANGLE, GetDisplayIfValid(dpyPacked),
509                        EGLBoolean, dpyPacked, surfacePacked, frametoken);
510 
511     return SwapBuffersWithFrameTokenANGLE(thread, dpyPacked, surfacePacked, frametoken);
512 }
513 
514 // EGL_ANGLE_sync_control_rate
EGL_GetMscRateANGLE(EGLDisplay dpy,EGLSurface surface,EGLint * numerator,EGLint * denominator)515 EGLBoolean EGLAPIENTRY EGL_GetMscRateANGLE(EGLDisplay dpy,
516                                            EGLSurface surface,
517                                            EGLint *numerator,
518                                            EGLint *denominator)
519 {
520     ANGLE_SCOPED_GLOBAL_LOCK();
521     EGL_EVENT(GetMscRateANGLE,
522               "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", numerator = 0x%016" PRIxPTR
523               ", denominator = 0x%016" PRIxPTR "",
524               (uintptr_t)dpy, (uintptr_t)surface, (uintptr_t)numerator, (uintptr_t)denominator);
525 
526     Thread *thread = egl::GetCurrentThread();
527 
528     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
529     Surface *surfacePacked  = PackParam<Surface *>(surface);
530 
531     ANGLE_EGL_VALIDATE(thread, GetMscRateANGLE, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
532                        surfacePacked, numerator, denominator);
533 
534     return GetMscRateANGLE(thread, dpyPacked, surfacePacked, numerator, denominator);
535 }
536 
537 // EGL_ANGLE_vulkan_image
EGL_ExportVkImageANGLE(EGLDisplay dpy,EGLImage image,void * vk_image,void * vk_image_create_info)538 EGLBoolean EGLAPIENTRY EGL_ExportVkImageANGLE(EGLDisplay dpy,
539                                               EGLImage image,
540                                               void *vk_image,
541                                               void *vk_image_create_info)
542 {
543     ANGLE_SCOPED_GLOBAL_LOCK();
544     EGL_EVENT(ExportVkImageANGLE,
545               "dpy = 0x%016" PRIxPTR ", image = 0x%016" PRIxPTR ", vk_image = 0x%016" PRIxPTR
546               ", vk_image_create_info = 0x%016" PRIxPTR "",
547               (uintptr_t)dpy, (uintptr_t)image, (uintptr_t)vk_image,
548               (uintptr_t)vk_image_create_info);
549 
550     Thread *thread = egl::GetCurrentThread();
551 
552     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
553     Image *imagePacked      = PackParam<Image *>(image);
554 
555     ANGLE_EGL_VALIDATE(thread, ExportVkImageANGLE, GetDisplayIfValid(dpyPacked), EGLBoolean,
556                        dpyPacked, imagePacked, vk_image, vk_image_create_info);
557 
558     return ExportVkImageANGLE(thread, dpyPacked, imagePacked, vk_image, vk_image_create_info);
559 }
560 
561 // EGL_CHROMIUM_sync_control
EGL_GetSyncValuesCHROMIUM(EGLDisplay dpy,EGLSurface surface,EGLuint64KHR * ust,EGLuint64KHR * msc,EGLuint64KHR * sbc)562 EGLBoolean EGLAPIENTRY EGL_GetSyncValuesCHROMIUM(EGLDisplay dpy,
563                                                  EGLSurface surface,
564                                                  EGLuint64KHR *ust,
565                                                  EGLuint64KHR *msc,
566                                                  EGLuint64KHR *sbc)
567 {
568     ANGLE_SCOPED_GLOBAL_LOCK();
569     EGL_EVENT(GetSyncValuesCHROMIUM,
570               "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", ust = 0x%016" PRIxPTR
571               ", msc = 0x%016" PRIxPTR ", sbc = 0x%016" PRIxPTR "",
572               (uintptr_t)dpy, (uintptr_t)surface, (uintptr_t)ust, (uintptr_t)msc, (uintptr_t)sbc);
573 
574     Thread *thread = egl::GetCurrentThread();
575 
576     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
577     Surface *surfacePacked  = PackParam<Surface *>(surface);
578 
579     ANGLE_EGL_VALIDATE(thread, GetSyncValuesCHROMIUM, GetDisplayIfValid(dpyPacked), EGLBoolean,
580                        dpyPacked, surfacePacked, ust, msc, sbc);
581 
582     return GetSyncValuesCHROMIUM(thread, dpyPacked, surfacePacked, ust, msc, sbc);
583 }
584 
585 // EGL_EXT_device_query
EGL_QueryDeviceAttribEXT(EGLDeviceEXT device,EGLint attribute,EGLAttrib * value)586 EGLBoolean EGLAPIENTRY EGL_QueryDeviceAttribEXT(EGLDeviceEXT device,
587                                                 EGLint attribute,
588                                                 EGLAttrib *value)
589 {
590     ANGLE_SCOPED_GLOBAL_LOCK();
591     EGL_EVENT(QueryDeviceAttribEXT,
592               "device = 0x%016" PRIxPTR ", attribute = %d, value = 0x%016" PRIxPTR "",
593               (uintptr_t)device, attribute, (uintptr_t)value);
594 
595     Thread *thread = egl::GetCurrentThread();
596 
597     Device *devicePacked = PackParam<Device *>(device);
598 
599     ANGLE_EGL_VALIDATE(thread, QueryDeviceAttribEXT, nullptr, EGLBoolean, devicePacked, attribute,
600                        value);
601 
602     return QueryDeviceAttribEXT(thread, devicePacked, attribute, value);
603 }
604 
EGL_QueryDeviceStringEXT(EGLDeviceEXT device,EGLint name)605 const char *EGLAPIENTRY EGL_QueryDeviceStringEXT(EGLDeviceEXT device, EGLint name)
606 {
607     ANGLE_SCOPED_GLOBAL_LOCK();
608     EGL_EVENT(QueryDeviceStringEXT, "device = 0x%016" PRIxPTR ", name = %d", (uintptr_t)device,
609               name);
610 
611     Thread *thread = egl::GetCurrentThread();
612 
613     Device *devicePacked = PackParam<Device *>(device);
614 
615     ANGLE_EGL_VALIDATE(thread, QueryDeviceStringEXT, nullptr, const char *, devicePacked, name);
616 
617     return QueryDeviceStringEXT(thread, devicePacked, name);
618 }
619 
EGL_QueryDisplayAttribEXT(EGLDisplay dpy,EGLint attribute,EGLAttrib * value)620 EGLBoolean EGLAPIENTRY EGL_QueryDisplayAttribEXT(EGLDisplay dpy, EGLint attribute, EGLAttrib *value)
621 {
622     ANGLE_SCOPED_GLOBAL_LOCK();
623     EGL_EVENT(QueryDisplayAttribEXT,
624               "dpy = 0x%016" PRIxPTR ", attribute = %d, value = 0x%016" PRIxPTR "", (uintptr_t)dpy,
625               attribute, (uintptr_t)value);
626 
627     Thread *thread = egl::GetCurrentThread();
628 
629     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
630 
631     ANGLE_EGL_VALIDATE(thread, QueryDisplayAttribEXT, GetDisplayIfValid(dpyPacked), EGLBoolean,
632                        dpyPacked, attribute, value);
633 
634     return QueryDisplayAttribEXT(thread, dpyPacked, attribute, value);
635 }
636 
637 // EGL_EXT_platform_base
EGL_CreatePlatformPixmapSurfaceEXT(EGLDisplay dpy,EGLConfig config,void * native_pixmap,const EGLint * attrib_list)638 EGLSurface EGLAPIENTRY EGL_CreatePlatformPixmapSurfaceEXT(EGLDisplay dpy,
639                                                           EGLConfig config,
640                                                           void *native_pixmap,
641                                                           const EGLint *attrib_list)
642 {
643     ANGLE_SCOPED_GLOBAL_LOCK();
644     EGL_EVENT(CreatePlatformPixmapSurfaceEXT,
645               "dpy = 0x%016" PRIxPTR ", config = 0x%016" PRIxPTR ", native_pixmap = 0x%016" PRIxPTR
646               ", attrib_list = 0x%016" PRIxPTR "",
647               (uintptr_t)dpy, (uintptr_t)config, (uintptr_t)native_pixmap, (uintptr_t)attrib_list);
648 
649     Thread *thread = egl::GetCurrentThread();
650 
651     egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
652     Config *configPacked                  = PackParam<Config *>(config);
653     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
654 
655     ANGLE_EGL_VALIDATE(thread, CreatePlatformPixmapSurfaceEXT, GetDisplayIfValid(dpyPacked),
656                        EGLSurface, dpyPacked, configPacked, native_pixmap, attrib_listPacked);
657 
658     return CreatePlatformPixmapSurfaceEXT(thread, dpyPacked, configPacked, native_pixmap,
659                                           attrib_listPacked);
660 }
661 
EGL_CreatePlatformWindowSurfaceEXT(EGLDisplay dpy,EGLConfig config,void * native_window,const EGLint * attrib_list)662 EGLSurface EGLAPIENTRY EGL_CreatePlatformWindowSurfaceEXT(EGLDisplay dpy,
663                                                           EGLConfig config,
664                                                           void *native_window,
665                                                           const EGLint *attrib_list)
666 {
667     ANGLE_SCOPED_GLOBAL_LOCK();
668     EGL_EVENT(CreatePlatformWindowSurfaceEXT,
669               "dpy = 0x%016" PRIxPTR ", config = 0x%016" PRIxPTR ", native_window = 0x%016" PRIxPTR
670               ", attrib_list = 0x%016" PRIxPTR "",
671               (uintptr_t)dpy, (uintptr_t)config, (uintptr_t)native_window, (uintptr_t)attrib_list);
672 
673     Thread *thread = egl::GetCurrentThread();
674 
675     egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
676     Config *configPacked                  = PackParam<Config *>(config);
677     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
678 
679     ANGLE_EGL_VALIDATE(thread, CreatePlatformWindowSurfaceEXT, GetDisplayIfValid(dpyPacked),
680                        EGLSurface, dpyPacked, configPacked, native_window, attrib_listPacked);
681 
682     return CreatePlatformWindowSurfaceEXT(thread, dpyPacked, configPacked, native_window,
683                                           attrib_listPacked);
684 }
685 
EGL_GetPlatformDisplayEXT(EGLenum platform,void * native_display,const EGLint * attrib_list)686 EGLDisplay EGLAPIENTRY EGL_GetPlatformDisplayEXT(EGLenum platform,
687                                                  void *native_display,
688                                                  const EGLint *attrib_list)
689 {
690     ANGLE_SCOPED_GLOBAL_LOCK();
691     EGL_EVENT(GetPlatformDisplayEXT,
692               "platform = 0x%X, native_display = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR
693               "",
694               platform, (uintptr_t)native_display, (uintptr_t)attrib_list);
695 
696     Thread *thread = egl::GetCurrentThread();
697 
698     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
699 
700     ANGLE_EGL_VALIDATE(thread, GetPlatformDisplayEXT, nullptr, EGLDisplay, platform, native_display,
701                        attrib_listPacked);
702 
703     return GetPlatformDisplayEXT(thread, platform, native_display, attrib_listPacked);
704 }
705 
706 // EGL_KHR_debug
EGL_DebugMessageControlKHR(EGLDEBUGPROCKHR callback,const EGLAttrib * attrib_list)707 EGLint EGLAPIENTRY EGL_DebugMessageControlKHR(EGLDEBUGPROCKHR callback,
708                                               const EGLAttrib *attrib_list)
709 {
710     ANGLE_SCOPED_GLOBAL_LOCK();
711     EGL_EVENT(DebugMessageControlKHR,
712               "callback = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR "", (uintptr_t)callback,
713               (uintptr_t)attrib_list);
714 
715     Thread *thread = egl::GetCurrentThread();
716 
717     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
718 
719     ANGLE_EGL_VALIDATE(thread, DebugMessageControlKHR, nullptr, EGLint, callback,
720                        attrib_listPacked);
721 
722     return DebugMessageControlKHR(thread, callback, attrib_listPacked);
723 }
724 
EGL_LabelObjectKHR(EGLDisplay display,EGLenum objectType,EGLObjectKHR object,EGLLabelKHR label)725 EGLint EGLAPIENTRY EGL_LabelObjectKHR(EGLDisplay display,
726                                       EGLenum objectType,
727                                       EGLObjectKHR object,
728                                       EGLLabelKHR label)
729 {
730     ANGLE_SCOPED_GLOBAL_LOCK();
731     EGL_EVENT(LabelObjectKHR,
732               "display = 0x%016" PRIxPTR ", objectType = 0x%X, object = 0x%016" PRIxPTR
733               ", label = 0x%016" PRIxPTR "",
734               (uintptr_t)display, objectType, (uintptr_t)object, (uintptr_t)label);
735 
736     Thread *thread = egl::GetCurrentThread();
737 
738     egl::Display *displayPacked = PackParam<egl::Display *>(display);
739     ObjectType objectTypePacked = PackParam<ObjectType>(objectType);
740 
741     ANGLE_EGL_VALIDATE(thread, LabelObjectKHR, GetDisplayIfValid(displayPacked), EGLint,
742                        displayPacked, objectTypePacked, object, label);
743 
744     return LabelObjectKHR(thread, displayPacked, objectTypePacked, object, label);
745 }
746 
EGL_QueryDebugKHR(EGLint attribute,EGLAttrib * value)747 EGLBoolean EGLAPIENTRY EGL_QueryDebugKHR(EGLint attribute, EGLAttrib *value)
748 {
749     ANGLE_SCOPED_GLOBAL_LOCK();
750     EGL_EVENT(QueryDebugKHR, "attribute = %d, value = 0x%016" PRIxPTR "", attribute,
751               (uintptr_t)value);
752 
753     Thread *thread = egl::GetCurrentThread();
754 
755     ANGLE_EGL_VALIDATE(thread, QueryDebugKHR, nullptr, EGLBoolean, attribute, value);
756 
757     return QueryDebugKHR(thread, attribute, value);
758 }
759 
760 // EGL_KHR_fence_sync
EGL_ClientWaitSyncKHR(EGLDisplay dpy,EGLSyncKHR sync,EGLint flags,EGLTimeKHR timeout)761 EGLint EGLAPIENTRY EGL_ClientWaitSyncKHR(EGLDisplay dpy,
762                                          EGLSyncKHR sync,
763                                          EGLint flags,
764                                          EGLTimeKHR timeout)
765 {
766     ANGLE_SCOPED_GLOBAL_LOCK();
767     EGL_EVENT(ClientWaitSyncKHR,
768               "dpy = 0x%016" PRIxPTR ", sync = 0x%016" PRIxPTR ", flags = %d, timeout = %llu",
769               (uintptr_t)dpy, (uintptr_t)sync, flags, static_cast<unsigned long long>(timeout));
770 
771     Thread *thread = egl::GetCurrentThread();
772 
773     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
774     Sync *syncPacked        = PackParam<Sync *>(sync);
775 
776     ANGLE_EGL_VALIDATE(thread, ClientWaitSyncKHR, GetDisplayIfValid(dpyPacked), EGLint, dpyPacked,
777                        syncPacked, flags, timeout);
778 
779     return ClientWaitSyncKHR(thread, dpyPacked, syncPacked, flags, timeout);
780 }
781 
EGL_CreateSyncKHR(EGLDisplay dpy,EGLenum type,const EGLint * attrib_list)782 EGLSyncKHR EGLAPIENTRY EGL_CreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)
783 {
784     ANGLE_SCOPED_GLOBAL_LOCK();
785     EGL_EVENT(CreateSyncKHR,
786               "dpy = 0x%016" PRIxPTR ", type = 0x%X, attrib_list = 0x%016" PRIxPTR "",
787               (uintptr_t)dpy, type, (uintptr_t)attrib_list);
788 
789     Thread *thread = egl::GetCurrentThread();
790 
791     egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
792     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
793 
794     ANGLE_EGL_VALIDATE(thread, CreateSyncKHR, GetDisplayIfValid(dpyPacked), EGLSyncKHR, dpyPacked,
795                        type, attrib_listPacked);
796 
797     return CreateSyncKHR(thread, dpyPacked, type, attrib_listPacked);
798 }
799 
EGL_DestroySyncKHR(EGLDisplay dpy,EGLSyncKHR sync)800 EGLBoolean EGLAPIENTRY EGL_DestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync)
801 {
802     ANGLE_SCOPED_GLOBAL_LOCK();
803     EGL_EVENT(DestroySyncKHR, "dpy = 0x%016" PRIxPTR ", sync = 0x%016" PRIxPTR "", (uintptr_t)dpy,
804               (uintptr_t)sync);
805 
806     Thread *thread = egl::GetCurrentThread();
807 
808     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
809     Sync *syncPacked        = PackParam<Sync *>(sync);
810 
811     ANGLE_EGL_VALIDATE(thread, DestroySyncKHR, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
812                        syncPacked);
813 
814     return DestroySyncKHR(thread, dpyPacked, syncPacked);
815 }
816 
EGL_GetSyncAttribKHR(EGLDisplay dpy,EGLSyncKHR sync,EGLint attribute,EGLint * value)817 EGLBoolean EGLAPIENTRY EGL_GetSyncAttribKHR(EGLDisplay dpy,
818                                             EGLSyncKHR sync,
819                                             EGLint attribute,
820                                             EGLint *value)
821 {
822     ANGLE_SCOPED_GLOBAL_LOCK();
823     EGL_EVENT(GetSyncAttribKHR,
824               "dpy = 0x%016" PRIxPTR ", sync = 0x%016" PRIxPTR
825               ", attribute = %d, value = 0x%016" PRIxPTR "",
826               (uintptr_t)dpy, (uintptr_t)sync, attribute, (uintptr_t)value);
827 
828     Thread *thread = egl::GetCurrentThread();
829 
830     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
831     Sync *syncPacked        = PackParam<Sync *>(sync);
832 
833     ANGLE_EGL_VALIDATE(thread, GetSyncAttribKHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
834                        dpyPacked, syncPacked, attribute, value);
835 
836     return GetSyncAttribKHR(thread, dpyPacked, syncPacked, attribute, value);
837 }
838 
839 // EGL_KHR_image
EGL_CreateImageKHR(EGLDisplay dpy,EGLContext ctx,EGLenum target,EGLClientBuffer buffer,const EGLint * attrib_list)840 EGLImageKHR EGLAPIENTRY EGL_CreateImageKHR(EGLDisplay dpy,
841                                            EGLContext ctx,
842                                            EGLenum target,
843                                            EGLClientBuffer buffer,
844                                            const EGLint *attrib_list)
845 {
846     ANGLE_SCOPED_GLOBAL_LOCK();
847     EGL_EVENT(CreateImageKHR,
848               "dpy = 0x%016" PRIxPTR ", ctx = 0x%016" PRIxPTR
849               ", target = 0x%X, buffer = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR "",
850               (uintptr_t)dpy, (uintptr_t)ctx, target, (uintptr_t)buffer, (uintptr_t)attrib_list);
851 
852     Thread *thread = egl::GetCurrentThread();
853 
854     egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
855     gl::Context *ctxPacked                = PackParam<gl::Context *>(ctx);
856     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
857 
858     ANGLE_EGL_VALIDATE(thread, CreateImageKHR, GetDisplayIfValid(dpyPacked), EGLImageKHR, dpyPacked,
859                        ctxPacked, target, buffer, attrib_listPacked);
860 
861     return CreateImageKHR(thread, dpyPacked, ctxPacked, target, buffer, attrib_listPacked);
862 }
863 
EGL_DestroyImageKHR(EGLDisplay dpy,EGLImageKHR image)864 EGLBoolean EGLAPIENTRY EGL_DestroyImageKHR(EGLDisplay dpy, EGLImageKHR image)
865 {
866     ANGLE_SCOPED_GLOBAL_LOCK();
867     EGL_EVENT(DestroyImageKHR, "dpy = 0x%016" PRIxPTR ", image = 0x%016" PRIxPTR "", (uintptr_t)dpy,
868               (uintptr_t)image);
869 
870     Thread *thread = egl::GetCurrentThread();
871 
872     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
873     Image *imagePacked      = PackParam<Image *>(image);
874 
875     ANGLE_EGL_VALIDATE(thread, DestroyImageKHR, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
876                        imagePacked);
877 
878     return DestroyImageKHR(thread, dpyPacked, imagePacked);
879 }
880 
881 // EGL_KHR_lock_surface3
EGL_LockSurfaceKHR(EGLDisplay dpy,EGLSurface surface,const EGLint * attrib_list)882 EGLBoolean EGLAPIENTRY EGL_LockSurfaceKHR(EGLDisplay dpy,
883                                           EGLSurface surface,
884                                           const EGLint *attrib_list)
885 {
886     ANGLE_SCOPED_GLOBAL_LOCK();
887     EGL_EVENT(LockSurfaceKHR,
888               "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR
889               "",
890               (uintptr_t)dpy, (uintptr_t)surface, (uintptr_t)attrib_list);
891 
892     Thread *thread = egl::GetCurrentThread();
893 
894     egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
895     Surface *surfacePacked                = PackParam<Surface *>(surface);
896     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
897 
898     ANGLE_EGL_VALIDATE(thread, LockSurfaceKHR, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
899                        surfacePacked, attrib_listPacked);
900 
901     return LockSurfaceKHR(thread, dpyPacked, surfacePacked, attrib_listPacked);
902 }
903 
EGL_QuerySurface64KHR(EGLDisplay dpy,EGLSurface surface,EGLint attribute,EGLAttribKHR * value)904 EGLBoolean EGLAPIENTRY EGL_QuerySurface64KHR(EGLDisplay dpy,
905                                              EGLSurface surface,
906                                              EGLint attribute,
907                                              EGLAttribKHR *value)
908 {
909     ANGLE_SCOPED_GLOBAL_LOCK();
910     EGL_EVENT(QuerySurface64KHR,
911               "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR
912               ", attribute = %d, value = 0x%016" PRIxPTR "",
913               (uintptr_t)dpy, (uintptr_t)surface, attribute, (uintptr_t)value);
914 
915     Thread *thread = egl::GetCurrentThread();
916 
917     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
918     Surface *surfacePacked  = PackParam<Surface *>(surface);
919 
920     ANGLE_EGL_VALIDATE(thread, QuerySurface64KHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
921                        dpyPacked, surfacePacked, attribute, value);
922 
923     return QuerySurface64KHR(thread, dpyPacked, surfacePacked, attribute, value);
924 }
925 
EGL_UnlockSurfaceKHR(EGLDisplay dpy,EGLSurface surface)926 EGLBoolean EGLAPIENTRY EGL_UnlockSurfaceKHR(EGLDisplay dpy, EGLSurface surface)
927 {
928     ANGLE_SCOPED_GLOBAL_LOCK();
929     EGL_EVENT(UnlockSurfaceKHR, "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR "",
930               (uintptr_t)dpy, (uintptr_t)surface);
931 
932     Thread *thread = egl::GetCurrentThread();
933 
934     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
935     Surface *surfacePacked  = PackParam<Surface *>(surface);
936 
937     ANGLE_EGL_VALIDATE(thread, UnlockSurfaceKHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
938                        dpyPacked, surfacePacked);
939 
940     return UnlockSurfaceKHR(thread, dpyPacked, surfacePacked);
941 }
942 
943 // EGL_KHR_reusable_sync
EGL_SignalSyncKHR(EGLDisplay dpy,EGLSyncKHR sync,EGLenum mode)944 EGLBoolean EGLAPIENTRY EGL_SignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode)
945 {
946     ANGLE_SCOPED_GLOBAL_LOCK();
947     EGL_EVENT(SignalSyncKHR, "dpy = 0x%016" PRIxPTR ", sync = 0x%016" PRIxPTR ", mode = 0x%X",
948               (uintptr_t)dpy, (uintptr_t)sync, mode);
949 
950     Thread *thread = egl::GetCurrentThread();
951 
952     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
953     Sync *syncPacked        = PackParam<Sync *>(sync);
954 
955     ANGLE_EGL_VALIDATE(thread, SignalSyncKHR, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
956                        syncPacked, mode);
957 
958     return SignalSyncKHR(thread, dpyPacked, syncPacked, mode);
959 }
960 
961 // ClientWaitSyncKHR is already defined.
962 
963 // CreateSyncKHR is already defined.
964 
965 // DestroySyncKHR is already defined.
966 
967 // GetSyncAttribKHR is already defined.
968 
969 // EGL_KHR_stream
EGL_CreateStreamKHR(EGLDisplay dpy,const EGLint * attrib_list)970 EGLStreamKHR EGLAPIENTRY EGL_CreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list)
971 {
972     ANGLE_SCOPED_GLOBAL_LOCK();
973     EGL_EVENT(CreateStreamKHR, "dpy = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR "",
974               (uintptr_t)dpy, (uintptr_t)attrib_list);
975 
976     Thread *thread = egl::GetCurrentThread();
977 
978     egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
979     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
980 
981     ANGLE_EGL_VALIDATE(thread, CreateStreamKHR, GetDisplayIfValid(dpyPacked), EGLStreamKHR,
982                        dpyPacked, attrib_listPacked);
983 
984     return CreateStreamKHR(thread, dpyPacked, attrib_listPacked);
985 }
986 
EGL_DestroyStreamKHR(EGLDisplay dpy,EGLStreamKHR stream)987 EGLBoolean EGLAPIENTRY EGL_DestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream)
988 {
989     ANGLE_SCOPED_GLOBAL_LOCK();
990     EGL_EVENT(DestroyStreamKHR, "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR "",
991               (uintptr_t)dpy, (uintptr_t)stream);
992 
993     Thread *thread = egl::GetCurrentThread();
994 
995     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
996     Stream *streamPacked    = PackParam<Stream *>(stream);
997 
998     ANGLE_EGL_VALIDATE(thread, DestroyStreamKHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
999                        dpyPacked, streamPacked);
1000 
1001     return DestroyStreamKHR(thread, dpyPacked, streamPacked);
1002 }
1003 
EGL_QueryStreamKHR(EGLDisplay dpy,EGLStreamKHR stream,EGLenum attribute,EGLint * value)1004 EGLBoolean EGLAPIENTRY EGL_QueryStreamKHR(EGLDisplay dpy,
1005                                           EGLStreamKHR stream,
1006                                           EGLenum attribute,
1007                                           EGLint *value)
1008 {
1009     ANGLE_SCOPED_GLOBAL_LOCK();
1010     EGL_EVENT(QueryStreamKHR,
1011               "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR
1012               ", attribute = 0x%X, value = 0x%016" PRIxPTR "",
1013               (uintptr_t)dpy, (uintptr_t)stream, attribute, (uintptr_t)value);
1014 
1015     Thread *thread = egl::GetCurrentThread();
1016 
1017     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
1018     Stream *streamPacked    = PackParam<Stream *>(stream);
1019 
1020     ANGLE_EGL_VALIDATE(thread, QueryStreamKHR, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
1021                        streamPacked, attribute, value);
1022 
1023     return QueryStreamKHR(thread, dpyPacked, streamPacked, attribute, value);
1024 }
1025 
EGL_QueryStreamu64KHR(EGLDisplay dpy,EGLStreamKHR stream,EGLenum attribute,EGLuint64KHR * value)1026 EGLBoolean EGLAPIENTRY EGL_QueryStreamu64KHR(EGLDisplay dpy,
1027                                              EGLStreamKHR stream,
1028                                              EGLenum attribute,
1029                                              EGLuint64KHR *value)
1030 {
1031     ANGLE_SCOPED_GLOBAL_LOCK();
1032     EGL_EVENT(QueryStreamu64KHR,
1033               "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR
1034               ", attribute = 0x%X, value = 0x%016" PRIxPTR "",
1035               (uintptr_t)dpy, (uintptr_t)stream, attribute, (uintptr_t)value);
1036 
1037     Thread *thread = egl::GetCurrentThread();
1038 
1039     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
1040     Stream *streamPacked    = PackParam<Stream *>(stream);
1041 
1042     ANGLE_EGL_VALIDATE(thread, QueryStreamu64KHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
1043                        dpyPacked, streamPacked, attribute, value);
1044 
1045     return QueryStreamu64KHR(thread, dpyPacked, streamPacked, attribute, value);
1046 }
1047 
EGL_StreamAttribKHR(EGLDisplay dpy,EGLStreamKHR stream,EGLenum attribute,EGLint value)1048 EGLBoolean EGLAPIENTRY EGL_StreamAttribKHR(EGLDisplay dpy,
1049                                            EGLStreamKHR stream,
1050                                            EGLenum attribute,
1051                                            EGLint value)
1052 {
1053     ANGLE_SCOPED_GLOBAL_LOCK();
1054     EGL_EVENT(StreamAttribKHR,
1055               "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR ", attribute = 0x%X, value = %d",
1056               (uintptr_t)dpy, (uintptr_t)stream, attribute, value);
1057 
1058     Thread *thread = egl::GetCurrentThread();
1059 
1060     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
1061     Stream *streamPacked    = PackParam<Stream *>(stream);
1062 
1063     ANGLE_EGL_VALIDATE(thread, StreamAttribKHR, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
1064                        streamPacked, attribute, value);
1065 
1066     return StreamAttribKHR(thread, dpyPacked, streamPacked, attribute, value);
1067 }
1068 
1069 // EGL_KHR_stream_consumer_gltexture
EGL_StreamConsumerAcquireKHR(EGLDisplay dpy,EGLStreamKHR stream)1070 EGLBoolean EGLAPIENTRY EGL_StreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream)
1071 {
1072     ANGLE_SCOPED_GLOBAL_LOCK();
1073     EGL_EVENT(StreamConsumerAcquireKHR, "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR "",
1074               (uintptr_t)dpy, (uintptr_t)stream);
1075 
1076     Thread *thread = egl::GetCurrentThread();
1077 
1078     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
1079     Stream *streamPacked    = PackParam<Stream *>(stream);
1080 
1081     ANGLE_EGL_VALIDATE(thread, StreamConsumerAcquireKHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
1082                        dpyPacked, streamPacked);
1083 
1084     return StreamConsumerAcquireKHR(thread, dpyPacked, streamPacked);
1085 }
1086 
EGL_StreamConsumerGLTextureExternalKHR(EGLDisplay dpy,EGLStreamKHR stream)1087 EGLBoolean EGLAPIENTRY EGL_StreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream)
1088 {
1089     ANGLE_SCOPED_GLOBAL_LOCK();
1090     EGL_EVENT(StreamConsumerGLTextureExternalKHR,
1091               "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR "", (uintptr_t)dpy,
1092               (uintptr_t)stream);
1093 
1094     Thread *thread = egl::GetCurrentThread();
1095 
1096     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
1097     Stream *streamPacked    = PackParam<Stream *>(stream);
1098 
1099     ANGLE_EGL_VALIDATE(thread, StreamConsumerGLTextureExternalKHR, GetDisplayIfValid(dpyPacked),
1100                        EGLBoolean, dpyPacked, streamPacked);
1101 
1102     return StreamConsumerGLTextureExternalKHR(thread, dpyPacked, streamPacked);
1103 }
1104 
EGL_StreamConsumerReleaseKHR(EGLDisplay dpy,EGLStreamKHR stream)1105 EGLBoolean EGLAPIENTRY EGL_StreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR stream)
1106 {
1107     ANGLE_SCOPED_GLOBAL_LOCK();
1108     EGL_EVENT(StreamConsumerReleaseKHR, "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR "",
1109               (uintptr_t)dpy, (uintptr_t)stream);
1110 
1111     Thread *thread = egl::GetCurrentThread();
1112 
1113     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
1114     Stream *streamPacked    = PackParam<Stream *>(stream);
1115 
1116     ANGLE_EGL_VALIDATE(thread, StreamConsumerReleaseKHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
1117                        dpyPacked, streamPacked);
1118 
1119     return StreamConsumerReleaseKHR(thread, dpyPacked, streamPacked);
1120 }
1121 
1122 // EGL_KHR_swap_buffers_with_damage
EGL_SwapBuffersWithDamageKHR(EGLDisplay dpy,EGLSurface surface,const EGLint * rects,EGLint n_rects)1123 EGLBoolean EGLAPIENTRY EGL_SwapBuffersWithDamageKHR(EGLDisplay dpy,
1124                                                     EGLSurface surface,
1125                                                     const EGLint *rects,
1126                                                     EGLint n_rects)
1127 {
1128     ANGLE_SCOPED_GLOBAL_LOCK();
1129     EGL_EVENT(SwapBuffersWithDamageKHR,
1130               "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", rects = 0x%016" PRIxPTR
1131               ", n_rects = %d",
1132               (uintptr_t)dpy, (uintptr_t)surface, (uintptr_t)rects, n_rects);
1133 
1134     Thread *thread = egl::GetCurrentThread();
1135 
1136     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
1137     Surface *surfacePacked  = PackParam<Surface *>(surface);
1138 
1139     ANGLE_EGL_VALIDATE(thread, SwapBuffersWithDamageKHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
1140                        dpyPacked, surfacePacked, rects, n_rects);
1141 
1142     return SwapBuffersWithDamageKHR(thread, dpyPacked, surfacePacked, rects, n_rects);
1143 }
1144 
1145 // EGL_KHR_wait_sync
EGL_WaitSyncKHR(EGLDisplay dpy,EGLSyncKHR sync,EGLint flags)1146 EGLint EGLAPIENTRY EGL_WaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags)
1147 {
1148     ANGLE_SCOPED_GLOBAL_LOCK();
1149     EGL_EVENT(WaitSyncKHR, "dpy = 0x%016" PRIxPTR ", sync = 0x%016" PRIxPTR ", flags = %d",
1150               (uintptr_t)dpy, (uintptr_t)sync, flags);
1151 
1152     Thread *thread = egl::GetCurrentThread();
1153 
1154     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
1155     Sync *syncPacked        = PackParam<Sync *>(sync);
1156 
1157     ANGLE_EGL_VALIDATE(thread, WaitSyncKHR, GetDisplayIfValid(dpyPacked), EGLint, dpyPacked,
1158                        syncPacked, flags);
1159 
1160     return WaitSyncKHR(thread, dpyPacked, syncPacked, flags);
1161 }
1162 
1163 // EGL_NV_post_sub_buffer
EGL_PostSubBufferNV(EGLDisplay dpy,EGLSurface surface,EGLint x,EGLint y,EGLint width,EGLint height)1164 EGLBoolean EGLAPIENTRY EGL_PostSubBufferNV(EGLDisplay dpy,
1165                                            EGLSurface surface,
1166                                            EGLint x,
1167                                            EGLint y,
1168                                            EGLint width,
1169                                            EGLint height)
1170 {
1171     ANGLE_SCOPED_GLOBAL_LOCK();
1172     EGL_EVENT(PostSubBufferNV,
1173               "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR
1174               ", x = %d, y = %d, width = %d, height = %d",
1175               (uintptr_t)dpy, (uintptr_t)surface, x, y, width, height);
1176 
1177     Thread *thread = egl::GetCurrentThread();
1178 
1179     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
1180     Surface *surfacePacked  = PackParam<Surface *>(surface);
1181 
1182     ANGLE_EGL_VALIDATE(thread, PostSubBufferNV, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
1183                        surfacePacked, x, y, width, height);
1184 
1185     return PostSubBufferNV(thread, dpyPacked, surfacePacked, x, y, width, height);
1186 }
1187 
1188 // EGL_NV_stream_consumer_gltexture_yuv
EGL_StreamConsumerGLTextureExternalAttribsNV(EGLDisplay dpy,EGLStreamKHR stream,const EGLAttrib * attrib_list)1189 EGLBoolean EGLAPIENTRY EGL_StreamConsumerGLTextureExternalAttribsNV(EGLDisplay dpy,
1190                                                                     EGLStreamKHR stream,
1191                                                                     const EGLAttrib *attrib_list)
1192 {
1193     ANGLE_SCOPED_GLOBAL_LOCK();
1194     EGL_EVENT(StreamConsumerGLTextureExternalAttribsNV,
1195               "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR
1196               "",
1197               (uintptr_t)dpy, (uintptr_t)stream, (uintptr_t)attrib_list);
1198 
1199     Thread *thread = egl::GetCurrentThread();
1200 
1201     egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
1202     Stream *streamPacked                  = PackParam<Stream *>(stream);
1203     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
1204 
1205     ANGLE_EGL_VALIDATE(thread, StreamConsumerGLTextureExternalAttribsNV,
1206                        GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked, streamPacked,
1207                        attrib_listPacked);
1208 
1209     return StreamConsumerGLTextureExternalAttribsNV(thread, dpyPacked, streamPacked,
1210                                                     attrib_listPacked);
1211 }
1212 
1213 }  // extern "C"
1214