forked from gpujs/gpu.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstructor-features.js
More file actions
34 lines (27 loc) · 889 Bytes
/
constructor-features.js
File metadata and controls
34 lines (27 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const { assert, test, module: describe, only, skip } = require('qunit');
const { GPU } = require('../../src');
describe('internal: constructor features');
function channelCount(mode) {
const gpu = new GPU({ mode });
const kernel = gpu.createKernel(function() {
return 1;
}, { output: [1] });
kernel();
assert.ok(kernel.kernel.constructor.features.channelCount >= 1);
gpu.destroy();
}
(GPU.isGPUSupported ? test : skip)('channelCount auto', () => {
channelCount();
});
(GPU.isGPUSupported ? test : skip)('channelCount gpu', () => {
channelCount('gpu');
});
(GPU.isWebGLSupported ? test : skip)('channelCount webgl', () => {
channelCount('webgl');
});
(GPU.isWebGL2Supported ? test : skip)('channelCount webgl2', () => {
channelCount('webgl2');
});
(GPU.isHeadlessGLSupported ? test : skip)('channelCount headlessgl', () => {
channelCount('headlessgl');
});