Skip to content

Commit 2ed2de7

Browse files
committed
add gpu info
1 parent 3aeba35 commit 2ed2de7

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

test/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* global mocha */
22

3+
import './tests/gpu-info.js';
34
import './tests/attribute-buffer-tests.js';
45
import './tests/framebuffer-tests.js';
56
import './tests/helper-tests.js';

test/tests/gpu-info.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import {describe, it} from '../mocha-support.js';
2+
3+
function getGPUInfo(gl, ext) {
4+
return ext
5+
? ['UNMASKED_VENDOR_WEBGL', 'UNMASKED_RENDERER_WEBGL'].map(pname => `${pname}: ${gl.getParameter(ext[pname])}`).join(',\n')
6+
: 'unavailable';
7+
}
8+
9+
describe('gpu info', () => {
10+
const gl = new OffscreenCanvas(1, 1).getContext('webgl2');
11+
const ext = gl.getExtension('WEBGL_debug_renderer_info');
12+
const title = getGPUInfo(gl, ext);
13+
it(title, () => {});
14+
});

0 commit comments

Comments
 (0)