|
6 | 6 |
|
7 | 7 | from __future__ import print_function
|
8 | 8 | import argparse
|
| 9 | +import inspect |
9 | 10 | import json
|
10 | 11 | import multiprocessing
|
11 | 12 | import os
|
|
22 | 23 |
|
23 | 24 | from runner import BrowserCore, path_from_root, has_browser, EMTEST_BROWSER, no_fastcomp, no_wasm_backend, create_test_file, parameterized
|
24 | 25 | from tools import system_libs
|
25 |
| -from tools.shared import PYTHON, EMCC, WINDOWS, FILE_PACKAGER, PIPE, SPIDERMONKEY_ENGINE, JS_ENGINES |
| 26 | +from tools.shared import PYTHON, EMCC, WINDOWS, LINUX, FILE_PACKAGER, PIPE, SPIDERMONKEY_ENGINE, JS_ENGINES |
26 | 27 | from tools.shared import try_delete, Building, run_process, run_js
|
27 | 28 |
|
28 | 29 | try:
|
@@ -2654,6 +2655,26 @@ def test_webgl2_packed_types(self):
|
2654 | 2655 | def test_webgl2_pbo(self):
|
2655 | 2656 | self.btest(path_from_root('tests', 'webgl2_pbo.cpp'), args=['-s', 'USE_WEBGL2=1', '-lGL'], expected='0')
|
2656 | 2657 |
|
| 2658 | + @requires_graphics_hardware |
| 2659 | + def test_webgl2_compute_path_tracing(self): |
| 2660 | + if not (is_chrome() and '--enable-webgl2-compute-context' in EMTEST_BROWSER and (WINDOWS or LINUX)): |
| 2661 | + self.skipTest('WebGL 2.0 Compute is not enabled/supported') |
| 2662 | + # To skip the noisy frames produced at the beginning of path tracing |
| 2663 | + create_test_file('pre.js', inspect.cleandoc(''' |
| 2664 | + (function() { |
| 2665 | + var counter = 0; |
| 2666 | + var realRequestAnimationFrame = window.requestAnimationFrame; |
| 2667 | + window.requestAnimationFrame = function(func) { |
| 2668 | + counter++; |
| 2669 | + if (counter == 2000) { |
| 2670 | + doReftest(); |
| 2671 | + } |
| 2672 | + return realRequestAnimationFrame.call(window, func); |
| 2673 | + }; |
| 2674 | + })(); |
| 2675 | + ''')) |
| 2676 | + self.btest('webgl2_compute_path_tracing.cpp', reference='webgl2_compute_path_tracing.png', manually_trigger_reftest=True, timeout=120, args=['-std=c++11', '-lglfw', '-lGLESv2', '-s', 'USE_GLFW=3', '-s', 'USE_WEBGL2_COMPUTE=1', '-s', 'EXIT_RUNTIME=1', '--pre-js', 'pre.js']) |
| 2677 | + |
2657 | 2678 | def test_sdl_touch(self):
|
2658 | 2679 | for opts in [[], ['-O2', '-g1', '--closure', '1']]:
|
2659 | 2680 | print(opts)
|
|
0 commit comments