Skip to content

Commit d01a0d5

Browse files
fix: add missing test
1 parent bccc5c0 commit d01a0d5

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

test/issues/500-sticky-arrays.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
const { assert, skip, test, module: describe, only } = require('qunit');
2+
const { GPU } = require('../../src');
3+
4+
describe('issue #500 - strange literal');
5+
6+
function testStickyArrays(mode) {
7+
const gpu = new GPU({ mode });
8+
function processImage(image) {
9+
return image[0];
10+
}
11+
gpu.addFunction(processImage);
12+
const kernel = gpu.createKernel(function(image1, image2, image3) {
13+
return [processImage(image1), processImage(image2), processImage(image3)];
14+
}, { output: [1] });
15+
16+
assert.deepEqual(kernel([1], [2], [3]), [new Float32Array([1,2,3])]);
17+
}
18+
19+
test('auto', () => {
20+
testStickyArrays();
21+
});
22+
23+
test('gpu', () => {
24+
testStickyArrays('gpu');
25+
});
26+
27+
(GPU.isWebGLSupported ? test : skip)('webgl', () => {
28+
testStickyArrays('webgl');
29+
});
30+
31+
(GPU.isWebGL2Supported ? test : skip)('webgl2', () => {
32+
testStickyArrays('webgl2');
33+
});
34+
35+
(GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => {
36+
testStickyArrays('headlessgl');
37+
});
38+
39+
test('cpu', () => {
40+
testStickyArrays('cpu');
41+
});

0 commit comments

Comments
 (0)