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_CHROMIUM_sync_control
EGL_GetSyncValuesCHROMIUM(EGLDisplay dpy,EGLSurface surface,EGLuint64KHR * ust,EGLuint64KHR * msc,EGLuint64KHR * sbc)538 EGLBoolean EGLAPIENTRY EGL_GetSyncValuesCHROMIUM(EGLDisplay dpy,
539                                                  EGLSurface surface,
540                                                  EGLuint64KHR *ust,
541                                                  EGLuint64KHR *msc,
542                                                  EGLuint64KHR *sbc)
543 {
544     ANGLE_SCOPED_GLOBAL_LOCK();
545     EGL_EVENT(GetSyncValuesCHROMIUM,
546               "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", ust = 0x%016" PRIxPTR
547               ", msc = 0x%016" PRIxPTR ", sbc = 0x%016" PRIxPTR "",
548               (uintptr_t)dpy, (uintptr_t)surface, (uintptr_t)ust, (uintptr_t)msc, (uintptr_t)sbc);
549 
550     Thread *thread = egl::GetCurrentThread();
551 
552     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
553     Surface *surfacePacked  = PackParam<Surface *>(surface);
554 
555     ANGLE_EGL_VALIDATE(thread, GetSyncValuesCHROMIUM, GetDisplayIfValid(dpyPacked), EGLBoolean,
556                        dpyPacked, surfacePacked, ust, msc, sbc);
557 
558     return GetSyncValuesCHROMIUM(thread, dpyPacked, surfacePacked, ust, msc, sbc);
559 }
560 
561 // EGL_EXT_device_query
EGL_QueryDeviceAttribEXT(EGLDeviceEXT device,EGLint attribute,EGLAttrib * value)562 EGLBoolean EGLAPIENTRY EGL_QueryDeviceAttribEXT(EGLDeviceEXT device,
563                                                 EGLint attribute,
564                                                 EGLAttrib *value)
565 {
566     ANGLE_SCOPED_GLOBAL_LOCK();
567     EGL_EVENT(QueryDeviceAttribEXT,
568               "device = 0x%016" PRIxPTR ", attribute = %d, value = 0x%016" PRIxPTR "",
569               (uintptr_t)device, attribute, (uintptr_t)value);
570 
571     Thread *thread = egl::GetCurrentThread();
572 
573     Device *devicePacked = PackParam<Device *>(device);
574 
575     ANGLE_EGL_VALIDATE(thread, QueryDeviceAttribEXT, nullptr, EGLBoolean, devicePacked, attribute,
576                        value);
577 
578     return QueryDeviceAttribEXT(thread, devicePacked, attribute, value);
579 }
580 
EGL_QueryDeviceStringEXT(EGLDeviceEXT device,EGLint name)581 const char *EGLAPIENTRY EGL_QueryDeviceStringEXT(EGLDeviceEXT device, EGLint name)
582 {
583     ANGLE_SCOPED_GLOBAL_LOCK();
584     EGL_EVENT(QueryDeviceStringEXT, "device = 0x%016" PRIxPTR ", name = %d", (uintptr_t)device,
585               name);
586 
587     Thread *thread = egl::GetCurrentThread();
588 
589     Device *devicePacked = PackParam<Device *>(device);
590 
591     ANGLE_EGL_VALIDATE(thread, QueryDeviceStringEXT, nullptr, const char *, devicePacked, name);
592 
593     return QueryDeviceStringEXT(thread, devicePacked, name);
594 }
595 
EGL_QueryDisplayAttribEXT(EGLDisplay dpy,EGLint attribute,EGLAttrib * value)596 EGLBoolean EGLAPIENTRY EGL_QueryDisplayAttribEXT(EGLDisplay dpy, EGLint attribute, EGLAttrib *value)
597 {
598     ANGLE_SCOPED_GLOBAL_LOCK();
599     EGL_EVENT(QueryDisplayAttribEXT,
600               "dpy = 0x%016" PRIxPTR ", attribute = %d, value = 0x%016" PRIxPTR "", (uintptr_t)dpy,
601               attribute, (uintptr_t)value);
602 
603     Thread *thread = egl::GetCurrentThread();
604 
605     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
606 
607     ANGLE_EGL_VALIDATE(thread, QueryDisplayAttribEXT, GetDisplayIfValid(dpyPacked), EGLBoolean,
608                        dpyPacked, attribute, value);
609 
610     return QueryDisplayAttribEXT(thread, dpyPacked, attribute, value);
611 }
612 
613 // EGL_EXT_platform_base
EGL_CreatePlatformPixmapSurfaceEXT(EGLDisplay dpy,EGLConfig config,void * native_pixmap,const EGLint * attrib_list)614 EGLSurface EGLAPIENTRY EGL_CreatePlatformPixmapSurfaceEXT(EGLDisplay dpy,
615                                                           EGLConfig config,
616                                                           void *native_pixmap,
617                                                           const EGLint *attrib_list)
618 {
619     ANGLE_SCOPED_GLOBAL_LOCK();
620     EGL_EVENT(CreatePlatformPixmapSurfaceEXT,
621               "dpy = 0x%016" PRIxPTR ", config = 0x%016" PRIxPTR ", native_pixmap = 0x%016" PRIxPTR
622               ", attrib_list = 0x%016" PRIxPTR "",
623               (uintptr_t)dpy, (uintptr_t)config, (uintptr_t)native_pixmap, (uintptr_t)attrib_list);
624 
625     Thread *thread = egl::GetCurrentThread();
626 
627     egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
628     Config *configPacked                  = PackParam<Config *>(config);
629     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
630 
631     ANGLE_EGL_VALIDATE(thread, CreatePlatformPixmapSurfaceEXT, GetDisplayIfValid(dpyPacked),
632                        EGLSurface, dpyPacked, configPacked, native_pixmap, attrib_listPacked);
633 
634     return CreatePlatformPixmapSurfaceEXT(thread, dpyPacked, configPacked, native_pixmap,
635                                           attrib_listPacked);
636 }
637 
EGL_CreatePlatformWindowSurfaceEXT(EGLDisplay dpy,EGLConfig config,void * native_window,const EGLint * attrib_list)638 EGLSurface EGLAPIENTRY EGL_CreatePlatformWindowSurfaceEXT(EGLDisplay dpy,
639                                                           EGLConfig config,
640                                                           void *native_window,
641                                                           const EGLint *attrib_list)
642 {
643     ANGLE_SCOPED_GLOBAL_LOCK();
644     EGL_EVENT(CreatePlatformWindowSurfaceEXT,
645               "dpy = 0x%016" PRIxPTR ", config = 0x%016" PRIxPTR ", native_window = 0x%016" PRIxPTR
646               ", attrib_list = 0x%016" PRIxPTR "",
647               (uintptr_t)dpy, (uintptr_t)config, (uintptr_t)native_window, (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, CreatePlatformWindowSurfaceEXT, GetDisplayIfValid(dpyPacked),
656                        EGLSurface, dpyPacked, configPacked, native_window, attrib_listPacked);
657 
658     return CreatePlatformWindowSurfaceEXT(thread, dpyPacked, configPacked, native_window,
659                                           attrib_listPacked);
660 }
661 
EGL_GetPlatformDisplayEXT(EGLenum platform,void * native_display,const EGLint * attrib_list)662 EGLDisplay EGLAPIENTRY EGL_GetPlatformDisplayEXT(EGLenum platform,
663                                                  void *native_display,
664                                                  const EGLint *attrib_list)
665 {
666     ANGLE_SCOPED_GLOBAL_LOCK();
667     EGL_EVENT(GetPlatformDisplayEXT,
668               "platform = 0x%X, native_display = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR
669               "",
670               platform, (uintptr_t)native_display, (uintptr_t)attrib_list);
671 
672     Thread *thread = egl::GetCurrentThread();
673 
674     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
675 
676     ANGLE_EGL_VALIDATE(thread, GetPlatformDisplayEXT, nullptr, EGLDisplay, platform, native_display,
677                        attrib_listPacked);
678 
679     return GetPlatformDisplayEXT(thread, platform, native_display, attrib_listPacked);
680 }
681 
682 // EGL_KHR_debug
EGL_DebugMessageControlKHR(EGLDEBUGPROCKHR callback,const EGLAttrib * attrib_list)683 EGLint EGLAPIENTRY EGL_DebugMessageControlKHR(EGLDEBUGPROCKHR callback,
684                                               const EGLAttrib *attrib_list)
685 {
686     ANGLE_SCOPED_GLOBAL_LOCK();
687     EGL_EVENT(DebugMessageControlKHR,
688               "callback = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR "", (uintptr_t)callback,
689               (uintptr_t)attrib_list);
690 
691     Thread *thread = egl::GetCurrentThread();
692 
693     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
694 
695     ANGLE_EGL_VALIDATE(thread, DebugMessageControlKHR, nullptr, EGLint, callback,
696                        attrib_listPacked);
697 
698     return DebugMessageControlKHR(thread, callback, attrib_listPacked);
699 }
700 
EGL_LabelObjectKHR(EGLDisplay display,EGLenum objectType,EGLObjectKHR object,EGLLabelKHR label)701 EGLint EGLAPIENTRY EGL_LabelObjectKHR(EGLDisplay display,
702                                       EGLenum objectType,
703                                       EGLObjectKHR object,
704                                       EGLLabelKHR label)
705 {
706     ANGLE_SCOPED_GLOBAL_LOCK();
707     EGL_EVENT(LabelObjectKHR,
708               "display = 0x%016" PRIxPTR ", objectType = 0x%X, object = 0x%016" PRIxPTR
709               ", label = 0x%016" PRIxPTR "",
710               (uintptr_t)display, objectType, (uintptr_t)object, (uintptr_t)label);
711 
712     Thread *thread = egl::GetCurrentThread();
713 
714     egl::Display *displayPacked = PackParam<egl::Display *>(display);
715     ObjectType objectTypePacked = PackParam<ObjectType>(objectType);
716 
717     ANGLE_EGL_VALIDATE(thread, LabelObjectKHR, GetDisplayIfValid(displayPacked), EGLint,
718                        displayPacked, objectTypePacked, object, label);
719 
720     return LabelObjectKHR(thread, displayPacked, objectTypePacked, object, label);
721 }
722 
EGL_QueryDebugKHR(EGLint attribute,EGLAttrib * value)723 EGLBoolean EGLAPIENTRY EGL_QueryDebugKHR(EGLint attribute, EGLAttrib *value)
724 {
725     ANGLE_SCOPED_GLOBAL_LOCK();
726     EGL_EVENT(QueryDebugKHR, "attribute = %d, value = 0x%016" PRIxPTR "", attribute,
727               (uintptr_t)value);
728 
729     Thread *thread = egl::GetCurrentThread();
730 
731     ANGLE_EGL_VALIDATE(thread, QueryDebugKHR, nullptr, EGLBoolean, attribute, value);
732 
733     return QueryDebugKHR(thread, attribute, value);
734 }
735 
736 // EGL_KHR_fence_sync
EGL_ClientWaitSyncKHR(EGLDisplay dpy,EGLSyncKHR sync,EGLint flags,EGLTimeKHR timeout)737 EGLint EGLAPIENTRY EGL_ClientWaitSyncKHR(EGLDisplay dpy,
738                                          EGLSyncKHR sync,
739                                          EGLint flags,
740                                          EGLTimeKHR timeout)
741 {
742     ANGLE_SCOPED_GLOBAL_LOCK();
743     EGL_EVENT(ClientWaitSyncKHR,
744               "dpy = 0x%016" PRIxPTR ", sync = 0x%016" PRIxPTR ", flags = %d, timeout = %llu",
745               (uintptr_t)dpy, (uintptr_t)sync, flags, static_cast<unsigned long long>(timeout));
746 
747     Thread *thread = egl::GetCurrentThread();
748 
749     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
750     Sync *syncPacked        = PackParam<Sync *>(sync);
751 
752     ANGLE_EGL_VALIDATE(thread, ClientWaitSyncKHR, GetDisplayIfValid(dpyPacked), EGLint, dpyPacked,
753                        syncPacked, flags, timeout);
754 
755     return ClientWaitSyncKHR(thread, dpyPacked, syncPacked, flags, timeout);
756 }
757 
EGL_CreateSyncKHR(EGLDisplay dpy,EGLenum type,const EGLint * attrib_list)758 EGLSyncKHR EGLAPIENTRY EGL_CreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)
759 {
760     ANGLE_SCOPED_GLOBAL_LOCK();
761     EGL_EVENT(CreateSyncKHR,
762               "dpy = 0x%016" PRIxPTR ", type = 0x%X, attrib_list = 0x%016" PRIxPTR "",
763               (uintptr_t)dpy, type, (uintptr_t)attrib_list);
764 
765     Thread *thread = egl::GetCurrentThread();
766 
767     egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
768     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
769 
770     ANGLE_EGL_VALIDATE(thread, CreateSyncKHR, GetDisplayIfValid(dpyPacked), EGLSyncKHR, dpyPacked,
771                        type, attrib_listPacked);
772 
773     return CreateSyncKHR(thread, dpyPacked, type, attrib_listPacked);
774 }
775 
EGL_DestroySyncKHR(EGLDisplay dpy,EGLSyncKHR sync)776 EGLBoolean EGLAPIENTRY EGL_DestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync)
777 {
778     ANGLE_SCOPED_GLOBAL_LOCK();
779     EGL_EVENT(DestroySyncKHR, "dpy = 0x%016" PRIxPTR ", sync = 0x%016" PRIxPTR "", (uintptr_t)dpy,
780               (uintptr_t)sync);
781 
782     Thread *thread = egl::GetCurrentThread();
783 
784     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
785     Sync *syncPacked        = PackParam<Sync *>(sync);
786 
787     ANGLE_EGL_VALIDATE(thread, DestroySyncKHR, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
788                        syncPacked);
789 
790     return DestroySyncKHR(thread, dpyPacked, syncPacked);
791 }
792 
EGL_GetSyncAttribKHR(EGLDisplay dpy,EGLSyncKHR sync,EGLint attribute,EGLint * value)793 EGLBoolean EGLAPIENTRY EGL_GetSyncAttribKHR(EGLDisplay dpy,
794                                             EGLSyncKHR sync,
795                                             EGLint attribute,
796                                             EGLint *value)
797 {
798     ANGLE_SCOPED_GLOBAL_LOCK();
799     EGL_EVENT(GetSyncAttribKHR,
800               "dpy = 0x%016" PRIxPTR ", sync = 0x%016" PRIxPTR
801               ", attribute = %d, value = 0x%016" PRIxPTR "",
802               (uintptr_t)dpy, (uintptr_t)sync, attribute, (uintptr_t)value);
803 
804     Thread *thread = egl::GetCurrentThread();
805 
806     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
807     Sync *syncPacked        = PackParam<Sync *>(sync);
808 
809     ANGLE_EGL_VALIDATE(thread, GetSyncAttribKHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
810                        dpyPacked, syncPacked, attribute, value);
811 
812     return GetSyncAttribKHR(thread, dpyPacked, syncPacked, attribute, value);
813 }
814 
815 // EGL_KHR_image
EGL_CreateImageKHR(EGLDisplay dpy,EGLContext ctx,EGLenum target,EGLClientBuffer buffer,const EGLint * attrib_list)816 EGLImageKHR EGLAPIENTRY EGL_CreateImageKHR(EGLDisplay dpy,
817                                            EGLContext ctx,
818                                            EGLenum target,
819                                            EGLClientBuffer buffer,
820                                            const EGLint *attrib_list)
821 {
822     ANGLE_SCOPED_GLOBAL_LOCK();
823     EGL_EVENT(CreateImageKHR,
824               "dpy = 0x%016" PRIxPTR ", ctx = 0x%016" PRIxPTR
825               ", target = 0x%X, buffer = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR "",
826               (uintptr_t)dpy, (uintptr_t)ctx, target, (uintptr_t)buffer, (uintptr_t)attrib_list);
827 
828     Thread *thread = egl::GetCurrentThread();
829 
830     egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
831     gl::Context *ctxPacked                = PackParam<gl::Context *>(ctx);
832     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
833 
834     ANGLE_EGL_VALIDATE(thread, CreateImageKHR, GetDisplayIfValid(dpyPacked), EGLImageKHR, dpyPacked,
835                        ctxPacked, target, buffer, attrib_listPacked);
836 
837     return CreateImageKHR(thread, dpyPacked, ctxPacked, target, buffer, attrib_listPacked);
838 }
839 
EGL_DestroyImageKHR(EGLDisplay dpy,EGLImageKHR image)840 EGLBoolean EGLAPIENTRY EGL_DestroyImageKHR(EGLDisplay dpy, EGLImageKHR image)
841 {
842     ANGLE_SCOPED_GLOBAL_LOCK();
843     EGL_EVENT(DestroyImageKHR, "dpy = 0x%016" PRIxPTR ", image = 0x%016" PRIxPTR "", (uintptr_t)dpy,
844               (uintptr_t)image);
845 
846     Thread *thread = egl::GetCurrentThread();
847 
848     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
849     Image *imagePacked      = PackParam<Image *>(image);
850 
851     ANGLE_EGL_VALIDATE(thread, DestroyImageKHR, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
852                        imagePacked);
853 
854     return DestroyImageKHR(thread, dpyPacked, imagePacked);
855 }
856 
857 // EGL_KHR_reusable_sync
EGL_SignalSyncKHR(EGLDisplay dpy,EGLSyncKHR sync,EGLenum mode)858 EGLBoolean EGLAPIENTRY EGL_SignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode)
859 {
860     ANGLE_SCOPED_GLOBAL_LOCK();
861     EGL_EVENT(SignalSyncKHR, "dpy = 0x%016" PRIxPTR ", sync = 0x%016" PRIxPTR ", mode = 0x%X",
862               (uintptr_t)dpy, (uintptr_t)sync, mode);
863 
864     Thread *thread = egl::GetCurrentThread();
865 
866     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
867     Sync *syncPacked        = PackParam<Sync *>(sync);
868 
869     ANGLE_EGL_VALIDATE(thread, SignalSyncKHR, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
870                        syncPacked, mode);
871 
872     return SignalSyncKHR(thread, dpyPacked, syncPacked, mode);
873 }
874 
875 // ClientWaitSyncKHR is already defined.
876 
877 // CreateSyncKHR is already defined.
878 
879 // DestroySyncKHR is already defined.
880 
881 // GetSyncAttribKHR is already defined.
882 
883 // EGL_KHR_stream
EGL_CreateStreamKHR(EGLDisplay dpy,const EGLint * attrib_list)884 EGLStreamKHR EGLAPIENTRY EGL_CreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list)
885 {
886     ANGLE_SCOPED_GLOBAL_LOCK();
887     EGL_EVENT(CreateStreamKHR, "dpy = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR "",
888               (uintptr_t)dpy, (uintptr_t)attrib_list);
889 
890     Thread *thread = egl::GetCurrentThread();
891 
892     egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
893     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
894 
895     ANGLE_EGL_VALIDATE(thread, CreateStreamKHR, GetDisplayIfValid(dpyPacked), EGLStreamKHR,
896                        dpyPacked, attrib_listPacked);
897 
898     return CreateStreamKHR(thread, dpyPacked, attrib_listPacked);
899 }
900 
EGL_DestroyStreamKHR(EGLDisplay dpy,EGLStreamKHR stream)901 EGLBoolean EGLAPIENTRY EGL_DestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream)
902 {
903     ANGLE_SCOPED_GLOBAL_LOCK();
904     EGL_EVENT(DestroyStreamKHR, "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR "",
905               (uintptr_t)dpy, (uintptr_t)stream);
906 
907     Thread *thread = egl::GetCurrentThread();
908 
909     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
910     Stream *streamPacked    = PackParam<Stream *>(stream);
911 
912     ANGLE_EGL_VALIDATE(thread, DestroyStreamKHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
913                        dpyPacked, streamPacked);
914 
915     return DestroyStreamKHR(thread, dpyPacked, streamPacked);
916 }
917 
EGL_QueryStreamKHR(EGLDisplay dpy,EGLStreamKHR stream,EGLenum attribute,EGLint * value)918 EGLBoolean EGLAPIENTRY EGL_QueryStreamKHR(EGLDisplay dpy,
919                                           EGLStreamKHR stream,
920                                           EGLenum attribute,
921                                           EGLint *value)
922 {
923     ANGLE_SCOPED_GLOBAL_LOCK();
924     EGL_EVENT(QueryStreamKHR,
925               "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR
926               ", attribute = 0x%X, value = 0x%016" PRIxPTR "",
927               (uintptr_t)dpy, (uintptr_t)stream, attribute, (uintptr_t)value);
928 
929     Thread *thread = egl::GetCurrentThread();
930 
931     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
932     Stream *streamPacked    = PackParam<Stream *>(stream);
933 
934     ANGLE_EGL_VALIDATE(thread, QueryStreamKHR, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
935                        streamPacked, attribute, value);
936 
937     return QueryStreamKHR(thread, dpyPacked, streamPacked, attribute, value);
938 }
939 
EGL_QueryStreamu64KHR(EGLDisplay dpy,EGLStreamKHR stream,EGLenum attribute,EGLuint64KHR * value)940 EGLBoolean EGLAPIENTRY EGL_QueryStreamu64KHR(EGLDisplay dpy,
941                                              EGLStreamKHR stream,
942                                              EGLenum attribute,
943                                              EGLuint64KHR *value)
944 {
945     ANGLE_SCOPED_GLOBAL_LOCK();
946     EGL_EVENT(QueryStreamu64KHR,
947               "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR
948               ", attribute = 0x%X, value = 0x%016" PRIxPTR "",
949               (uintptr_t)dpy, (uintptr_t)stream, attribute, (uintptr_t)value);
950 
951     Thread *thread = egl::GetCurrentThread();
952 
953     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
954     Stream *streamPacked    = PackParam<Stream *>(stream);
955 
956     ANGLE_EGL_VALIDATE(thread, QueryStreamu64KHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
957                        dpyPacked, streamPacked, attribute, value);
958 
959     return QueryStreamu64KHR(thread, dpyPacked, streamPacked, attribute, value);
960 }
961 
EGL_StreamAttribKHR(EGLDisplay dpy,EGLStreamKHR stream,EGLenum attribute,EGLint value)962 EGLBoolean EGLAPIENTRY EGL_StreamAttribKHR(EGLDisplay dpy,
963                                            EGLStreamKHR stream,
964                                            EGLenum attribute,
965                                            EGLint value)
966 {
967     ANGLE_SCOPED_GLOBAL_LOCK();
968     EGL_EVENT(StreamAttribKHR,
969               "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR ", attribute = 0x%X, value = %d",
970               (uintptr_t)dpy, (uintptr_t)stream, attribute, value);
971 
972     Thread *thread = egl::GetCurrentThread();
973 
974     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
975     Stream *streamPacked    = PackParam<Stream *>(stream);
976 
977     ANGLE_EGL_VALIDATE(thread, StreamAttribKHR, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
978                        streamPacked, attribute, value);
979 
980     return StreamAttribKHR(thread, dpyPacked, streamPacked, attribute, value);
981 }
982 
983 // EGL_KHR_stream_consumer_gltexture
EGL_StreamConsumerAcquireKHR(EGLDisplay dpy,EGLStreamKHR stream)984 EGLBoolean EGLAPIENTRY EGL_StreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream)
985 {
986     ANGLE_SCOPED_GLOBAL_LOCK();
987     EGL_EVENT(StreamConsumerAcquireKHR, "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR "",
988               (uintptr_t)dpy, (uintptr_t)stream);
989 
990     Thread *thread = egl::GetCurrentThread();
991 
992     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
993     Stream *streamPacked    = PackParam<Stream *>(stream);
994 
995     ANGLE_EGL_VALIDATE(thread, StreamConsumerAcquireKHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
996                        dpyPacked, streamPacked);
997 
998     return StreamConsumerAcquireKHR(thread, dpyPacked, streamPacked);
999 }
1000 
EGL_StreamConsumerGLTextureExternalKHR(EGLDisplay dpy,EGLStreamKHR stream)1001 EGLBoolean EGLAPIENTRY EGL_StreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream)
1002 {
1003     ANGLE_SCOPED_GLOBAL_LOCK();
1004     EGL_EVENT(StreamConsumerGLTextureExternalKHR,
1005               "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR "", (uintptr_t)dpy,
1006               (uintptr_t)stream);
1007 
1008     Thread *thread = egl::GetCurrentThread();
1009 
1010     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
1011     Stream *streamPacked    = PackParam<Stream *>(stream);
1012 
1013     ANGLE_EGL_VALIDATE(thread, StreamConsumerGLTextureExternalKHR, GetDisplayIfValid(dpyPacked),
1014                        EGLBoolean, dpyPacked, streamPacked);
1015 
1016     return StreamConsumerGLTextureExternalKHR(thread, dpyPacked, streamPacked);
1017 }
1018 
EGL_StreamConsumerReleaseKHR(EGLDisplay dpy,EGLStreamKHR stream)1019 EGLBoolean EGLAPIENTRY EGL_StreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR stream)
1020 {
1021     ANGLE_SCOPED_GLOBAL_LOCK();
1022     EGL_EVENT(StreamConsumerReleaseKHR, "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR "",
1023               (uintptr_t)dpy, (uintptr_t)stream);
1024 
1025     Thread *thread = egl::GetCurrentThread();
1026 
1027     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
1028     Stream *streamPacked    = PackParam<Stream *>(stream);
1029 
1030     ANGLE_EGL_VALIDATE(thread, StreamConsumerReleaseKHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
1031                        dpyPacked, streamPacked);
1032 
1033     return StreamConsumerReleaseKHR(thread, dpyPacked, streamPacked);
1034 }
1035 
1036 // EGL_KHR_swap_buffers_with_damage
EGL_SwapBuffersWithDamageKHR(EGLDisplay dpy,EGLSurface surface,const EGLint * rects,EGLint n_rects)1037 EGLBoolean EGLAPIENTRY EGL_SwapBuffersWithDamageKHR(EGLDisplay dpy,
1038                                                     EGLSurface surface,
1039                                                     const EGLint *rects,
1040                                                     EGLint n_rects)
1041 {
1042     ANGLE_SCOPED_GLOBAL_LOCK();
1043     EGL_EVENT(SwapBuffersWithDamageKHR,
1044               "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR ", rects = 0x%016" PRIxPTR
1045               ", n_rects = %d",
1046               (uintptr_t)dpy, (uintptr_t)surface, (uintptr_t)rects, n_rects);
1047 
1048     Thread *thread = egl::GetCurrentThread();
1049 
1050     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
1051     Surface *surfacePacked  = PackParam<Surface *>(surface);
1052 
1053     ANGLE_EGL_VALIDATE(thread, SwapBuffersWithDamageKHR, GetDisplayIfValid(dpyPacked), EGLBoolean,
1054                        dpyPacked, surfacePacked, rects, n_rects);
1055 
1056     return SwapBuffersWithDamageKHR(thread, dpyPacked, surfacePacked, rects, n_rects);
1057 }
1058 
1059 // EGL_KHR_wait_sync
EGL_WaitSyncKHR(EGLDisplay dpy,EGLSyncKHR sync,EGLint flags)1060 EGLint EGLAPIENTRY EGL_WaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags)
1061 {
1062     ANGLE_SCOPED_GLOBAL_LOCK();
1063     EGL_EVENT(WaitSyncKHR, "dpy = 0x%016" PRIxPTR ", sync = 0x%016" PRIxPTR ", flags = %d",
1064               (uintptr_t)dpy, (uintptr_t)sync, flags);
1065 
1066     Thread *thread = egl::GetCurrentThread();
1067 
1068     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
1069     Sync *syncPacked        = PackParam<Sync *>(sync);
1070 
1071     ANGLE_EGL_VALIDATE(thread, WaitSyncKHR, GetDisplayIfValid(dpyPacked), EGLint, dpyPacked,
1072                        syncPacked, flags);
1073 
1074     return WaitSyncKHR(thread, dpyPacked, syncPacked, flags);
1075 }
1076 
1077 // EGL_NV_post_sub_buffer
EGL_PostSubBufferNV(EGLDisplay dpy,EGLSurface surface,EGLint x,EGLint y,EGLint width,EGLint height)1078 EGLBoolean EGLAPIENTRY EGL_PostSubBufferNV(EGLDisplay dpy,
1079                                            EGLSurface surface,
1080                                            EGLint x,
1081                                            EGLint y,
1082                                            EGLint width,
1083                                            EGLint height)
1084 {
1085     ANGLE_SCOPED_GLOBAL_LOCK();
1086     EGL_EVENT(PostSubBufferNV,
1087               "dpy = 0x%016" PRIxPTR ", surface = 0x%016" PRIxPTR
1088               ", x = %d, y = %d, width = %d, height = %d",
1089               (uintptr_t)dpy, (uintptr_t)surface, x, y, width, height);
1090 
1091     Thread *thread = egl::GetCurrentThread();
1092 
1093     egl::Display *dpyPacked = PackParam<egl::Display *>(dpy);
1094     Surface *surfacePacked  = PackParam<Surface *>(surface);
1095 
1096     ANGLE_EGL_VALIDATE(thread, PostSubBufferNV, GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked,
1097                        surfacePacked, x, y, width, height);
1098 
1099     return PostSubBufferNV(thread, dpyPacked, surfacePacked, x, y, width, height);
1100 }
1101 
1102 // EGL_NV_stream_consumer_gltexture_yuv
EGL_StreamConsumerGLTextureExternalAttribsNV(EGLDisplay dpy,EGLStreamKHR stream,const EGLAttrib * attrib_list)1103 EGLBoolean EGLAPIENTRY EGL_StreamConsumerGLTextureExternalAttribsNV(EGLDisplay dpy,
1104                                                                     EGLStreamKHR stream,
1105                                                                     const EGLAttrib *attrib_list)
1106 {
1107     ANGLE_SCOPED_GLOBAL_LOCK();
1108     EGL_EVENT(StreamConsumerGLTextureExternalAttribsNV,
1109               "dpy = 0x%016" PRIxPTR ", stream = 0x%016" PRIxPTR ", attrib_list = 0x%016" PRIxPTR
1110               "",
1111               (uintptr_t)dpy, (uintptr_t)stream, (uintptr_t)attrib_list);
1112 
1113     Thread *thread = egl::GetCurrentThread();
1114 
1115     egl::Display *dpyPacked               = PackParam<egl::Display *>(dpy);
1116     Stream *streamPacked                  = PackParam<Stream *>(stream);
1117     const AttributeMap &attrib_listPacked = PackParam<const AttributeMap &>(attrib_list);
1118 
1119     ANGLE_EGL_VALIDATE(thread, StreamConsumerGLTextureExternalAttribsNV,
1120                        GetDisplayIfValid(dpyPacked), EGLBoolean, dpyPacked, streamPacked,
1121                        attrib_listPacked);
1122 
1123     return StreamConsumerGLTextureExternalAttribsNV(thread, dpyPacked, streamPacked,
1124                                                     attrib_listPacked);
1125 }
1126 
1127 }  // extern "C"
1128