2
2
* @license
3
3
* Copyright 2012 The Emscripten Authors
4
4
* SPDX-License-Identifier: MIT
5
+ * SPDX-FileCopyrightText: Portions Copyright 2023 Siemens
6
+ * Modified on February 2023 by Siemens and/or its affiliates to improve memory64 support
5
7
*/
6
8
7
9
/*
@@ -91,7 +93,7 @@ var LibraryEGL = {
91
93
92
94
// EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id);
93
95
eglGetDisplay__proxy: 'sync' ,
94
- eglGetDisplay__sig : 'ii ' ,
96
+ eglGetDisplay__sig : 'pp ' ,
95
97
eglGetDisplay : function ( nativeDisplayType ) {
96
98
EGL . setErrorCode ( 0x3000 /* EGL_SUCCESS */ ) ;
97
99
// Note: As a 'conformant' implementation of EGL, we would prefer to init here only if the user
@@ -110,7 +112,7 @@ var LibraryEGL = {
110
112
111
113
// EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor);
112
114
eglInitialize__proxy : 'sync' ,
113
- eglInitialize__sig : 'iiii ' ,
115
+ eglInitialize__sig : 'ippp ' ,
114
116
eglInitialize : function ( display , majorVersion , minorVersion ) {
115
117
if ( display != 62000 /* Magic ID for Emscripten 'default display' */ ) {
116
118
EGL . setErrorCode ( 0x3008 /* EGL_BAD_DISPLAY */ ) ;
@@ -129,7 +131,7 @@ var LibraryEGL = {
129
131
130
132
// EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy);
131
133
eglTerminate__proxy : 'sync' ,
132
- eglTerminate__sig : 'ii ' ,
134
+ eglTerminate__sig : 'ip ' ,
133
135
eglTerminate : function ( display ) {
134
136
if ( display != 62000 /* Magic ID for Emscripten 'default display' */ ) {
135
137
EGL . setErrorCode ( 0x3008 /* EGL_BAD_DISPLAY */ ) ;
@@ -145,21 +147,21 @@ var LibraryEGL = {
145
147
146
148
// EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
147
149
eglGetConfigs__proxy : 'sync' ,
148
- eglGetConfigs__sig : 'iiiii ' ,
150
+ eglGetConfigs__sig : 'ippip ' ,
149
151
eglGetConfigs : function ( display , configs , config_size , numConfigs ) {
150
152
return EGL . chooseConfig ( display , 0 , configs , config_size , numConfigs ) ;
151
153
} ,
152
154
153
155
// EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
154
156
eglChooseConfig__proxy : 'sync' ,
155
- eglChooseConfig__sig : 'iiiiii ' ,
157
+ eglChooseConfig__sig : 'ipppip ' ,
156
158
eglChooseConfig : function ( display , attrib_list , configs , config_size , numConfigs ) {
157
159
return EGL . chooseConfig ( display , attrib_list , configs , config_size , numConfigs ) ;
158
160
} ,
159
161
160
162
// EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
161
163
eglGetConfigAttrib__proxy : 'sync' ,
162
- eglGetConfigAttrib__sig : 'iiiii ' ,
164
+ eglGetConfigAttrib__sig : 'ippip ' ,
163
165
eglGetConfigAttrib : function ( display , config , attribute , value ) {
164
166
if ( display != 62000 /* Magic ID for Emscripten 'default display' */ ) {
165
167
EGL . setErrorCode ( 0x3008 /* EGL_BAD_DISPLAY */ ) ;
@@ -277,7 +279,7 @@ var LibraryEGL = {
277
279
278
280
// EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list);
279
281
eglCreateWindowSurface__proxy : 'sync' ,
280
- eglCreateWindowSurface__sig : 'iiiii ' ,
282
+ eglCreateWindowSurface__sig : 'ppppp ' ,
281
283
eglCreateWindowSurface : function ( display , config , win , attrib_list ) {
282
284
if ( display != 62000 /* Magic ID for Emscripten 'default display' */ ) {
283
285
EGL . setErrorCode ( 0x3008 /* EGL_BAD_DISPLAY */ ) ;
@@ -297,7 +299,7 @@ var LibraryEGL = {
297
299
298
300
// EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay display, EGLSurface surface);
299
301
eglDestroySurface__proxy : 'sync' ,
300
- eglDestroySurface__sig : 'iii ' ,
302
+ eglDestroySurface__sig : 'ipp ' ,
301
303
eglDestroySurface : function ( display , surface ) {
302
304
if ( display != 62000 /* Magic ID for Emscripten 'default display' */ ) {
303
305
EGL . setErrorCode ( 0x3008 /* EGL_BAD_DISPLAY */ ) ;
@@ -321,7 +323,7 @@ var LibraryEGL = {
321
323
322
324
// EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
323
325
eglCreateContext__proxy : 'sync' ,
324
- eglCreateContext__sig : 'iiiii ' ,
326
+ eglCreateContext__sig : 'ppppp ' ,
325
327
eglCreateContext : function ( display , config , hmm , contextAttribs ) {
326
328
if ( display != 62000 /* Magic ID for Emscripten 'default display' */ ) {
327
329
EGL . setErrorCode ( 0x3008 /* EGL_BAD_DISPLAY */ ) ;
@@ -386,7 +388,7 @@ var LibraryEGL = {
386
388
387
389
// EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext context);
388
390
eglDestroyContext__proxy : 'sync' ,
389
- eglDestroyContext__sig : 'iii ' ,
391
+ eglDestroyContext__sig : 'ipp ' ,
390
392
eglDestroyContext : function ( display , context ) {
391
393
if ( display != 62000 /* Magic ID for Emscripten 'default display' */ ) {
392
394
EGL . setErrorCode ( 0x3008 /* EGL_BAD_DISPLAY */ ) ;
@@ -407,7 +409,7 @@ var LibraryEGL = {
407
409
408
410
// EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
409
411
eglQuerySurface__proxy : 'sync' ,
410
- eglQuerySurface__sig : 'iiiii ' ,
412
+ eglQuerySurface__sig : 'ippip ' ,
411
413
eglQuerySurface : function ( display , surface , attribute , value ) {
412
414
if ( display != 62000 /* Magic ID for Emscripten 'default display' */ ) {
413
415
EGL . setErrorCode ( 0x3008 /* EGL_BAD_DISPLAY */ ) ;
@@ -474,7 +476,7 @@ var LibraryEGL = {
474
476
475
477
// EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
476
478
eglQueryContext__proxy : 'sync' ,
477
- eglQueryContext__sig : 'iiiii ' ,
479
+ eglQueryContext__sig : 'ippip ' ,
478
480
eglQueryContext : function ( display , context , attribute , value ) {
479
481
if ( display != 62000 /* Magic ID for Emscripten 'default display' */ ) {
480
482
EGL . setErrorCode ( 0x3008 /* EGL_BAD_DISPLAY */ ) ;
@@ -522,7 +524,7 @@ var LibraryEGL = {
522
524
// EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name);
523
525
eglQueryString__deps : [ '$allocateUTF8' ] ,
524
526
eglQueryString__proxy : 'sync' ,
525
- eglQueryString__sig : 'iii ' ,
527
+ eglQueryString__sig : 'ppi ' ,
526
528
eglQueryString : function ( display , name ) {
527
529
if ( display != 62000 /* Magic ID for Emscripten 'default display' */ ) {
528
530
EGL . setErrorCode ( 0x3008 /* EGL_BAD_DISPLAY */ ) ;
@@ -589,7 +591,7 @@ var LibraryEGL = {
589
591
// EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
590
592
eglSwapInterval__deps : [ 'emscripten_set_main_loop_timing' ] ,
591
593
eglSwapInterval__proxy : 'sync' ,
592
- eglSwapInterval__sig : 'iii ' ,
594
+ eglSwapInterval__sig : 'ipi ' ,
593
595
eglSwapInterval : function ( display , interval ) {
594
596
if ( display != 62000 /* Magic ID for Emscripten 'default display' */ ) {
595
597
EGL . setErrorCode ( 0x3008 /* EGL_BAD_DISPLAY */ ) ;
@@ -605,7 +607,7 @@ var LibraryEGL = {
605
607
// EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
606
608
eglMakeCurrent__deps : [ '$GL' ] ,
607
609
eglMakeCurrent__proxy : 'sync' ,
608
- eglMakeCurrent__sig : 'iiiii ' ,
610
+ eglMakeCurrent__sig : 'ipppp ' ,
609
611
eglMakeCurrent : function ( display , draw , read , context ) {
610
612
if ( display != 62000 /* Magic ID for Emscripten 'default display' */ ) {
611
613
EGL . setErrorCode ( 0x3008 /* EGL_BAD_DISPLAY */ ) ;
@@ -632,14 +634,14 @@ var LibraryEGL = {
632
634
633
635
// EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void);
634
636
eglGetCurrentContext__proxy : 'sync' ,
635
- eglGetCurrentContext__sig : 'i ' ,
637
+ eglGetCurrentContext__sig : 'p ' ,
636
638
eglGetCurrentContext : function ( ) {
637
639
return EGL . currentContext ;
638
640
} ,
639
641
640
642
// EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw);
641
643
eglGetCurrentSurface__proxy : 'sync' ,
642
- eglGetCurrentSurface__sig : 'ii ' ,
644
+ eglGetCurrentSurface__sig : 'pi ' ,
643
645
eglGetCurrentSurface : function ( readdraw ) {
644
646
if ( readdraw == 0x305A /* EGL_READ */ ) {
645
647
return EGL . currentReadSurface ;
@@ -653,15 +655,15 @@ var LibraryEGL = {
653
655
654
656
// EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void);
655
657
eglGetCurrentDisplay__proxy : 'sync' ,
656
- eglGetCurrentDisplay__sig : 'i ' ,
658
+ eglGetCurrentDisplay__sig : 'p ' ,
657
659
eglGetCurrentDisplay : function ( ) {
658
660
return EGL . currentContext ? 62000 /* Magic ID for Emscripten 'default display' */ : 0 ;
659
661
} ,
660
662
661
663
// EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
662
664
eglSwapBuffers__proxy : 'sync' ,
663
- eglSwapBuffers__sig : 'iii ' ,
664
- eglSwapBuffers : function ( ) {
665
+ eglSwapBuffers__sig : 'ipp ' ,
666
+ eglSwapBuffers : function ( dpy , surface ) {
665
667
#if PROXY_TO_WORKER
666
668
if ( Browser . doSwapBuffers ) Browser . doSwapBuffers ( ) ;
667
669
#endif
0 commit comments