gpu.js/test/issues/259-atan2.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

29 lines
854 B
JavaScript

function buildAtan2KernelResult(mode) {
const gpu = new GPU({ mode });
const kernel = gpu.createKernel(function() {
return Math.atan2(1, 2);
}, {
output: [1]
});
return kernel();
}
QUnit.test('Issue #259 atan2 - (auto)', () => {
QUnit.assert.equal(buildAtan2KernelResult()[0].toFixed(7), 0.4636476);
});
QUnit.test('Issue #259 atan2 - (gpu)', () => {
QUnit.assert.equal(buildAtan2KernelResult('gpu')[0].toFixed(7), 0.4636476);
});
QUnit.test('Issue #259 atan2 - (webgl)', () => {
QUnit.assert.equal(buildAtan2KernelResult('webgl')[0].toFixed(7), 0.4636476);
});
QUnit.test('Issue #259 atan2 - (webgl2)', () => {
QUnit.assert.equal(buildAtan2KernelResult('webgl2')[0].toFixed(7), 0.4636476);
});
QUnit.test('Issue #259 atan2 - (cpu)', () => {
QUnit.assert.equal(buildAtan2KernelResult('cpu')[0].toFixed(7), 0.4636476);
});