@@ -1286,6 +1286,7 @@ def test_glfw_joystick(self):
1286
1286
self .btest_exit ('test_glfw_joystick.c' , args = ['-O2' , '--minify=0' , '-o' , 'page.html' , '--pre-js' , 'pre.js' , '-lGL' , '-lglfw3' , '-sUSE_GLFW=3' ])
1287
1287
1288
1288
@requires_graphics_hardware
1289
+
1289
1290
def test_webgl_context_attributes (self ):
1290
1291
# Javascript code to check the attributes support we want to test in the WebGL implementation
1291
1292
# (request the attribute, create a context and check its value afterwards in the context attributes).
@@ -1330,7 +1331,8 @@ def test_webgl_context_attributes(self):
1330
1331
# perform tests with attributes activated
1331
1332
self .btest_exit ('test_webgl_context_attributes_glut.c' , args = ['--js-library' , 'check_webgl_attributes_support.js' , '-DAA_ACTIVATED' , '-DDEPTH_ACTIVATED' , '-DSTENCIL_ACTIVATED' , '-DALPHA_ACTIVATED' , '-lGL' , '-lglut' , '-lGLEW' ])
1332
1333
self .btest_exit ('test_webgl_context_attributes_sdl.c' , args = ['--js-library' , 'check_webgl_attributes_support.js' , '-DAA_ACTIVATED' , '-DDEPTH_ACTIVATED' , '-DSTENCIL_ACTIVATED' , '-DALPHA_ACTIVATED' , '-lGL' , '-lSDL' , '-lGLEW' ])
1333
- self .btest_exit ('test_webgl_context_attributes_sdl2.c' , args = ['--js-library' , 'check_webgl_attributes_support.js' , '-DAA_ACTIVATED' , '-DDEPTH_ACTIVATED' , '-DSTENCIL_ACTIVATED' , '-DALPHA_ACTIVATED' , '-lGL' , '-sUSE_SDL=2' , '-lGLEW' ])
1334
+ if not self .is_wasm64 ():
1335
+ self .btest_exit ('test_webgl_context_attributes_sdl2.c' , args = ['--js-library' , 'check_webgl_attributes_support.js' , '-DAA_ACTIVATED' , '-DDEPTH_ACTIVATED' , '-DSTENCIL_ACTIVATED' , '-DALPHA_ACTIVATED' , '-lGL' , '-sUSE_SDL=2' , '-lGLEW' ])
1334
1336
self .btest_exit ('test_webgl_context_attributes_glfw.c' , args = ['--js-library' , 'check_webgl_attributes_support.js' , '-DAA_ACTIVATED' , '-DDEPTH_ACTIVATED' , '-DSTENCIL_ACTIVATED' , '-DALPHA_ACTIVATED' , '-lGL' , '-lglfw' , '-lGLEW' ])
1335
1337
1336
1338
# perform tests with attributes desactivated
@@ -2749,14 +2751,15 @@ def test_webgl_unmasked_vendor_webgl(self):
2749
2751
self .btest_exit ('webgl_unmasked_vendor_webgl.c' , args = ['-lGL' ])
2750
2752
2751
2753
@requires_graphics_hardware
2752
- def test_webgl2 (self ):
2753
- for opts in [
2754
- ['-sMIN_CHROME_VERSION=0' , '-Wno-transpile' ],
2755
- ['-O2' , '-g1' , '--closure=1' , '-sWORKAROUND_OLD_WEBGL_UNIFORM_UPLOAD_IGNORED_OFFSET_BUG' ],
2756
- ['-sFULL_ES2' ],
2757
- ]:
2758
- print (opts )
2759
- self .btest_exit ('webgl2.cpp' , args = ['-sMAX_WEBGL_VERSION=2' , '-lGL' ] + opts )
2754
+ @parameterized ({
2755
+ 'legacy_browser' : (['-sMIN_CHROME_VERSION=0' , '-Wno-transpile' ],),
2756
+ 'closure' : (['-O2' , '-g1' , '--closure=1' , '-sWORKAROUND_OLD_WEBGL_UNIFORM_UPLOAD_IGNORED_OFFSET_BUG' ],),
2757
+ 'full_es2' : (['-sFULL_ES2' ],),
2758
+ })
2759
+ def test_webgl2 (self , args ):
2760
+ if '-sMIN_CHROME_VERSION=0' in args and self .is_wasm64 ():
2761
+ self .skipTest ('wasm64 not supported by legacy browsers' )
2762
+ self .btest_exit ('webgl2.cpp' , args = ['-sMAX_WEBGL_VERSION=2' , '-lGL' ] + args )
2760
2763
2761
2764
# Tests the WebGL 2 glGetBufferSubData() functionality.
2762
2765
@requires_graphics_hardware
@@ -4502,6 +4505,7 @@ def test_small_js_flags(self):
4502
4505
@requires_threads
4503
4506
@requires_offscreen_canvas
4504
4507
@requires_graphics_hardware
4508
+ @no_wasm64 ('TODO: wasm64 + OFFSCREENCANVAS' )
4505
4509
def test_webgl_offscreen_canvas_in_pthread (self , args ):
4506
4510
self .btest ('gl_in_pthread.cpp' , expected = '1' , args = args + ['-pthread' , '-sPTHREAD_POOL_SIZE=2' , '-sOFFSCREENCANVAS_SUPPORT' , '-lGL' ])
4507
4511
@@ -4521,6 +4525,7 @@ def test_webgl_offscreen_canvas_in_mainthread_after_pthread(self, args):
4521
4525
@requires_threads
4522
4526
@requires_offscreen_canvas
4523
4527
@requires_graphics_hardware
4528
+ @no_wasm64 ('TODO: wasm64 + OFFSCREENCANVAS' )
4524
4529
def test_webgl_offscreen_canvas_only_in_pthread (self ):
4525
4530
self .btest_exit ('gl_only_in_pthread.cpp' , args = ['-pthread' , '-sPTHREAD_POOL_SIZE' , '-sOFFSCREENCANVAS_SUPPORT' , '-lGL' , '-sOFFSCREEN_FRAMEBUFFER' ])
4526
4531
@@ -4533,15 +4538,16 @@ def test_webgl_from_client_side_memory_without_default_enabled_extensions(self):
4533
4538
# For testing WebGL draft extensions like this, if using chrome as the browser,
4534
4539
# We might want to append the --enable-webgl-draft-extensions to the EMTEST_BROWSER env arg.
4535
4540
@requires_graphics_hardware
4536
- def test_webgl_multi_draw (self ):
4537
- self .btest ('webgl_multi_draw_test.c' , reference = 'browser/webgl_multi_draw.png' ,
4538
- args = ['-lGL' , '-sOFFSCREEN_FRAMEBUFFER' , '-DMULTI_DRAW_ARRAYS=1' , '-DEXPLICIT_SWAP=1' ])
4539
- self .btest ('webgl_multi_draw_test.c' , reference = 'browser/webgl_multi_draw.png' ,
4540
- args = ['-lGL' , '-sOFFSCREEN_FRAMEBUFFER' , '-DMULTI_DRAW_ARRAYS_INSTANCED=1' , '-DEXPLICIT_SWAP=1' ])
4541
- self .btest ('webgl_multi_draw_test.c' , reference = 'browser/webgl_multi_draw.png' ,
4542
- args = ['-lGL' , '-sOFFSCREEN_FRAMEBUFFER' , '-DMULTI_DRAW_ELEMENTS=1' , '-DEXPLICIT_SWAP=1' ])
4543
- self .btest ('webgl_multi_draw_test.c' , reference = 'browser/webgl_multi_draw.png' ,
4544
- args = ['-lGL' , '-sOFFSCREEN_FRAMEBUFFER' , '-DMULTI_DRAW_ELEMENTS_INSTANCED=1' , '-DEXPLICIT_SWAP=1' ])
4541
+ @parameterized ({
4542
+ 'arrays' : (['-DMULTI_DRAW_ARRAYS' ],),
4543
+ 'arrays_instanced' : (['-DMULTI_DRAW_ARRAYS_INSTANCED' ],),
4544
+ 'elements' : (['-DMULTI_DRAW_ELEMENTS' ],),
4545
+ 'elements_instanced' : (['-DMULTI_DRAW_ELEMENTS_INSTANCED' ],),
4546
+ })
4547
+ def test_webgl_multi_draw (self , args ):
4548
+ self .btest ('webgl_multi_draw_test.c' ,
4549
+ reference = 'browser/webgl_multi_draw.png' ,
4550
+ args = ['-lGL' , '-sOFFSCREEN_FRAMEBUFFER' , '-DEXPLICIT_SWAP' ] + args )
4545
4551
4546
4552
# Tests for base_vertex/base_instance extension
4547
4553
# For testing WebGL draft extensions like this, if using chrome as the browser,
@@ -4580,6 +4586,7 @@ def test_webgl_timer_query(self, args):
4580
4586
4581
4587
# Tests that -sOFFSCREEN_FRAMEBUFFER rendering works.
4582
4588
@requires_graphics_hardware
4589
+ @no_wasm64 ('TODO: wasm64 + OFB' )
4583
4590
def test_webgl_offscreen_framebuffer (self ):
4584
4591
# Tests all the different possible versions of libgl
4585
4592
for threads in [[], ['-pthread' , '-sPROXY_TO_PTHREAD' ]]:
@@ -4632,6 +4639,7 @@ def test_webgl_array_of_structs_uniform(self):
4632
4639
@requires_threads
4633
4640
@requires_offscreen_canvas
4634
4641
@requires_graphics_hardware
4642
+ @no_wasm64 ('TODO: wasm64 + OFFSCREENCANVAS' )
4635
4643
def test_webgl_offscreen_canvas_in_proxied_pthread (self , asyncify ):
4636
4644
cmd = ['-pthread' , '-sOFFSCREENCANVAS_SUPPORT' , '-lGL' , '-sGL_DEBUG' , '-sPROXY_TO_PTHREAD' ]
4637
4645
if asyncify :
@@ -4648,6 +4656,7 @@ def test_webgl_offscreen_canvas_in_proxied_pthread(self, asyncify):
4648
4656
@requires_threads
4649
4657
@requires_graphics_hardware
4650
4658
@requires_offscreen_canvas
4659
+ @no_wasm64 ('TODO: wasm64 + OFFSCREENCANVAS' )
4651
4660
def test_webgl_resize_offscreencanvas_from_main_thread (self , args ):
4652
4661
for args2 in [[], ['-DTEST_SYNC_BLOCKING_LOOP=1' ]]:
4653
4662
for args3 in [[], ['-sOFFSCREENCANVAS_SUPPORT' , '-sOFFSCREEN_FRAMEBUFFER' ]]:
0 commit comments