@@ -1330,7 +1330,8 @@ def test_webgl_context_attributes(self):
1330
1330
# perform tests with attributes activated
1331
1331
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
1332
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' ])
1333
+ if not self .is_wasm64 ():
1334
+ 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
1335
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
1336
1336
1337
# perform tests with attributes desactivated
@@ -2749,14 +2750,15 @@ def test_webgl_unmasked_vendor_webgl(self):
2749
2750
self .btest_exit ('webgl_unmasked_vendor_webgl.c' , args = ['-lGL' ])
2750
2751
2751
2752
@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 )
2753
+ @parameterized ({
2754
+ 'legacy_browser' : (['-sMIN_CHROME_VERSION=0' , '-Wno-transpile' ],),
2755
+ 'closure' : (['-O2' , '-g1' , '--closure=1' , '-sWORKAROUND_OLD_WEBGL_UNIFORM_UPLOAD_IGNORED_OFFSET_BUG' ],),
2756
+ 'full_es2' : (['-sFULL_ES2' ],),
2757
+ })
2758
+ def test_webgl2 (self , args ):
2759
+ if '-sMIN_CHROME_VERSION=0' in args and self .is_wasm64 ():
2760
+ self .skipTest ('wasm64 not supported by legacy browsers' )
2761
+ self .btest_exit ('webgl2.cpp' , args = ['-sMAX_WEBGL_VERSION=2' , '-lGL' ] + args )
2760
2762
2761
2763
# Tests the WebGL 2 glGetBufferSubData() functionality.
2762
2764
@requires_graphics_hardware
@@ -4502,6 +4504,7 @@ def test_small_js_flags(self):
4502
4504
@requires_threads
4503
4505
@requires_offscreen_canvas
4504
4506
@requires_graphics_hardware
4507
+ @no_wasm64 ('TODO: wasm64 + OFFSCREENCANVAS' )
4505
4508
def test_webgl_offscreen_canvas_in_pthread (self , args ):
4506
4509
self .btest ('gl_in_pthread.cpp' , expected = '1' , args = args + ['-pthread' , '-sPTHREAD_POOL_SIZE=2' , '-sOFFSCREENCANVAS_SUPPORT' , '-lGL' ])
4507
4510
@@ -4521,6 +4524,7 @@ def test_webgl_offscreen_canvas_in_mainthread_after_pthread(self, args):
4521
4524
@requires_threads
4522
4525
@requires_offscreen_canvas
4523
4526
@requires_graphics_hardware
4527
+ @no_wasm64 ('TODO: wasm64 + OFFSCREENCANVAS' )
4524
4528
def test_webgl_offscreen_canvas_only_in_pthread (self ):
4525
4529
self .btest_exit ('gl_only_in_pthread.cpp' , args = ['-pthread' , '-sPTHREAD_POOL_SIZE' , '-sOFFSCREENCANVAS_SUPPORT' , '-lGL' , '-sOFFSCREEN_FRAMEBUFFER' ])
4526
4530
@@ -4533,15 +4537,16 @@ def test_webgl_from_client_side_memory_without_default_enabled_extensions(self):
4533
4537
# For testing WebGL draft extensions like this, if using chrome as the browser,
4534
4538
# We might want to append the --enable-webgl-draft-extensions to the EMTEST_BROWSER env arg.
4535
4539
@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' ])
4540
+ @parameterized ({
4541
+ 'arrays' : (['-DMULTI_DRAW_ARRAYS' ],),
4542
+ 'arrays_instanced' : (['-DMULTI_DRAW_ARRAYS_INSTANCED' ],),
4543
+ 'elements' : (['-DMULTI_DRAW_ELEMENTS' ],),
4544
+ 'elements_instanced' : (['-DMULTI_DRAW_ELEMENTS_INSTANCED' ],),
4545
+ })
4546
+ def test_webgl_multi_draw (self , args ):
4547
+ self .btest ('webgl_multi_draw_test.c' ,
4548
+ reference = 'browser/webgl_multi_draw.png' ,
4549
+ args = ['-lGL' , '-sOFFSCREEN_FRAMEBUFFER' , '-DEXPLICIT_SWAP' ] + args )
4545
4550
4546
4551
# Tests for base_vertex/base_instance extension
4547
4552
# For testing WebGL draft extensions like this, if using chrome as the browser,
@@ -4580,6 +4585,7 @@ def test_webgl_timer_query(self, args):
4580
4585
4581
4586
# Tests that -sOFFSCREEN_FRAMEBUFFER rendering works.
4582
4587
@requires_graphics_hardware
4588
+ @no_wasm64 ('TODO: wasm64 + OFB' )
4583
4589
def test_webgl_offscreen_framebuffer (self ):
4584
4590
# Tests all the different possible versions of libgl
4585
4591
for threads in [[], ['-pthread' , '-sPROXY_TO_PTHREAD' ]]:
@@ -4632,6 +4638,7 @@ def test_webgl_array_of_structs_uniform(self):
4632
4638
@requires_threads
4633
4639
@requires_offscreen_canvas
4634
4640
@requires_graphics_hardware
4641
+ @no_wasm64 ('TODO: wasm64 + OFFSCREENCANVAS' )
4635
4642
def test_webgl_offscreen_canvas_in_proxied_pthread (self , asyncify ):
4636
4643
cmd = ['-pthread' , '-sOFFSCREENCANVAS_SUPPORT' , '-lGL' , '-sGL_DEBUG' , '-sPROXY_TO_PTHREAD' ]
4637
4644
if asyncify :
@@ -4648,6 +4655,7 @@ def test_webgl_offscreen_canvas_in_proxied_pthread(self, asyncify):
4648
4655
@requires_threads
4649
4656
@requires_graphics_hardware
4650
4657
@requires_offscreen_canvas
4658
+ @no_wasm64 ('TODO: wasm64 + OFFSCREENCANVAS' )
4651
4659
def test_webgl_resize_offscreencanvas_from_main_thread (self , args ):
4652
4660
for args2 in [[], ['-DTEST_SYNC_BLOCKING_LOOP=1' ]]:
4653
4661
for args3 in [[], ['-sOFFSCREENCANVAS_SUPPORT' , '-sOFFSCREEN_FRAMEBUFFER' ]]:
0 commit comments