mirror of
https://github.com/gpujs/gpu.js.git
synced 2026-01-25 16:08:02 +00:00
Merge pull request #104 from abhisheksoni27/develop
CPU fallback and tests fix
This commit is contained in:
commit
0e7effb23c
5
src/gpu.js
vendored
5
src/gpu.js
vendored
@ -138,6 +138,11 @@ module.exports = class GPU {
|
||||
} else {
|
||||
fn = arguments[arguments.length - 1];
|
||||
}
|
||||
|
||||
if (!utils.isWebGlDrawBuffersSupported) {
|
||||
this._runner = new CPURunner(settings);
|
||||
}
|
||||
|
||||
const kernel = this.createKernel(fn, settings);
|
||||
if (Array.isArray(arguments[0])) {
|
||||
const functions = arguments[0];
|
||||
|
||||
@ -31,7 +31,7 @@ function createArrayKernels(mode, dimensions, canvas) {
|
||||
function createKernel(mode, dimensions, canvas) {
|
||||
var gpu = new GPU({mode: mode, canvas: canvas});
|
||||
return gpu.createKernel(function (a) {
|
||||
return a[this.thread.x][this.thread.y];
|
||||
return a[this.thread.x];
|
||||
}).setDimensions(dimensions);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user