gpu.js/test/issues/359-addfunction-params-wrong.js
Robert Plummer 87e2be5fba feat: Migrating to use gl, bump version number
Not ready yet, but close.  Need build scripts from headless-gl upstream.
2019-01-04 10:29:45 -05:00

34 lines
707 B
JavaScript

var GPU = require('../../src/index');
(function() {
function testAddFunctionKernel(mode) {
var gpu = new GPU({mode});
gpu.addFunction(function clcC(xx) {
return Math.abs(xx);
});
gpu.addFunction(function itermediate(c1) {
return clcC(c1);
});
const nestFunctionsKernel = gpu.createKernel(function() {
return itermediate(-1);
}, {
output: [1]
});
QUnit.assert.equal(nestFunctionsKernel()[0], 1);
gpu.destroy();
}
QUnit.test('Issue #359 - addFunction calls addFunction issue (webgl)', function() {
testAddFunctionKernel('webgl')
});
QUnit.test('Issue #359 - addFunction calls addFunction issue (webgl2)', function() {
testAddFunctionKernel('webgl2')
})
})();