mirror of
https://github.com/gpujs/gpu.js.git
synced 2026-01-18 16:04:10 +00:00
fix: Move `make` cli command to gulp so it runs in parallel fix: Add official support for `Array1D(2|3|4)`, `Array2D(2|3|4)`, and `Array3D(2|3|4)` and unit tests fix: Add offical support for `Array(2)`, `Array(3)`, and `Array(4)` and unit tests fix: Mandelbulb constant used a constant, so moved to appropriate location fix: Failing unit test for Safari fix: When not falling back in HeadlessGL, call `STACKGL_resize_drawingbuffer` fix: Remove `xyz` variable from glsl fix: Add `uniform4fv` and `uniform4iv` to WebGL implementation fix: Check for kernel settings `constantTypes` and `argumentTypes` fix: Inherit type from kernel in KernelValue constructors fix: Add some typescript details for `GPUVariableType`, `IKernelSettings`, and `ITypesList` fix: Add support for 4d array in `utils.getMemoryOptimizedFloatTextureSize` for the special use case of `Array3D(2|3|4)` fix: Add `utils.flatten4dArrayTo` for the special use case of `Array3D(2|3|4)` fix: Add support for 4d array in `utils.flattenTo` fix: Bump and build
47 lines
983 B
JavaScript
47 lines
983 B
JavaScript
const { assert, skip, test, module: describe } = require('qunit');
|
|
const { GPU } = require('../../src');
|
|
|
|
describe('issue #152');
|
|
|
|
function forVars(mode) {
|
|
const gpu = new GPU({ mode });
|
|
|
|
const kernel = gpu.createKernel(function() {
|
|
let sum = 0;
|
|
for (let i = 0; i < 2; i++) {
|
|
sum += i;
|
|
}
|
|
return sum;
|
|
})
|
|
.setOutput([1, 1]);
|
|
|
|
const result = kernel();
|
|
assert.equal(result.length, 1);
|
|
assert.equal(result[0], 1);
|
|
gpu.destroy();
|
|
}
|
|
|
|
test('Issue #152 - for vars cpu', () => {
|
|
forVars('cpu');
|
|
});
|
|
|
|
test('Issue #152 - for vars auto', () => {
|
|
forVars('gpu');
|
|
});
|
|
|
|
test('Issue #152 - for vars gpu', () => {
|
|
forVars('gpu');
|
|
});
|
|
|
|
(GPU.isWebGLSupported ? test : skip)('Issue #152 - for vars webgl', () => {
|
|
forVars('webgl');
|
|
});
|
|
|
|
(GPU.isWebGL2Supported ? test : skip)('Issue #152 - for vars webgl2', () => {
|
|
forVars('webgl2');
|
|
});
|
|
|
|
(GPU.isHeadlessGLSupported ? test : skip)('Issue #152 - for vars headlessgl', () => {
|
|
forVars('headlessgl');
|
|
});
|