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
29 lines
854 B
JavaScript
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);
|
|
}); |