Skip to content

Commit 69c975f

Browse files
authored
Make FULL_ES3 turn on FULL_ES2 automatically (emscripten-core#9856)
Which has been a point of confusion otherwise. Fixes emscripten-core#9650
1 parent bfa17ce commit 69c975f

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

emcc.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,9 @@ def is_supported_link_flag(f):
12881288
shared.Settings.EXPORTED_FUNCTIONS += ['___cxa_demangle']
12891289
forced_stdlibs.append('libc++abi')
12901290

1291+
if shared.Settings.FULL_ES3:
1292+
shared.Settings.FULL_ES2 = 1
1293+
12911294
if shared.Settings.EMBIND:
12921295
forced_stdlibs.append('libembind')
12931296

src/settings.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ var USE_WEBGL2 = 0;
441441
var WEBGL2_BACKWARDS_COMPATIBILITY_EMULATION = 0;
442442

443443
// Forces support for all GLES3 features, not just the WebGL2-friendly subset.
444+
// This automatically turns out FULL_ES2.
444445
var FULL_ES3 = 0;
445446

446447
// Includes code to emulate various desktop GL features. Incomplete but useful

tests/test_browser.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,7 +1795,13 @@ def book_path(*pathelems):
17951795
args=args)
17961796

17971797
@requires_graphics_hardware
1798-
def test_gles2_emulation(self):
1798+
@parameterized({
1799+
'normal': (['-s', 'FULL_ES2=1'],),
1800+
# Enabling FULL_ES3 also enables ES2 automatically
1801+
'full_es3': (['-s', 'FULL_ES3=1'],)
1802+
})
1803+
def test_gles2_emulation(self, args):
1804+
print(args)
17991805
shutil.copyfile(path_from_root('tests', 'glbook', 'Chapter_10', 'MultiTexture', 'basemap.tga'), 'basemap.tga')
18001806
shutil.copyfile(path_from_root('tests', 'glbook', 'Chapter_10', 'MultiTexture', 'lightmap.tga'), 'lightmap.tga')
18011807
shutil.copyfile(path_from_root('tests', 'glbook', 'Chapter_13', 'ParticleSystem', 'smoke.tga'), 'smoke.tga')
@@ -1817,13 +1823,12 @@ def test_gles2_emulation(self):
18171823
path_from_root('tests', 'glbook', 'Common', 'esShader.c'),
18181824
path_from_root('tests', 'glbook', 'Common', 'esShapes.c'),
18191825
path_from_root('tests', 'glbook', 'Common', 'esTransform.c'),
1820-
'-s', 'FULL_ES2=1', '-lGL', '-lEGL', '-lX11',
1821-
'--preload-file', 'basemap.tga', '--preload-file', 'lightmap.tga', '--preload-file', 'smoke.tga'])
1826+
'-lGL', '-lEGL', '-lX11',
1827+
'--preload-file', 'basemap.tga', '--preload-file', 'lightmap.tga', '--preload-file', 'smoke.tga'] + args)
18221828

18231829
@requires_graphics_hardware
18241830
def test_clientside_vertex_arrays_es3(self):
1825-
# NOTE: Should FULL_ES3=1 imply client-side vertex arrays? The emulation needs FULL_ES2=1 for now.
1826-
self.btest('clientside_vertex_arrays_es3.c', reference='gl_triangle.png', args=['-s', 'USE_WEBGL2=1', '-s', 'FULL_ES2=1', '-s', 'FULL_ES3=1', '-s', 'USE_GLFW=3', '-lglfw', '-lGLESv2'])
1831+
self.btest('clientside_vertex_arrays_es3.c', reference='gl_triangle.png', args=['-s', 'USE_WEBGL2=1', '-s', 'FULL_ES3=1', '-s', 'USE_GLFW=3', '-lglfw', '-lGLESv2'])
18271832

18281833
def test_emscripten_api(self):
18291834
self.btest('emscripten_api_browser.cpp', '1', args=['-s', '''EXPORTED_FUNCTIONS=['_main', '_third']''', '-lSDL'])

0 commit comments

Comments
 (0)