mirror of
https://github.com/gpujs/gpu.js.git
synced 2026-01-18 16:04:10 +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
36 lines
922 B
JavaScript
36 lines
922 B
JavaScript
(function() {
|
|
function typedArrayTest(mode) {
|
|
const gpu = new GPU({ mode });
|
|
const kernel = gpu.createKernel(function(changes) {
|
|
return changes[this.thread.y][this.thread.x];
|
|
})
|
|
.setOutput([2, 1]);
|
|
|
|
const values = [new Float32Array(2)];
|
|
values[0][0] = 0;
|
|
values[0][1] = 0;
|
|
const result = kernel(values);
|
|
QUnit.assert.equal(result[0][0], 0);
|
|
QUnit.assert.equal(result[0][1], 0);
|
|
}
|
|
|
|
QUnit.test( "Issue #130 - typed array (cpu)", function() {
|
|
typedArrayTest('cpu');
|
|
});
|
|
|
|
QUnit.test( "Issue #130 - typed array (auto)", function() {
|
|
typedArrayTest(null);
|
|
});
|
|
|
|
QUnit.test( "Issue #130 - typed array (gpu)", function() {
|
|
typedArrayTest('gpu');
|
|
});
|
|
|
|
QUnit.test( "Issue #130 - typed array (webgl)", function() {
|
|
typedArrayTest('webgl');
|
|
});
|
|
|
|
QUnit.test( "Issue #130 - typed array (webgl2)", function() {
|
|
typedArrayTest('webgl2');
|
|
});
|
|
})(); |