Skip to content

Commit 5304ef8

Browse files
authored
Move settings of GL_ENABLE_GET_PROC_ADDRESS to sdl2.py. NFC (#25672)
This also allows it to be removed from COMPILE_TIME_SETTINGS. Followup to #20802
1 parent 79bf3e0 commit 5304ef8

File tree

6 files changed

+7
-11
lines changed

6 files changed

+7
-11
lines changed

‎emcc.py‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -484,11 +484,6 @@ def phase_setup(options, state):
484484
else:
485485
settings.SUPPORT_LONGJMP = 'emscripten'
486486

487-
# SDL2 requires eglGetProcAddress() to work.
488-
# NOTE: if SDL2 is updated to not rely on eglGetProcAddress(), this can be removed
489-
if settings.USE_SDL == 2 or settings.USE_SDL_MIXER == 2 or settings.USE_SDL_GFX == 2:
490-
default_setting('GL_ENABLE_GET_PROC_ADDRESS', 1)
491-
492487

493488
@ToolchainProfiler.profile_block('compile inputs')
494489
def phase_compile_inputs(options, state, newargs):

‎site/source/docs/tools_reference/settings_reference.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ If 1, link with support to glGetProcAddress() functionality.
934934
In WebGL, glGetProcAddress() causes a substantial code size and performance impact, since WebGL
935935
does not natively provide such functionality, and it must be emulated. Using glGetProcAddress()
936936
is not recommended. If you still need to use this, e.g. when porting an existing renderer,
937-
you can link with -sGL_ENABLE_GET_PROC_ADDRESS=1 to get support for this functionality.
937+
you can link with -sGL_ENABLE_GET_PROC_ADDRESS to get support for this functionality.
938938

939939
Default value: true
940940

‎src/settings.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ var GL_WORKAROUND_SAFARI_GETCONTEXT_BUG = true;
609609
// In WebGL, glGetProcAddress() causes a substantial code size and performance impact, since WebGL
610610
// does not natively provide such functionality, and it must be emulated. Using glGetProcAddress()
611611
// is not recommended. If you still need to use this, e.g. when porting an existing renderer,
612-
// you can link with -sGL_ENABLE_GET_PROC_ADDRESS=1 to get support for this functionality.
612+
// you can link with -sGL_ENABLE_GET_PROC_ADDRESS to get support for this functionality.
613613
// [link]
614614
var GL_ENABLE_GET_PROC_ADDRESS = true;
615615

‎test/test_browser.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@ def test_webgl_context_attributes(self):
13241324
self.btest_exit('test_webgl_context_attributes_glut.c', cflags=['--js-library', 'check_webgl_attributes_support.js', '-DAA_ACTIVATED', '-DDEPTH_ACTIVATED', '-DSTENCIL_ACTIVATED', '-DALPHA_ACTIVATED', '-lGL', '-lglut', '-lGLEW'])
13251325
self.btest_exit('test_webgl_context_attributes_sdl.c', cflags=['--js-library', 'check_webgl_attributes_support.js', '-DAA_ACTIVATED', '-DDEPTH_ACTIVATED', '-DSTENCIL_ACTIVATED', '-DALPHA_ACTIVATED', '-lGL', '-lSDL', '-lGLEW'])
13261326
if not self.is_wasm64():
1327-
self.btest_exit('test_webgl_context_attributes_sdl2.c', cflags=['--js-library', 'check_webgl_attributes_support.js', '-DAA_ACTIVATED', '-DDEPTH_ACTIVATED', '-DSTENCIL_ACTIVATED', '-DALPHA_ACTIVATED', '-lGL', '-sUSE_SDL=2', '-lGLEW', '-sGL_ENABLE_GET_PROC_ADDRESS=1'])
1327+
self.btest_exit('test_webgl_context_attributes_sdl2.c', cflags=['--js-library', 'check_webgl_attributes_support.js', '-DAA_ACTIVATED', '-DDEPTH_ACTIVATED', '-DSTENCIL_ACTIVATED', '-DALPHA_ACTIVATED', '-lGL', '-sUSE_SDL=2', '-lGLEW'])
13281328
self.btest_exit('test_webgl_context_attributes_glfw.c', cflags=['--js-library', 'check_webgl_attributes_support.js', '-DAA_ACTIVATED', '-DDEPTH_ACTIVATED', '-DSTENCIL_ACTIVATED', '-DALPHA_ACTIVATED', '-lGL', '-lglfw', '-lGLEW'])
13291329

13301330
# perform tests with attributes desactivated

‎tools/ports/sdl2.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ def process_dependencies(settings, cflags_only):
2626
# SDL2 includes an internal reference to Module['createContext']
2727
settings.EXPORTED_RUNTIME_METHODS.append('createContext')
2828

29+
# SDL2 requires eglGetProcAddress() to work.
30+
# NOTE: if SDL2 is updated to not rely on eglGetProcAddress(), this can be removed
31+
settings.GL_ENABLE_GET_PROC_ADDRESS = 1
32+
2933

3034
def get(ports, settings, shared):
3135
# get the port

‎tools/settings.py‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@
103103
'OPT_LEVEL',
104104
'DEBUG_LEVEL',
105105

106-
# Affects ports
107-
'GL_ENABLE_GET_PROC_ADDRESS', # NOTE: if SDL2 is updated to not rely on eglGetProcAddress(), this can be removed
108-
109106
# This is legacy setting that we happen to handle very early on
110107
'RUNTIME_LINKED_LIBS',
111108
}.union(PORTS_SETTINGS)

0 commit comments

Comments
 (0)