mirror of
https://github.com/gpujs/gpu.js.git
synced 2026-02-01 16:57:35 +00:00
Change `HTMLImageArray` render strategy to `gl.NEAREST`, like all the others Let `WebGL2FunctionNode` extend `WebGLFunctionNode` and lighten Remove all the different html pages associated with tests, and just use one file to handle them and use qunit for filtering them Bump version number
36 lines
829 B
JavaScript
36 lines
829 B
JavaScript
(function() {
|
|
function typedArrayTest(mode) {
|
|
var gpu = new GPU({ mode: mode });
|
|
|
|
const kernel = gpu.createKernel(function() {
|
|
for (var sum=0, i=0; i<2; i++) {
|
|
sum += i;
|
|
}
|
|
return sum;
|
|
}).setOutput([1, 1]);
|
|
|
|
var result = kernel();
|
|
QUnit.assert.equal(result.length, 1);
|
|
QUnit.assert.equal(result[0], 1);
|
|
}
|
|
|
|
QUnit.test('Issue #152 - for vars (cpu)', function() {
|
|
typedArrayTest('cpu');
|
|
});
|
|
|
|
QUnit.test('Issue #152 - for vars (auto)', function() {
|
|
typedArrayTest('gpu');
|
|
});
|
|
|
|
QUnit.test('Issue #152 - for vars (gpu)', function() {
|
|
typedArrayTest('gpu');
|
|
});
|
|
|
|
QUnit.test('Issue #152 - for vars (webgl)', function() {
|
|
typedArrayTest('webgl');
|
|
});
|
|
|
|
QUnit.test('Issue #152 - for vars (webgl2)', function() {
|
|
typedArrayTest('webgl2');
|
|
});
|
|
})(); |