gpu.js/test/issues/152-for-vars.js
Robert Plummer b2df0ab604 fix #316
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
2018-06-12 14:07:41 -04:00

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');
});
})();