|
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
|
|
21 | 22 |
|
22 | 23 | from runner import BrowserCore, path_from_root, has_browser, EMTEST_BROWSER, no_fastcomp, no_wasm_backend, flaky, create_test_file, parameterized
|
23 | 24 | from tools import system_libs
|
24 |
| -from tools.shared import PYTHON, EMCC, WINDOWS, FILE_PACKAGER, PIPE, SPIDERMONKEY_ENGINE, JS_ENGINES |
| 25 | +from tools.shared import PYTHON, EMCC, WINDOWS, LINUX, FILE_PACKAGER, PIPE, SPIDERMONKEY_ENGINE, JS_ENGINES |
25 | 26 | from tools.shared import try_delete, Building, run_process, run_js
|
26 | 27 |
|
27 | 28 | try:
|
@@ -2628,6 +2629,26 @@ def test_webgl2_packed_types(self):
|
2628 | 2629 | def test_webgl2_pbo(self):
|
2629 | 2630 | self.btest(path_from_root('tests', 'webgl2_pbo.cpp'), args=['-s', 'USE_WEBGL2=1', '-lGL'], expected='0')
|
2630 | 2631 |
|
| 2632 | + @requires_graphics_hardware |
| 2633 | + def test_webgl2_compute_path_tracing(self): |
| 2634 | + if not (is_chrome() and '--enable-webgl2-compute-context' in EMTEST_BROWSER and (WINDOWS or LINUX)): |
| 2635 | + self.skipTest('WebGL 2.0 Compute is not enabled/supported') |
| 2636 | + # To skip the noisy frames produced at the beginning of path tracing |
| 2637 | + create_test_file('pre.js', inspect.cleandoc(''' |
| 2638 | + (function() { |
| 2639 | + var counter = 0; |
| 2640 | + var realRequestAnimationFrame = window.requestAnimationFrame; |
| 2641 | + window.requestAnimationFrame = function(func) { |
| 2642 | + counter++; |
| 2643 | + if (counter == 2000) { |
| 2644 | + doReftest(); |
| 2645 | + } |
| 2646 | + return realRequestAnimationFrame.call(window, func); |
| 2647 | + }; |
| 2648 | + })(); |
| 2649 | + ''')) |
| 2650 | + 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']) |
| 2651 | + |
2631 | 2652 | def test_sdl_touch(self):
|
2632 | 2653 | for opts in [[], ['-O2', '-g1', '--closure', '1']]:
|
2633 | 2654 | print(opts)
|
|
0 commit comments