Skip to content

Commit

Permalink
add gpu info
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Jul 2, 2024
1 parent 2e2fdb8 commit ef32a14
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* global mocha */

import './tests/gpu-info.js';
import './tests/attribute-buffer-tests.js';
import './tests/framebuffer-tests.js';
import './tests/helper-tests.js';
Expand Down
14 changes: 14 additions & 0 deletions test/tests/gpu-info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {describe, it} from '../mocha-support.js';

function getGPUInfo(gl, ext) {
return ext
? ['UNMASKED_VENDOR_WEBGL', 'UNMASKED_RENDERER_WEBGL'].map(pname => `${pname}: ${gl.getParameter(ext[pname])}`).join(',\n')
: 'unavailable';
}

describe('gpu info', () => {
const gl = new OffscreenCanvas(1, 1).getContext('webgl2');
const ext = gl.getExtension('WEBGL_debug_renderer_info');
const title = getGPUInfo(gl, ext);
it(title, () => {});
});

0 comments on commit ef32a14

Please sign in to comment.