Merge pull request #104 from abhisheksoni27/develop

CPU fallback and tests fix
This commit is contained in:
Robert Plummer 2017-07-01 23:09:04 -04:00 committed by GitHub
commit 0e7effb23c
2 changed files with 6 additions and 1 deletions

5
src/gpu.js vendored
View File

@ -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];

View File

@ -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);
}