gpu.js/test/features/function-return.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

32 lines
771 B
JavaScript

(function() {
function functionReturn( mode ) {
var gpu = new GPU({ mode: mode });
var f = gpu.createKernel(function() {
return 42.0;
}, {
output : [1]
});
QUnit.assert.ok( f !== null, "function generated test");
QUnit.assert.close(f()[0], 42.0, 0.01, "basic return function test");
}
QUnit.test( "functionReturn (auto)", function() {
functionReturn(null);
});
QUnit.test( "functionReturn (gpu)", function() {
functionReturn("gpu");
});
QUnit.test( "functionReturn (webgl)", function() {
functionReturn("webgl");
});
QUnit.test( "functionReturn (webgl2)", function() {
functionReturn("webgl2");
});
QUnit.test( "functionReturn (CPU)", function() {
functionReturn("cpu");
});
})();