Skip to content

Commit

Permalink
fix: Ensure arguments are targetted correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
robertleeplummerjr committed Jan 19, 2021
1 parent b2a4aa8 commit 6a95650
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
16 changes: 9 additions & 7 deletions dist/gpu-browser-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* GPU Accelerated JavaScript
*
* @version 2.11.0
* @date Tue Jan 05 2021 15:55:59 GMT-0500 (Eastern Standard Time)
* @version 2.11.2
* @date Tue Jan 19 2021 11:27:02 GMT-0500 (Eastern Standard Time)
*
* @license MIT
* The MIT License
Expand Down Expand Up @@ -1234,14 +1234,14 @@ function cpuKernelString(cpuKernel, name) {
' const { context, canvas, constants: incomingConstants } = settings;',
` const output = new Int32Array(${JSON.stringify(Array.from(cpuKernel.output))});`,
` const _constantTypes = ${JSON.stringify(cpuKernel.constantTypes)};`,
` const _constants = ${constantsToString(cpuKernel.constants, cpuKernel.constantTypes)};`,
` const _constants = ${constantsToString(cpuKernel.constants, cpuKernel.constantTypes)};`
);

thisProperties.push(
' constants: _constants,',
' context,',
' output,',
' thread: {x: 0, y: 0, z: 0},',
' thread: {x: 0, y: 0, z: 0},'
);

if (cpuKernel.graphical) {
Expand Down Expand Up @@ -1289,7 +1289,7 @@ function cpuKernelString(cpuKernel, name) {
thisProperties.push(
' _imageData,',
' _colorData,',
` color: ${colorFn},`,
` color: ${colorFn},`
);

beforeReturn.push(
Expand Down Expand Up @@ -9464,7 +9464,7 @@ class WebGLKernelValueMemoryOptimizedNumberTexture extends WebGLKernelArray {
if (kernel.immutable) {
kernel.updateTextureArgumentRefs(this, inputTexture);
} else {
if (kernel.texture.texture === inputTexture.texture) {
if (kernel.texture && kernel.texture.texture === inputTexture.texture) {
throw new Error(sameError);
} else if (kernel.mappedTextures) {
const { mappedTextures } = kernel;
Expand All @@ -9487,6 +9487,7 @@ module.exports = {
WebGLKernelValueMemoryOptimizedNumberTexture,
sameError
};

},{"../../../utils":113,"./array":39}],58:[function(require,module,exports){
const { utils } = require('../../../utils');
const { WebGLKernelArray } = require('./array');
Expand Down Expand Up @@ -9535,7 +9536,7 @@ class WebGLKernelValueNumberTexture extends WebGLKernelArray {
if (kernel.immutable) {
kernel.updateTextureArgumentRefs(this, inputTexture);
} else {
if (kernel.texture.texture === inputTexture.texture) {
if (kernel.texture && kernel.texture.texture === inputTexture.texture) {
throw new Error(sameError);
} else if (kernel.mappedTextures) {
const { mappedTextures } = kernel;
Expand All @@ -9557,6 +9558,7 @@ class WebGLKernelValueNumberTexture extends WebGLKernelArray {
module.exports = {
WebGLKernelValueNumberTexture
};

},{"../../../utils":113,"./array":39,"./memory-optimized-number-texture":57}],59:[function(require,module,exports){
const { utils } = require('../../../utils');
const { WebGLKernelArray } = require('./array');
Expand Down
6 changes: 3 additions & 3 deletions dist/gpu-browser-core.min.js

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions dist/gpu-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* GPU Accelerated JavaScript
*
* @version 2.11.0
* @date Tue Jan 05 2021 15:55:59 GMT-0500 (Eastern Standard Time)
* @version 2.11.2
* @date Tue Jan 19 2021 11:27:02 GMT-0500 (Eastern Standard Time)
*
* @license MIT
* The MIT License
Expand Down Expand Up @@ -5687,14 +5687,14 @@ function cpuKernelString(cpuKernel, name) {
' const { context, canvas, constants: incomingConstants } = settings;',
` const output = new Int32Array(${JSON.stringify(Array.from(cpuKernel.output))});`,
` const _constantTypes = ${JSON.stringify(cpuKernel.constantTypes)};`,
` const _constants = ${constantsToString(cpuKernel.constants, cpuKernel.constantTypes)};`,
` const _constants = ${constantsToString(cpuKernel.constants, cpuKernel.constantTypes)};`
);

thisProperties.push(
' constants: _constants,',
' context,',
' output,',
' thread: {x: 0, y: 0, z: 0},',
' thread: {x: 0, y: 0, z: 0},'
);

if (cpuKernel.graphical) {
Expand Down Expand Up @@ -5742,7 +5742,7 @@ function cpuKernelString(cpuKernel, name) {
thisProperties.push(
' _imageData,',
' _colorData,',
` color: ${colorFn},`,
` color: ${colorFn},`
);

beforeReturn.push(
Expand Down Expand Up @@ -13917,7 +13917,7 @@ class WebGLKernelValueMemoryOptimizedNumberTexture extends WebGLKernelArray {
if (kernel.immutable) {
kernel.updateTextureArgumentRefs(this, inputTexture);
} else {
if (kernel.texture.texture === inputTexture.texture) {
if (kernel.texture && kernel.texture.texture === inputTexture.texture) {
throw new Error(sameError);
} else if (kernel.mappedTextures) {
const { mappedTextures } = kernel;
Expand All @@ -13940,6 +13940,7 @@ module.exports = {
WebGLKernelValueMemoryOptimizedNumberTexture,
sameError
};

},{"../../../utils":114,"./array":40}],59:[function(require,module,exports){
const { utils } = require('../../../utils');
const { WebGLKernelArray } = require('./array');
Expand Down Expand Up @@ -13988,7 +13989,7 @@ class WebGLKernelValueNumberTexture extends WebGLKernelArray {
if (kernel.immutable) {
kernel.updateTextureArgumentRefs(this, inputTexture);
} else {
if (kernel.texture.texture === inputTexture.texture) {
if (kernel.texture && kernel.texture.texture === inputTexture.texture) {
throw new Error(sameError);
} else if (kernel.mappedTextures) {
const { mappedTextures } = kernel;
Expand All @@ -14010,6 +14011,7 @@ class WebGLKernelValueNumberTexture extends WebGLKernelArray {
module.exports = {
WebGLKernelValueNumberTexture
};

},{"../../../utils":114,"./array":40,"./memory-optimized-number-texture":58}],60:[function(require,module,exports){
const { utils } = require('../../../utils');
const { WebGLKernelArray } = require('./array');
Expand Down
6 changes: 3 additions & 3 deletions dist/gpu-browser.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gpu.js",
"version": "2.11.1",
"version": "2.11.2",
"description": "GPU Accelerated JavaScript",
"engines": {
"node": ">=8.0.0"
Expand Down

0 comments on commit 6a95650

Please sign in to comment.