diff --git a/README.md b/README.md index 41fc0dad..a78e9d1e 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,7 @@ NOTE: documentation is slightly out of date for the upcoming release of v2. We * [Supported Math functions](#supported-math-functions) * [How to check what is supported](#how-to-check-what-is-supported) * [Typescript Typings](#typescript-typings) +* [Dealing With Transpilation](#dealing-with-transpilation) * [Full API reference](#full-api-reference) * [Automatically-built Documentation](#automatically-built-documentation) * [Contributors](#contributors) @@ -180,6 +181,7 @@ Settings are an object used to create a `kernel` or `kernelMap`. Example: `gpu. * `immutable` or `kernel.setImmutable(boolean)`: boolean, default = `false` * `strictIntegers` or `kernel.setStrictIntegers(boolean)`: boolean, default = `false` - allows undefined argumentTypes and function return values to use strict integer declarations. * `useLegacyEncoder` or `kernel.setUseLegacyEncoder(boolean)`: boolean, default `false` - more info [here](https://github.com/gpujs/gpu.js/wiki/Encoder-details). +* `warnVarUsage` or `kernel.setWarnVarUsage(boolean)`: turn off var usage warnings, they can be irritating, and in transpiled environments, there is nothing we can do about it. ## Creating and Running Functions @@ -858,6 +860,21 @@ To assist with mostly unit tests, but perhaps in scenarios outside of GPU.js, th ## Typescript Typings Typescript is supported! Typings can be found [here](src/index.d.ts)! +## Dealing With Transpilation +Transpilation doesn't do the best job of keeping code beautiful. To aid in this endeavor GPU.js can handle some scenarios to still aid you harnessing the GPU in less than ideal circumstances. +Here is a list of a few things that GPU.js does to fix transpilation: + +* When a transpiler such as [Babel](https://babeljs.io/) changes `myCall()` to `(0, _myCall.myCall)`, it is gracefully handled. +* Using `var` will have a lot of warnings by default, this can be irritating because sometimes there is nothing we can do about this in transpiled environment. + To aid in the irritation, there is an option to alleviate the irritation. + When `const` and `let` are converted to `var`, and you'r prefer not to see it, use the following: + ```js + const kernel = gpu.createKernel(myKernelFunction) + .setWarnVarUsage(false); + // or + const kernel = gpu.createKernel(myKernelFunction, { output: [1], warnVarUsage: false }); + ``` + ## Full API Reference You can find a [complete API reference here](https://doxdox.org/gpujs/gpu.js/). diff --git a/dist/gpu-browser-core.js b/dist/gpu-browser-core.js index 68169b21..ac0539c7 100644 --- a/dist/gpu-browser-core.js +++ b/dist/gpu-browser-core.js @@ -4,8 +4,8 @@ * * GPU Accelerated JavaScript * - * @version 2.0.0-rc.19 - * @date Tue Jul 02 2019 12:17:44 GMT-0400 (Eastern Daylight Time) + * @version 2.0.0-rc.20 + * @date Fri Jul 05 2019 11:02:54 GMT-0400 (Eastern Daylight Time) * * @license MIT * The MIT License @@ -717,7 +717,7 @@ class CPUFunctionNode extends FunctionNode { } astVariableDeclaration(varDecNode, retArr) { - if (varDecNode.kind === 'var') { + if (varDecNode.kind === 'var' && this.warnVarUsage) { this.varWarn(); } retArr.push(`${varDecNode.kind} `); @@ -900,9 +900,9 @@ class CPUFunctionNode extends FunctionNode { if (isInput) { retArr.push('[('); this.astGeneric(zProperty, retArr); - retArr.push(`*${ size[1] * size[0]})+(`); + retArr.push(`*${ this.dynamicArguments ? '(outputY * outputX)' : size[1] * size[0] })+(`); this.astGeneric(yProperty, retArr); - retArr.push(`*${ size[0] })+`); + retArr.push(`*${ this.dynamicArguments ? 'outputX' : size[0] })+`); this.astGeneric(xProperty, retArr); retArr.push(']'); } else { @@ -920,7 +920,7 @@ class CPUFunctionNode extends FunctionNode { if (isInput) { retArr.push('[('); this.astGeneric(yProperty, retArr); - retArr.push(`*${ size[0] })+`); + retArr.push(`*${ this.dynamicArguments ? 'outputX' : size[0] })+`); this.astGeneric(xProperty, retArr); retArr.push(']'); } else { @@ -1674,7 +1674,9 @@ class FunctionBuilder { functions, leadingReturnStatement, followingReturnStatement, + dynamicArguments, dynamicOutput, + warnVarUsage, } = kernel; const needsArgumentType = (functionName, index) => { @@ -1736,7 +1738,8 @@ class FunctionBuilder { triggerImplyArgumentType, triggerTrackArgumentSynonym, lookupArgumentSynonym, - onFunctionCall + onFunctionCall, + warnVarUsage, })); nestedFunction.traceFunctionAST(ast); functionBuilder.addFunctionNode(nestedFunction); @@ -1764,6 +1767,7 @@ class FunctionBuilder { loopMaxIterations, output, plugins, + dynamicArguments, dynamicOutput, }, extraNodeOptions || {}); @@ -2234,8 +2238,10 @@ class FunctionNode { this.leadingReturnStatement = null; this.followingReturnStatement = null; this.dynamicOutput = null; + this.dynamicArguments = null; this.strictTypingChecking = false; this.fixIntegerDivisionAccuracy = null; + this.warnVarUsage = true; if (settings) { for (const p in settings) { @@ -5465,6 +5471,7 @@ class Kernel { this.optimizeFloatMemory = null; this.strictIntegers = false; this.fixIntegerDivisionAccuracy = null; + this.warnVarUsage = true; } mergeSettings(settings) { @@ -5660,6 +5667,11 @@ class Kernel { return this; } + setWarnVarUsage(flag) { + this.warnVarUsage = flag; + return this; + } + getCanvas() { utils.warnDeprecated('method', 'getCanvas'); return this.canvas; @@ -6784,7 +6796,7 @@ class WebGLFunctionNode extends FunctionNode { } astVariableDeclaration(varDecNode, retArr) { - if (varDecNode.kind === 'var') { + if (varDecNode.kind === 'var' && this.warnVarUsage) { this.varWarn(); } const declarations = varDecNode.declarations; @@ -7569,7 +7581,7 @@ module.exports = { const { utils } = require('../../../utils'); const { WebGLKernelValueHTMLImage } = require('./html-image'); -class WebGLKernelValueDynamicInput extends WebGLKernelValueHTMLImage { +class WebGLKernelValueDynamicHTMLImage extends WebGLKernelValueHTMLImage { getSource() { return utils.linesToString([ `uniform sampler2D ${this.id}`, @@ -7589,7 +7601,7 @@ class WebGLKernelValueDynamicInput extends WebGLKernelValueHTMLImage { } module.exports = { - WebGLKernelValueDynamicInput + WebGLKernelValueDynamicHTMLImage }; },{"../../../utils":89,"./html-image":47}],40:[function(require,module,exports){ const { utils } = require('../../../utils'); @@ -7630,8 +7642,8 @@ class WebGLKernelValueDynamicNumberTexture extends WebGLKernelValueNumberTexture } updateValue(value) { - this.dimensions = inputTexture.dimensions; - this.textureSize = inputTexture.size; + this.dimensions = value.dimensions; + this.textureSize = value.size; this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); @@ -7684,7 +7696,7 @@ class WebGLKernelValueDynamicSingleInput extends WebGLKernelValueSingleInput { updateValue(value) { this.dimensions = value.size; this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); - this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * (4 / this.bitRatio); + this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; this.uploadValue = new Float32Array(this.uploadArrayLength); this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); this.kernel.setUniform2iv(this.sizeId, this.textureSize); @@ -9957,6 +9969,7 @@ void main(void) { module.exports = { fragmentShader }; + },{}],59:[function(require,module,exports){ const { WebGLFunctionNode } = require('../web-gl/function-node'); @@ -10148,9 +10161,9 @@ module.exports = { }; },{"./html-image-array":71}],63:[function(require,module,exports){ const { utils } = require('../../../utils'); -const { WebGLKernelValueDynamicInput } = require('../../web-gl/kernel-value/dynamic-html-image'); +const { WebGLKernelValueDynamicHTMLImage } = require('../../web-gl/kernel-value/dynamic-html-image'); -class WebGL2KernelValueDynamicInput extends WebGLKernelValueDynamicInput { +class WebGL2KernelValueDynamicHTMLImage extends WebGLKernelValueDynamicHTMLImage { getSource() { return utils.linesToString([ `uniform highp sampler2D ${this.id}`, @@ -10161,7 +10174,7 @@ class WebGL2KernelValueDynamicInput extends WebGLKernelValueDynamicInput { } module.exports = { - WebGL2KernelValueDynamicInput + WebGL2KernelValueDynamicHTMLImage }; },{"../../../utils":89,"../../web-gl/kernel-value/dynamic-html-image":39}],64:[function(require,module,exports){ const { utils } = require('../../../utils'); @@ -10199,9 +10212,9 @@ module.exports = { }; },{"../../../utils":89,"../../web-gl/kernel-value/dynamic-number-texture":41}],66:[function(require,module,exports){ const { utils } = require('../../../utils'); -const { WebGLKernelValueDynamicSingleArray } = require('../../web-gl/kernel-value/dynamic-single-array'); +const { WebGL2KernelValueSingleArray } = require('../../web-gl2/kernel-value/single-array'); -class WebGL2KernelValueDynamicSingleArray extends WebGLKernelValueDynamicSingleArray { +class WebGL2KernelValueDynamicSingleArray extends WebGL2KernelValueSingleArray { getSource() { return utils.linesToString([ `uniform highp sampler2D ${this.id}`, @@ -10209,16 +10222,26 @@ class WebGL2KernelValueDynamicSingleArray extends WebGLKernelValueDynamicSingleA `uniform highp ivec3 ${this.dimensionsId}`, ]); } + + updateValue(value) { + this.dimensions = utils.getDimensions(value, true); + this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); + this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.uploadValue = new Float32Array(this.uploadArrayLength); + this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); + this.kernel.setUniform2iv(this.sizeId, this.textureSize); + super.updateValue(value); + } } module.exports = { WebGL2KernelValueDynamicSingleArray }; -},{"../../../utils":89,"../../web-gl/kernel-value/dynamic-single-array":42}],67:[function(require,module,exports){ +},{"../../../utils":89,"../../web-gl2/kernel-value/single-array":76}],67:[function(require,module,exports){ const { utils } = require('../../../utils'); -const { WebGLKernelValueDynamicSingleInput } = require('../../web-gl/kernel-value/dynamic-single-input'); +const { WebGL2KernelValueSingleInput } = require('../../web-gl2/kernel-value/single-input'); -class WebGL2KernelValueDynamicSingleInput extends WebGLKernelValueDynamicSingleInput { +class WebGL2KernelValueDynamicSingleInput extends WebGL2KernelValueSingleInput { getSource() { return utils.linesToString([ `uniform highp sampler2D ${this.id}`, @@ -10226,12 +10249,22 @@ class WebGL2KernelValueDynamicSingleInput extends WebGLKernelValueDynamicSingleI `uniform highp ivec3 ${this.dimensionsId}`, ]); } + + updateValue(value) { + this.dimensions = value.size; + this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); + this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.uploadValue = new Float32Array(this.uploadArrayLength); + this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); + this.kernel.setUniform2iv(this.sizeId, this.textureSize); + super.updateValue(value); + } } module.exports = { WebGL2KernelValueDynamicSingleInput }; -},{"../../../utils":89,"../../web-gl/kernel-value/dynamic-single-input":43}],68:[function(require,module,exports){ +},{"../../../utils":89,"../../web-gl2/kernel-value/single-input":77}],68:[function(require,module,exports){ const { utils } = require('../../../utils'); const { WebGLKernelValueDynamicUnsignedArray } = require('../../web-gl/kernel-value/dynamic-unsigned-array'); @@ -10523,6 +10556,7 @@ let isSupported = null; let testCanvas = null; let testContext = null; let testExtensions = null; + let features = null; class WebGL2Kernel extends WebGLKernel { @@ -11338,7 +11372,25 @@ class GPU { gpu: this, validate, onRequestFallback: (args) => { - const fallbackKernel = new CPUKernel(source, mergedSettings); + const fallbackKernel = new CPUKernel(source, { + graphical: kernel.graphical, + loopMaxIterations: kernel.loopMaxIterations, + constants: kernel.constants, + dynamicOutput: kernel.dynamicOutput, + dynamicArgument: kernel.dynamicArguments, + output: kernel.output, + precision: kernel.precision, + pipeline: kernel.pipeline, + immutable: kernel.immutable, + optimizeFloatMemory: kernel.optimizeFloatMemory, + fixIntegerDivisionAccuracy: kernel.fixIntegerDivisionAccuracy, + functions: kernel.functions, + nativeFunctions: kernel.nativeFunctions, + subKernels: kernel.subKernels, + strictIntegers: kernel.strictIntegers, + debug: kernel.debug, + warnVarUsage: kernel.warnVarUsage, + }); fallbackKernel.build.apply(fallbackKernel, args); const result = fallbackKernel.run.apply(fallbackKernel, args); kernel.replaceKernel(fallbackKernel); @@ -11361,7 +11413,10 @@ class GPU { } const newKernel = switchableKernels[signature] = new this.Kernel(source, { graphical: kernel.graphical, + loopMaxIterations: kernel.loopMaxIterations, constants: kernel.constants, + dynamicOutput: kernel.dynamicOutput, + dynamicArgument: kernel.dynamicArguments, context: kernel.context, canvas: kernel.canvas, output: kernel.output, @@ -11377,6 +11432,7 @@ class GPU { debug: kernel.debug, gpu: this, validate, + warnVarUsage: kernel.warnVarUsage, }); newKernel.build.apply(newKernel, args); newKernel.run.apply(newKernel, args); diff --git a/dist/gpu-browser-core.min.js b/dist/gpu-browser-core.min.js index c47575fc..9d40381f 100644 --- a/dist/gpu-browser-core.min.js +++ b/dist/gpu-browser-core.min.js @@ -4,8 +4,8 @@ * * GPU Accelerated JavaScript * - * @version 2.0.0-rc.19 - * @date Tue Jul 02 2019 12:17:46 GMT-0400 (Eastern Daylight Time) + * @version 2.0.0-rc.20 + * @date Fri Jul 05 2019 11:02:56 GMT-0400 (Eastern Daylight Time) * * @license MIT * The MIT License @@ -17,8 +17,8 @@ * * GPU Accelerated JavaScript * - * @version 2.0.0-rc.19 - * @date Tue Jul 02 2019 12:17:44 GMT-0400 (Eastern Daylight Time) + * @version 2.0.0-rc.20 + * @date Fri Jul 05 2019 11:02:54 GMT-0400 (Eastern Daylight Time) * * @license MIT * The MIT License @@ -730,7 +730,7 @@ class CPUFunctionNode extends FunctionNode { } astVariableDeclaration(varDecNode, retArr) { - if (varDecNode.kind === 'var') { + if (varDecNode.kind === 'var' && this.warnVarUsage) { this.varWarn(); } retArr.push(`${varDecNode.kind} `); @@ -913,9 +913,9 @@ class CPUFunctionNode extends FunctionNode { if (isInput) { retArr.push('[('); this.astGeneric(zProperty, retArr); - retArr.push(`*${ size[1] * size[0]})+(`); + retArr.push(`*${ this.dynamicArguments ? '(outputY * outputX)' : size[1] * size[0] })+(`); this.astGeneric(yProperty, retArr); - retArr.push(`*${ size[0] })+`); + retArr.push(`*${ this.dynamicArguments ? 'outputX' : size[0] })+`); this.astGeneric(xProperty, retArr); retArr.push(']'); } else { @@ -933,7 +933,7 @@ class CPUFunctionNode extends FunctionNode { if (isInput) { retArr.push('[('); this.astGeneric(yProperty, retArr); - retArr.push(`*${ size[0] })+`); + retArr.push(`*${ this.dynamicArguments ? 'outputX' : size[0] })+`); this.astGeneric(xProperty, retArr); retArr.push(']'); } else { @@ -1687,7 +1687,9 @@ class FunctionBuilder { functions, leadingReturnStatement, followingReturnStatement, + dynamicArguments, dynamicOutput, + warnVarUsage, } = kernel; const needsArgumentType = (functionName, index) => { @@ -1749,7 +1751,8 @@ class FunctionBuilder { triggerImplyArgumentType, triggerTrackArgumentSynonym, lookupArgumentSynonym, - onFunctionCall + onFunctionCall, + warnVarUsage, })); nestedFunction.traceFunctionAST(ast); functionBuilder.addFunctionNode(nestedFunction); @@ -1777,6 +1780,7 @@ class FunctionBuilder { loopMaxIterations, output, plugins, + dynamicArguments, dynamicOutput, }, extraNodeOptions || {}); @@ -2247,8 +2251,10 @@ class FunctionNode { this.leadingReturnStatement = null; this.followingReturnStatement = null; this.dynamicOutput = null; + this.dynamicArguments = null; this.strictTypingChecking = false; this.fixIntegerDivisionAccuracy = null; + this.warnVarUsage = true; if (settings) { for (const p in settings) { @@ -5478,6 +5484,7 @@ class Kernel { this.optimizeFloatMemory = null; this.strictIntegers = false; this.fixIntegerDivisionAccuracy = null; + this.warnVarUsage = true; } mergeSettings(settings) { @@ -5673,6 +5680,11 @@ class Kernel { return this; } + setWarnVarUsage(flag) { + this.warnVarUsage = flag; + return this; + } + getCanvas() { utils.warnDeprecated('method', 'getCanvas'); return this.canvas; @@ -6797,7 +6809,7 @@ class WebGLFunctionNode extends FunctionNode { } astVariableDeclaration(varDecNode, retArr) { - if (varDecNode.kind === 'var') { + if (varDecNode.kind === 'var' && this.warnVarUsage) { this.varWarn(); } const declarations = varDecNode.declarations; @@ -7582,7 +7594,7 @@ module.exports = { const { utils } = require('../../../utils'); const { WebGLKernelValueHTMLImage } = require('./html-image'); -class WebGLKernelValueDynamicInput extends WebGLKernelValueHTMLImage { +class WebGLKernelValueDynamicHTMLImage extends WebGLKernelValueHTMLImage { getSource() { return utils.linesToString([ `uniform sampler2D ${this.id}`, @@ -7602,7 +7614,7 @@ class WebGLKernelValueDynamicInput extends WebGLKernelValueHTMLImage { } module.exports = { - WebGLKernelValueDynamicInput + WebGLKernelValueDynamicHTMLImage }; },{"../../../utils":89,"./html-image":47}],40:[function(require,module,exports){ const { utils } = require('../../../utils'); @@ -7643,8 +7655,8 @@ class WebGLKernelValueDynamicNumberTexture extends WebGLKernelValueNumberTexture } updateValue(value) { - this.dimensions = inputTexture.dimensions; - this.textureSize = inputTexture.size; + this.dimensions = value.dimensions; + this.textureSize = value.size; this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); @@ -7697,7 +7709,7 @@ class WebGLKernelValueDynamicSingleInput extends WebGLKernelValueSingleInput { updateValue(value) { this.dimensions = value.size; this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); - this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * (4 / this.bitRatio); + this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; this.uploadValue = new Float32Array(this.uploadArrayLength); this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); this.kernel.setUniform2iv(this.sizeId, this.textureSize); @@ -9970,6 +9982,7 @@ void main(void) { module.exports = { fragmentShader }; + },{}],59:[function(require,module,exports){ const { WebGLFunctionNode } = require('../web-gl/function-node'); @@ -10161,9 +10174,9 @@ module.exports = { }; },{"./html-image-array":71}],63:[function(require,module,exports){ const { utils } = require('../../../utils'); -const { WebGLKernelValueDynamicInput } = require('../../web-gl/kernel-value/dynamic-html-image'); +const { WebGLKernelValueDynamicHTMLImage } = require('../../web-gl/kernel-value/dynamic-html-image'); -class WebGL2KernelValueDynamicInput extends WebGLKernelValueDynamicInput { +class WebGL2KernelValueDynamicHTMLImage extends WebGLKernelValueDynamicHTMLImage { getSource() { return utils.linesToString([ `uniform highp sampler2D ${this.id}`, @@ -10174,7 +10187,7 @@ class WebGL2KernelValueDynamicInput extends WebGLKernelValueDynamicInput { } module.exports = { - WebGL2KernelValueDynamicInput + WebGL2KernelValueDynamicHTMLImage }; },{"../../../utils":89,"../../web-gl/kernel-value/dynamic-html-image":39}],64:[function(require,module,exports){ const { utils } = require('../../../utils'); @@ -10212,9 +10225,9 @@ module.exports = { }; },{"../../../utils":89,"../../web-gl/kernel-value/dynamic-number-texture":41}],66:[function(require,module,exports){ const { utils } = require('../../../utils'); -const { WebGLKernelValueDynamicSingleArray } = require('../../web-gl/kernel-value/dynamic-single-array'); +const { WebGL2KernelValueSingleArray } = require('../../web-gl2/kernel-value/single-array'); -class WebGL2KernelValueDynamicSingleArray extends WebGLKernelValueDynamicSingleArray { +class WebGL2KernelValueDynamicSingleArray extends WebGL2KernelValueSingleArray { getSource() { return utils.linesToString([ `uniform highp sampler2D ${this.id}`, @@ -10222,16 +10235,26 @@ class WebGL2KernelValueDynamicSingleArray extends WebGLKernelValueDynamicSingleA `uniform highp ivec3 ${this.dimensionsId}`, ]); } + + updateValue(value) { + this.dimensions = utils.getDimensions(value, true); + this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); + this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.uploadValue = new Float32Array(this.uploadArrayLength); + this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); + this.kernel.setUniform2iv(this.sizeId, this.textureSize); + super.updateValue(value); + } } module.exports = { WebGL2KernelValueDynamicSingleArray }; -},{"../../../utils":89,"../../web-gl/kernel-value/dynamic-single-array":42}],67:[function(require,module,exports){ +},{"../../../utils":89,"../../web-gl2/kernel-value/single-array":76}],67:[function(require,module,exports){ const { utils } = require('../../../utils'); -const { WebGLKernelValueDynamicSingleInput } = require('../../web-gl/kernel-value/dynamic-single-input'); +const { WebGL2KernelValueSingleInput } = require('../../web-gl2/kernel-value/single-input'); -class WebGL2KernelValueDynamicSingleInput extends WebGLKernelValueDynamicSingleInput { +class WebGL2KernelValueDynamicSingleInput extends WebGL2KernelValueSingleInput { getSource() { return utils.linesToString([ `uniform highp sampler2D ${this.id}`, @@ -10239,12 +10262,22 @@ class WebGL2KernelValueDynamicSingleInput extends WebGLKernelValueDynamicSingleI `uniform highp ivec3 ${this.dimensionsId}`, ]); } + + updateValue(value) { + this.dimensions = value.size; + this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); + this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.uploadValue = new Float32Array(this.uploadArrayLength); + this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); + this.kernel.setUniform2iv(this.sizeId, this.textureSize); + super.updateValue(value); + } } module.exports = { WebGL2KernelValueDynamicSingleInput }; -},{"../../../utils":89,"../../web-gl/kernel-value/dynamic-single-input":43}],68:[function(require,module,exports){ +},{"../../../utils":89,"../../web-gl2/kernel-value/single-input":77}],68:[function(require,module,exports){ const { utils } = require('../../../utils'); const { WebGLKernelValueDynamicUnsignedArray } = require('../../web-gl/kernel-value/dynamic-unsigned-array'); @@ -10536,6 +10569,7 @@ let isSupported = null; let testCanvas = null; let testContext = null; let testExtensions = null; + let features = null; class WebGL2Kernel extends WebGLKernel { @@ -11351,7 +11385,25 @@ class GPU { gpu: this, validate, onRequestFallback: (args) => { - const fallbackKernel = new CPUKernel(source, mergedSettings); + const fallbackKernel = new CPUKernel(source, { + graphical: kernel.graphical, + loopMaxIterations: kernel.loopMaxIterations, + constants: kernel.constants, + dynamicOutput: kernel.dynamicOutput, + dynamicArgument: kernel.dynamicArguments, + output: kernel.output, + precision: kernel.precision, + pipeline: kernel.pipeline, + immutable: kernel.immutable, + optimizeFloatMemory: kernel.optimizeFloatMemory, + fixIntegerDivisionAccuracy: kernel.fixIntegerDivisionAccuracy, + functions: kernel.functions, + nativeFunctions: kernel.nativeFunctions, + subKernels: kernel.subKernels, + strictIntegers: kernel.strictIntegers, + debug: kernel.debug, + warnVarUsage: kernel.warnVarUsage, + }); fallbackKernel.build.apply(fallbackKernel, args); const result = fallbackKernel.run.apply(fallbackKernel, args); kernel.replaceKernel(fallbackKernel); @@ -11374,7 +11426,10 @@ class GPU { } const newKernel = switchableKernels[signature] = new this.Kernel(source, { graphical: kernel.graphical, + loopMaxIterations: kernel.loopMaxIterations, constants: kernel.constants, + dynamicOutput: kernel.dynamicOutput, + dynamicArgument: kernel.dynamicArguments, context: kernel.context, canvas: kernel.canvas, output: kernel.output, @@ -11390,6 +11445,7 @@ class GPU { debug: kernel.debug, gpu: this, validate, + warnVarUsage: kernel.warnVarUsage, }); newKernel.build.apply(newKernel, args); newKernel.run.apply(newKernel, args); diff --git a/dist/gpu-browser.js b/dist/gpu-browser.js index bf890b6f..6e21a38d 100644 --- a/dist/gpu-browser.js +++ b/dist/gpu-browser.js @@ -4,8 +4,8 @@ * * GPU Accelerated JavaScript * - * @version 2.0.0-rc.19 - * @date Tue Jul 02 2019 12:17:44 GMT-0400 (Eastern Daylight Time) + * @version 2.0.0-rc.20 + * @date Fri Jul 05 2019 11:02:54 GMT-0400 (Eastern Daylight Time) * * @license MIT * The MIT License @@ -5481,7 +5481,7 @@ class CPUFunctionNode extends FunctionNode { } astVariableDeclaration(varDecNode, retArr) { - if (varDecNode.kind === 'var') { + if (varDecNode.kind === 'var' && this.warnVarUsage) { this.varWarn(); } retArr.push(`${varDecNode.kind} `); @@ -5664,9 +5664,9 @@ class CPUFunctionNode extends FunctionNode { if (isInput) { retArr.push('[('); this.astGeneric(zProperty, retArr); - retArr.push(`*${ size[1] * size[0]})+(`); + retArr.push(`*${ this.dynamicArguments ? '(outputY * outputX)' : size[1] * size[0] })+(`); this.astGeneric(yProperty, retArr); - retArr.push(`*${ size[0] })+`); + retArr.push(`*${ this.dynamicArguments ? 'outputX' : size[0] })+`); this.astGeneric(xProperty, retArr); retArr.push(']'); } else { @@ -5684,7 +5684,7 @@ class CPUFunctionNode extends FunctionNode { if (isInput) { retArr.push('[('); this.astGeneric(yProperty, retArr); - retArr.push(`*${ size[0] })+`); + retArr.push(`*${ this.dynamicArguments ? 'outputX' : size[0] })+`); this.astGeneric(xProperty, retArr); retArr.push(']'); } else { @@ -6438,7 +6438,9 @@ class FunctionBuilder { functions, leadingReturnStatement, followingReturnStatement, + dynamicArguments, dynamicOutput, + warnVarUsage, } = kernel; const needsArgumentType = (functionName, index) => { @@ -6500,7 +6502,8 @@ class FunctionBuilder { triggerImplyArgumentType, triggerTrackArgumentSynonym, lookupArgumentSynonym, - onFunctionCall + onFunctionCall, + warnVarUsage, })); nestedFunction.traceFunctionAST(ast); functionBuilder.addFunctionNode(nestedFunction); @@ -6528,6 +6531,7 @@ class FunctionBuilder { loopMaxIterations, output, plugins, + dynamicArguments, dynamicOutput, }, extraNodeOptions || {}); @@ -6998,8 +7002,10 @@ class FunctionNode { this.leadingReturnStatement = null; this.followingReturnStatement = null; this.dynamicOutput = null; + this.dynamicArguments = null; this.strictTypingChecking = false; this.fixIntegerDivisionAccuracy = null; + this.warnVarUsage = true; if (settings) { for (const p in settings) { @@ -10229,6 +10235,7 @@ class Kernel { this.optimizeFloatMemory = null; this.strictIntegers = false; this.fixIntegerDivisionAccuracy = null; + this.warnVarUsage = true; } mergeSettings(settings) { @@ -10424,6 +10431,11 @@ class Kernel { return this; } + setWarnVarUsage(flag) { + this.warnVarUsage = flag; + return this; + } + getCanvas() { utils.warnDeprecated('method', 'getCanvas'); return this.canvas; @@ -11548,7 +11560,7 @@ class WebGLFunctionNode extends FunctionNode { } astVariableDeclaration(varDecNode, retArr) { - if (varDecNode.kind === 'var') { + if (varDecNode.kind === 'var' && this.warnVarUsage) { this.varWarn(); } const declarations = varDecNode.declarations; @@ -12333,7 +12345,7 @@ module.exports = { const { utils } = require('../../../utils'); const { WebGLKernelValueHTMLImage } = require('./html-image'); -class WebGLKernelValueDynamicInput extends WebGLKernelValueHTMLImage { +class WebGLKernelValueDynamicHTMLImage extends WebGLKernelValueHTMLImage { getSource() { return utils.linesToString([ `uniform sampler2D ${this.id}`, @@ -12353,7 +12365,7 @@ class WebGLKernelValueDynamicInput extends WebGLKernelValueHTMLImage { } module.exports = { - WebGLKernelValueDynamicInput + WebGLKernelValueDynamicHTMLImage }; },{"../../../utils":90,"./html-image":48}],41:[function(require,module,exports){ const { utils } = require('../../../utils'); @@ -12394,8 +12406,8 @@ class WebGLKernelValueDynamicNumberTexture extends WebGLKernelValueNumberTexture } updateValue(value) { - this.dimensions = inputTexture.dimensions; - this.textureSize = inputTexture.size; + this.dimensions = value.dimensions; + this.textureSize = value.size; this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); @@ -12448,7 +12460,7 @@ class WebGLKernelValueDynamicSingleInput extends WebGLKernelValueSingleInput { updateValue(value) { this.dimensions = value.size; this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); - this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * (4 / this.bitRatio); + this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; this.uploadValue = new Float32Array(this.uploadArrayLength); this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); this.kernel.setUniform2iv(this.sizeId, this.textureSize); @@ -14721,6 +14733,7 @@ void main(void) { module.exports = { fragmentShader }; + },{}],60:[function(require,module,exports){ const { WebGLFunctionNode } = require('../web-gl/function-node'); @@ -14912,9 +14925,9 @@ module.exports = { }; },{"./html-image-array":72}],64:[function(require,module,exports){ const { utils } = require('../../../utils'); -const { WebGLKernelValueDynamicInput } = require('../../web-gl/kernel-value/dynamic-html-image'); +const { WebGLKernelValueDynamicHTMLImage } = require('../../web-gl/kernel-value/dynamic-html-image'); -class WebGL2KernelValueDynamicInput extends WebGLKernelValueDynamicInput { +class WebGL2KernelValueDynamicHTMLImage extends WebGLKernelValueDynamicHTMLImage { getSource() { return utils.linesToString([ `uniform highp sampler2D ${this.id}`, @@ -14925,7 +14938,7 @@ class WebGL2KernelValueDynamicInput extends WebGLKernelValueDynamicInput { } module.exports = { - WebGL2KernelValueDynamicInput + WebGL2KernelValueDynamicHTMLImage }; },{"../../../utils":90,"../../web-gl/kernel-value/dynamic-html-image":40}],65:[function(require,module,exports){ const { utils } = require('../../../utils'); @@ -14963,9 +14976,9 @@ module.exports = { }; },{"../../../utils":90,"../../web-gl/kernel-value/dynamic-number-texture":42}],67:[function(require,module,exports){ const { utils } = require('../../../utils'); -const { WebGLKernelValueDynamicSingleArray } = require('../../web-gl/kernel-value/dynamic-single-array'); +const { WebGL2KernelValueSingleArray } = require('../../web-gl2/kernel-value/single-array'); -class WebGL2KernelValueDynamicSingleArray extends WebGLKernelValueDynamicSingleArray { +class WebGL2KernelValueDynamicSingleArray extends WebGL2KernelValueSingleArray { getSource() { return utils.linesToString([ `uniform highp sampler2D ${this.id}`, @@ -14973,16 +14986,26 @@ class WebGL2KernelValueDynamicSingleArray extends WebGLKernelValueDynamicSingleA `uniform highp ivec3 ${this.dimensionsId}`, ]); } + + updateValue(value) { + this.dimensions = utils.getDimensions(value, true); + this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); + this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.uploadValue = new Float32Array(this.uploadArrayLength); + this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); + this.kernel.setUniform2iv(this.sizeId, this.textureSize); + super.updateValue(value); + } } module.exports = { WebGL2KernelValueDynamicSingleArray }; -},{"../../../utils":90,"../../web-gl/kernel-value/dynamic-single-array":43}],68:[function(require,module,exports){ +},{"../../../utils":90,"../../web-gl2/kernel-value/single-array":77}],68:[function(require,module,exports){ const { utils } = require('../../../utils'); -const { WebGLKernelValueDynamicSingleInput } = require('../../web-gl/kernel-value/dynamic-single-input'); +const { WebGL2KernelValueSingleInput } = require('../../web-gl2/kernel-value/single-input'); -class WebGL2KernelValueDynamicSingleInput extends WebGLKernelValueDynamicSingleInput { +class WebGL2KernelValueDynamicSingleInput extends WebGL2KernelValueSingleInput { getSource() { return utils.linesToString([ `uniform highp sampler2D ${this.id}`, @@ -14990,12 +15013,22 @@ class WebGL2KernelValueDynamicSingleInput extends WebGLKernelValueDynamicSingleI `uniform highp ivec3 ${this.dimensionsId}`, ]); } + + updateValue(value) { + this.dimensions = value.size; + this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); + this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.uploadValue = new Float32Array(this.uploadArrayLength); + this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); + this.kernel.setUniform2iv(this.sizeId, this.textureSize); + super.updateValue(value); + } } module.exports = { WebGL2KernelValueDynamicSingleInput }; -},{"../../../utils":90,"../../web-gl/kernel-value/dynamic-single-input":44}],69:[function(require,module,exports){ +},{"../../../utils":90,"../../web-gl2/kernel-value/single-input":78}],69:[function(require,module,exports){ const { utils } = require('../../../utils'); const { WebGLKernelValueDynamicUnsignedArray } = require('../../web-gl/kernel-value/dynamic-unsigned-array'); @@ -15287,6 +15320,7 @@ let isSupported = null; let testCanvas = null; let testContext = null; let testExtensions = null; + let features = null; class WebGL2Kernel extends WebGLKernel { @@ -16102,7 +16136,25 @@ class GPU { gpu: this, validate, onRequestFallback: (args) => { - const fallbackKernel = new CPUKernel(source, mergedSettings); + const fallbackKernel = new CPUKernel(source, { + graphical: kernel.graphical, + loopMaxIterations: kernel.loopMaxIterations, + constants: kernel.constants, + dynamicOutput: kernel.dynamicOutput, + dynamicArgument: kernel.dynamicArguments, + output: kernel.output, + precision: kernel.precision, + pipeline: kernel.pipeline, + immutable: kernel.immutable, + optimizeFloatMemory: kernel.optimizeFloatMemory, + fixIntegerDivisionAccuracy: kernel.fixIntegerDivisionAccuracy, + functions: kernel.functions, + nativeFunctions: kernel.nativeFunctions, + subKernels: kernel.subKernels, + strictIntegers: kernel.strictIntegers, + debug: kernel.debug, + warnVarUsage: kernel.warnVarUsage, + }); fallbackKernel.build.apply(fallbackKernel, args); const result = fallbackKernel.run.apply(fallbackKernel, args); kernel.replaceKernel(fallbackKernel); @@ -16125,7 +16177,10 @@ class GPU { } const newKernel = switchableKernels[signature] = new this.Kernel(source, { graphical: kernel.graphical, + loopMaxIterations: kernel.loopMaxIterations, constants: kernel.constants, + dynamicOutput: kernel.dynamicOutput, + dynamicArgument: kernel.dynamicArguments, context: kernel.context, canvas: kernel.canvas, output: kernel.output, @@ -16141,6 +16196,7 @@ class GPU { debug: kernel.debug, gpu: this, validate, + warnVarUsage: kernel.warnVarUsage, }); newKernel.build.apply(newKernel, args); newKernel.run.apply(newKernel, args); diff --git a/dist/gpu-browser.min.js b/dist/gpu-browser.min.js index 0ecb60ba..d7f9e6a9 100644 --- a/dist/gpu-browser.min.js +++ b/dist/gpu-browser.min.js @@ -4,8 +4,8 @@ * * GPU Accelerated JavaScript * - * @version 2.0.0-rc.19 - * @date Tue Jul 02 2019 12:17:46 GMT-0400 (Eastern Daylight Time) + * @version 2.0.0-rc.20 + * @date Fri Jul 05 2019 11:02:56 GMT-0400 (Eastern Daylight Time) * * @license MIT * The MIT License @@ -17,8 +17,8 @@ * * GPU Accelerated JavaScript * - * @version 2.0.0-rc.19 - * @date Tue Jul 02 2019 12:17:44 GMT-0400 (Eastern Daylight Time) + * @version 2.0.0-rc.20 + * @date Fri Jul 05 2019 11:02:54 GMT-0400 (Eastern Daylight Time) * * @license MIT * The MIT License @@ -5494,7 +5494,7 @@ class CPUFunctionNode extends FunctionNode { } astVariableDeclaration(varDecNode, retArr) { - if (varDecNode.kind === 'var') { + if (varDecNode.kind === 'var' && this.warnVarUsage) { this.varWarn(); } retArr.push(`${varDecNode.kind} `); @@ -5677,9 +5677,9 @@ class CPUFunctionNode extends FunctionNode { if (isInput) { retArr.push('[('); this.astGeneric(zProperty, retArr); - retArr.push(`*${ size[1] * size[0]})+(`); + retArr.push(`*${ this.dynamicArguments ? '(outputY * outputX)' : size[1] * size[0] })+(`); this.astGeneric(yProperty, retArr); - retArr.push(`*${ size[0] })+`); + retArr.push(`*${ this.dynamicArguments ? 'outputX' : size[0] })+`); this.astGeneric(xProperty, retArr); retArr.push(']'); } else { @@ -5697,7 +5697,7 @@ class CPUFunctionNode extends FunctionNode { if (isInput) { retArr.push('[('); this.astGeneric(yProperty, retArr); - retArr.push(`*${ size[0] })+`); + retArr.push(`*${ this.dynamicArguments ? 'outputX' : size[0] })+`); this.astGeneric(xProperty, retArr); retArr.push(']'); } else { @@ -6451,7 +6451,9 @@ class FunctionBuilder { functions, leadingReturnStatement, followingReturnStatement, + dynamicArguments, dynamicOutput, + warnVarUsage, } = kernel; const needsArgumentType = (functionName, index) => { @@ -6513,7 +6515,8 @@ class FunctionBuilder { triggerImplyArgumentType, triggerTrackArgumentSynonym, lookupArgumentSynonym, - onFunctionCall + onFunctionCall, + warnVarUsage, })); nestedFunction.traceFunctionAST(ast); functionBuilder.addFunctionNode(nestedFunction); @@ -6541,6 +6544,7 @@ class FunctionBuilder { loopMaxIterations, output, plugins, + dynamicArguments, dynamicOutput, }, extraNodeOptions || {}); @@ -7011,8 +7015,10 @@ class FunctionNode { this.leadingReturnStatement = null; this.followingReturnStatement = null; this.dynamicOutput = null; + this.dynamicArguments = null; this.strictTypingChecking = false; this.fixIntegerDivisionAccuracy = null; + this.warnVarUsage = true; if (settings) { for (const p in settings) { @@ -10242,6 +10248,7 @@ class Kernel { this.optimizeFloatMemory = null; this.strictIntegers = false; this.fixIntegerDivisionAccuracy = null; + this.warnVarUsage = true; } mergeSettings(settings) { @@ -10437,6 +10444,11 @@ class Kernel { return this; } + setWarnVarUsage(flag) { + this.warnVarUsage = flag; + return this; + } + getCanvas() { utils.warnDeprecated('method', 'getCanvas'); return this.canvas; @@ -11561,7 +11573,7 @@ class WebGLFunctionNode extends FunctionNode { } astVariableDeclaration(varDecNode, retArr) { - if (varDecNode.kind === 'var') { + if (varDecNode.kind === 'var' && this.warnVarUsage) { this.varWarn(); } const declarations = varDecNode.declarations; @@ -12346,7 +12358,7 @@ module.exports = { const { utils } = require('../../../utils'); const { WebGLKernelValueHTMLImage } = require('./html-image'); -class WebGLKernelValueDynamicInput extends WebGLKernelValueHTMLImage { +class WebGLKernelValueDynamicHTMLImage extends WebGLKernelValueHTMLImage { getSource() { return utils.linesToString([ `uniform sampler2D ${this.id}`, @@ -12366,7 +12378,7 @@ class WebGLKernelValueDynamicInput extends WebGLKernelValueHTMLImage { } module.exports = { - WebGLKernelValueDynamicInput + WebGLKernelValueDynamicHTMLImage }; },{"../../../utils":90,"./html-image":48}],41:[function(require,module,exports){ const { utils } = require('../../../utils'); @@ -12407,8 +12419,8 @@ class WebGLKernelValueDynamicNumberTexture extends WebGLKernelValueNumberTexture } updateValue(value) { - this.dimensions = inputTexture.dimensions; - this.textureSize = inputTexture.size; + this.dimensions = value.dimensions; + this.textureSize = value.size; this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); @@ -12461,7 +12473,7 @@ class WebGLKernelValueDynamicSingleInput extends WebGLKernelValueSingleInput { updateValue(value) { this.dimensions = value.size; this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); - this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * (4 / this.bitRatio); + this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; this.uploadValue = new Float32Array(this.uploadArrayLength); this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); this.kernel.setUniform2iv(this.sizeId, this.textureSize); @@ -14734,6 +14746,7 @@ void main(void) { module.exports = { fragmentShader }; + },{}],60:[function(require,module,exports){ const { WebGLFunctionNode } = require('../web-gl/function-node'); @@ -14925,9 +14938,9 @@ module.exports = { }; },{"./html-image-array":72}],64:[function(require,module,exports){ const { utils } = require('../../../utils'); -const { WebGLKernelValueDynamicInput } = require('../../web-gl/kernel-value/dynamic-html-image'); +const { WebGLKernelValueDynamicHTMLImage } = require('../../web-gl/kernel-value/dynamic-html-image'); -class WebGL2KernelValueDynamicInput extends WebGLKernelValueDynamicInput { +class WebGL2KernelValueDynamicHTMLImage extends WebGLKernelValueDynamicHTMLImage { getSource() { return utils.linesToString([ `uniform highp sampler2D ${this.id}`, @@ -14938,7 +14951,7 @@ class WebGL2KernelValueDynamicInput extends WebGLKernelValueDynamicInput { } module.exports = { - WebGL2KernelValueDynamicInput + WebGL2KernelValueDynamicHTMLImage }; },{"../../../utils":90,"../../web-gl/kernel-value/dynamic-html-image":40}],65:[function(require,module,exports){ const { utils } = require('../../../utils'); @@ -14976,9 +14989,9 @@ module.exports = { }; },{"../../../utils":90,"../../web-gl/kernel-value/dynamic-number-texture":42}],67:[function(require,module,exports){ const { utils } = require('../../../utils'); -const { WebGLKernelValueDynamicSingleArray } = require('../../web-gl/kernel-value/dynamic-single-array'); +const { WebGL2KernelValueSingleArray } = require('../../web-gl2/kernel-value/single-array'); -class WebGL2KernelValueDynamicSingleArray extends WebGLKernelValueDynamicSingleArray { +class WebGL2KernelValueDynamicSingleArray extends WebGL2KernelValueSingleArray { getSource() { return utils.linesToString([ `uniform highp sampler2D ${this.id}`, @@ -14986,16 +14999,26 @@ class WebGL2KernelValueDynamicSingleArray extends WebGLKernelValueDynamicSingleA `uniform highp ivec3 ${this.dimensionsId}`, ]); } + + updateValue(value) { + this.dimensions = utils.getDimensions(value, true); + this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); + this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.uploadValue = new Float32Array(this.uploadArrayLength); + this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); + this.kernel.setUniform2iv(this.sizeId, this.textureSize); + super.updateValue(value); + } } module.exports = { WebGL2KernelValueDynamicSingleArray }; -},{"../../../utils":90,"../../web-gl/kernel-value/dynamic-single-array":43}],68:[function(require,module,exports){ +},{"../../../utils":90,"../../web-gl2/kernel-value/single-array":77}],68:[function(require,module,exports){ const { utils } = require('../../../utils'); -const { WebGLKernelValueDynamicSingleInput } = require('../../web-gl/kernel-value/dynamic-single-input'); +const { WebGL2KernelValueSingleInput } = require('../../web-gl2/kernel-value/single-input'); -class WebGL2KernelValueDynamicSingleInput extends WebGLKernelValueDynamicSingleInput { +class WebGL2KernelValueDynamicSingleInput extends WebGL2KernelValueSingleInput { getSource() { return utils.linesToString([ `uniform highp sampler2D ${this.id}`, @@ -15003,12 +15026,22 @@ class WebGL2KernelValueDynamicSingleInput extends WebGLKernelValueDynamicSingleI `uniform highp ivec3 ${this.dimensionsId}`, ]); } + + updateValue(value) { + this.dimensions = value.size; + this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); + this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.uploadValue = new Float32Array(this.uploadArrayLength); + this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); + this.kernel.setUniform2iv(this.sizeId, this.textureSize); + super.updateValue(value); + } } module.exports = { WebGL2KernelValueDynamicSingleInput }; -},{"../../../utils":90,"../../web-gl/kernel-value/dynamic-single-input":44}],69:[function(require,module,exports){ +},{"../../../utils":90,"../../web-gl2/kernel-value/single-input":78}],69:[function(require,module,exports){ const { utils } = require('../../../utils'); const { WebGLKernelValueDynamicUnsignedArray } = require('../../web-gl/kernel-value/dynamic-unsigned-array'); @@ -15300,6 +15333,7 @@ let isSupported = null; let testCanvas = null; let testContext = null; let testExtensions = null; + let features = null; class WebGL2Kernel extends WebGLKernel { @@ -16115,7 +16149,25 @@ class GPU { gpu: this, validate, onRequestFallback: (args) => { - const fallbackKernel = new CPUKernel(source, mergedSettings); + const fallbackKernel = new CPUKernel(source, { + graphical: kernel.graphical, + loopMaxIterations: kernel.loopMaxIterations, + constants: kernel.constants, + dynamicOutput: kernel.dynamicOutput, + dynamicArgument: kernel.dynamicArguments, + output: kernel.output, + precision: kernel.precision, + pipeline: kernel.pipeline, + immutable: kernel.immutable, + optimizeFloatMemory: kernel.optimizeFloatMemory, + fixIntegerDivisionAccuracy: kernel.fixIntegerDivisionAccuracy, + functions: kernel.functions, + nativeFunctions: kernel.nativeFunctions, + subKernels: kernel.subKernels, + strictIntegers: kernel.strictIntegers, + debug: kernel.debug, + warnVarUsage: kernel.warnVarUsage, + }); fallbackKernel.build.apply(fallbackKernel, args); const result = fallbackKernel.run.apply(fallbackKernel, args); kernel.replaceKernel(fallbackKernel); @@ -16138,7 +16190,10 @@ class GPU { } const newKernel = switchableKernels[signature] = new this.Kernel(source, { graphical: kernel.graphical, + loopMaxIterations: kernel.loopMaxIterations, constants: kernel.constants, + dynamicOutput: kernel.dynamicOutput, + dynamicArgument: kernel.dynamicArguments, context: kernel.context, canvas: kernel.canvas, output: kernel.output, @@ -16154,6 +16209,7 @@ class GPU { debug: kernel.debug, gpu: this, validate, + warnVarUsage: kernel.warnVarUsage, }); newKernel.build.apply(newKernel, args); newKernel.run.apply(newKernel, args); diff --git a/package.json b/package.json index 882866dc..fd4d20e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gpu.js", - "version": "2.0.0-rc.19", + "version": "2.0.0-rc.20", "description": "GPU Accelerated JavaScript", "engines": { "node": ">=10.0.0" diff --git a/src/backend/cpu/function-node.js b/src/backend/cpu/function-node.js index 72db578d..0f3c8acb 100644 --- a/src/backend/cpu/function-node.js +++ b/src/backend/cpu/function-node.js @@ -325,7 +325,7 @@ class CPUFunctionNode extends FunctionNode { * @returns {Array} the append retArr */ astVariableDeclaration(varDecNode, retArr) { - if (varDecNode.kind === 'var') { + if (varDecNode.kind === 'var' && this.warnVarUsage) { this.varWarn(); } retArr.push(`${varDecNode.kind} `); @@ -529,9 +529,9 @@ class CPUFunctionNode extends FunctionNode { if (isInput) { retArr.push('[('); this.astGeneric(zProperty, retArr); - retArr.push(`*${ size[1] * size[0]})+(`); + retArr.push(`*${ this.dynamicArguments ? '(outputY * outputX)' : size[1] * size[0] })+(`); this.astGeneric(yProperty, retArr); - retArr.push(`*${ size[0] })+`); + retArr.push(`*${ this.dynamicArguments ? 'outputX' : size[0] })+`); this.astGeneric(xProperty, retArr); retArr.push(']'); } else { @@ -549,7 +549,7 @@ class CPUFunctionNode extends FunctionNode { if (isInput) { retArr.push('[('); this.astGeneric(yProperty, retArr); - retArr.push(`*${ size[0] })+`); + retArr.push(`*${ this.dynamicArguments ? 'outputX' : size[0] })+`); this.astGeneric(xProperty, retArr); retArr.push(']'); } else { diff --git a/src/backend/function-builder.js b/src/backend/function-builder.js index 088cd04d..598f6916 100644 --- a/src/backend/function-builder.js +++ b/src/backend/function-builder.js @@ -6,7 +6,7 @@ class FunctionBuilder { /** * - * @param {typeof Kernel} kernel + * @param {Kernel} kernel * @param {FunctionNode} FunctionNode * @param {object} [extraNodeOptions] * @returns {FunctionBuilder} @@ -34,7 +34,9 @@ class FunctionBuilder { functions, leadingReturnStatement, followingReturnStatement, + dynamicArguments, dynamicOutput, + warnVarUsage, } = kernel; const needsArgumentType = (functionName, index) => { @@ -96,7 +98,8 @@ class FunctionBuilder { triggerImplyArgumentType, triggerTrackArgumentSynonym, lookupArgumentSynonym, - onFunctionCall + onFunctionCall, + warnVarUsage, })); nestedFunction.traceFunctionAST(ast); functionBuilder.addFunctionNode(nestedFunction); @@ -124,6 +127,7 @@ class FunctionBuilder { loopMaxIterations, output, plugins, + dynamicArguments, dynamicOutput, }, extraNodeOptions || {}); diff --git a/src/backend/function-node.js b/src/backend/function-node.js index c800b39e..a9816366 100644 --- a/src/backend/function-node.js +++ b/src/backend/function-node.js @@ -59,8 +59,10 @@ class FunctionNode { this.leadingReturnStatement = null; this.followingReturnStatement = null; this.dynamicOutput = null; + this.dynamicArguments = null; this.strictTypingChecking = false; this.fixIntegerDivisionAccuracy = null; + this.warnVarUsage = true; if (settings) { for (const p in settings) { diff --git a/src/backend/kernel.js b/src/backend/kernel.js index 3a218217..094529e5 100644 --- a/src/backend/kernel.js +++ b/src/backend/kernel.js @@ -16,6 +16,10 @@ class Kernel { throw new Error(`"isContextMatch" not implemented on ${ this.name }`); } + /** + * @type {IKernelFeatures} + * Used internally to populate the kernel.feature, which is a getter for the output of this value + */ static getFeatures() { throw new Error(`"getFeatures" not implemented on ${ this.name }`); } @@ -181,6 +185,7 @@ class Kernel { this.optimizeFloatMemory = null; this.strictIntegers = false; this.fixIntegerDivisionAccuracy = null; + this.warnVarUsage = true; } mergeSettings(settings) { @@ -486,6 +491,16 @@ class Kernel { return this; } + /** + * + * @param {Boolean} flag + * @return {Kernel} + */ + setWarnVarUsage(flag) { + this.warnVarUsage = flag; + return this; + } + /** * @deprecated * @returns {Object} diff --git a/src/backend/web-gl/function-node.js b/src/backend/web-gl/function-node.js index 44105ba8..4551076d 100644 --- a/src/backend/web-gl/function-node.js +++ b/src/backend/web-gl/function-node.js @@ -767,7 +767,7 @@ class WebGLFunctionNode extends FunctionNode { * @returns {Array} the append retArr */ astVariableDeclaration(varDecNode, retArr) { - if (varDecNode.kind === 'var') { + if (varDecNode.kind === 'var' && this.warnVarUsage) { this.varWarn(); } const declarations = varDecNode.declarations; diff --git a/src/backend/web-gl/kernel-value/dynamic-html-image.js b/src/backend/web-gl/kernel-value/dynamic-html-image.js index 34f7925e..e5653205 100644 --- a/src/backend/web-gl/kernel-value/dynamic-html-image.js +++ b/src/backend/web-gl/kernel-value/dynamic-html-image.js @@ -1,7 +1,7 @@ const { utils } = require('../../../utils'); const { WebGLKernelValueHTMLImage } = require('./html-image'); -class WebGLKernelValueDynamicInput extends WebGLKernelValueHTMLImage { +class WebGLKernelValueDynamicHTMLImage extends WebGLKernelValueHTMLImage { getSource() { return utils.linesToString([ `uniform sampler2D ${this.id}`, @@ -21,5 +21,5 @@ class WebGLKernelValueDynamicInput extends WebGLKernelValueHTMLImage { } module.exports = { - WebGLKernelValueDynamicInput + WebGLKernelValueDynamicHTMLImage }; \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/dynamic-number-texture.js b/src/backend/web-gl/kernel-value/dynamic-number-texture.js index a2d33556..246c47cc 100644 --- a/src/backend/web-gl/kernel-value/dynamic-number-texture.js +++ b/src/backend/web-gl/kernel-value/dynamic-number-texture.js @@ -11,8 +11,8 @@ class WebGLKernelValueDynamicNumberTexture extends WebGLKernelValueNumberTexture } updateValue(value) { - this.dimensions = inputTexture.dimensions; - this.textureSize = inputTexture.size; + this.dimensions = value.dimensions; + this.textureSize = value.size; this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); diff --git a/src/backend/web-gl/kernel-value/dynamic-single-input.js b/src/backend/web-gl/kernel-value/dynamic-single-input.js index fefcd7c7..1db18f17 100644 --- a/src/backend/web-gl/kernel-value/dynamic-single-input.js +++ b/src/backend/web-gl/kernel-value/dynamic-single-input.js @@ -13,7 +13,7 @@ class WebGLKernelValueDynamicSingleInput extends WebGLKernelValueSingleInput { updateValue(value) { this.dimensions = value.size; this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); - this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * (4 / this.bitRatio); + this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; this.uploadValue = new Float32Array(this.uploadArrayLength); this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); this.kernel.setUniform2iv(this.sizeId, this.textureSize); diff --git a/src/backend/web-gl2/kernel-value/dynamic-html-image.js b/src/backend/web-gl2/kernel-value/dynamic-html-image.js index dbcceaac..da5e6eed 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-html-image.js +++ b/src/backend/web-gl2/kernel-value/dynamic-html-image.js @@ -1,7 +1,7 @@ const { utils } = require('../../../utils'); -const { WebGLKernelValueDynamicInput } = require('../../web-gl/kernel-value/dynamic-html-image'); +const { WebGLKernelValueDynamicHTMLImage } = require('../../web-gl/kernel-value/dynamic-html-image'); -class WebGL2KernelValueDynamicInput extends WebGLKernelValueDynamicInput { +class WebGL2KernelValueDynamicHTMLImage extends WebGLKernelValueDynamicHTMLImage { getSource() { return utils.linesToString([ `uniform highp sampler2D ${this.id}`, @@ -12,5 +12,5 @@ class WebGL2KernelValueDynamicInput extends WebGLKernelValueDynamicInput { } module.exports = { - WebGL2KernelValueDynamicInput + WebGL2KernelValueDynamicHTMLImage }; \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/dynamic-single-array.js b/src/backend/web-gl2/kernel-value/dynamic-single-array.js index a5d25b78..30ef8afe 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-single-array.js +++ b/src/backend/web-gl2/kernel-value/dynamic-single-array.js @@ -1,7 +1,7 @@ const { utils } = require('../../../utils'); -const { WebGLKernelValueDynamicSingleArray } = require('../../web-gl/kernel-value/dynamic-single-array'); +const { WebGL2KernelValueSingleArray } = require('../../web-gl2/kernel-value/single-array'); -class WebGL2KernelValueDynamicSingleArray extends WebGLKernelValueDynamicSingleArray { +class WebGL2KernelValueDynamicSingleArray extends WebGL2KernelValueSingleArray { getSource() { return utils.linesToString([ `uniform highp sampler2D ${this.id}`, @@ -9,6 +9,16 @@ class WebGL2KernelValueDynamicSingleArray extends WebGLKernelValueDynamicSingleA `uniform highp ivec3 ${this.dimensionsId}`, ]); } + + updateValue(value) { + this.dimensions = utils.getDimensions(value, true); + this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); + this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.uploadValue = new Float32Array(this.uploadArrayLength); + this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); + this.kernel.setUniform2iv(this.sizeId, this.textureSize); + super.updateValue(value); + } } module.exports = { diff --git a/src/backend/web-gl2/kernel-value/dynamic-single-input.js b/src/backend/web-gl2/kernel-value/dynamic-single-input.js index 9c6d616e..5826d04d 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-single-input.js +++ b/src/backend/web-gl2/kernel-value/dynamic-single-input.js @@ -1,7 +1,7 @@ const { utils } = require('../../../utils'); -const { WebGLKernelValueDynamicSingleInput } = require('../../web-gl/kernel-value/dynamic-single-input'); +const { WebGL2KernelValueSingleInput } = require('../../web-gl2/kernel-value/single-input'); -class WebGL2KernelValueDynamicSingleInput extends WebGLKernelValueDynamicSingleInput { +class WebGL2KernelValueDynamicSingleInput extends WebGL2KernelValueSingleInput { getSource() { return utils.linesToString([ `uniform highp sampler2D ${this.id}`, @@ -9,6 +9,16 @@ class WebGL2KernelValueDynamicSingleInput extends WebGLKernelValueDynamicSingleI `uniform highp ivec3 ${this.dimensionsId}`, ]); } + + updateValue(value) { + this.dimensions = value.size; + this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); + this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.uploadValue = new Float32Array(this.uploadArrayLength); + this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); + this.kernel.setUniform2iv(this.sizeId, this.textureSize); + super.updateValue(value); + } } module.exports = { diff --git a/src/backend/web-gl2/kernel.js b/src/backend/web-gl2/kernel.js index c9419c3f..cd466994 100644 --- a/src/backend/web-gl2/kernel.js +++ b/src/backend/web-gl2/kernel.js @@ -10,14 +10,10 @@ let isSupported = null; let testCanvas = null; let testContext = null; let testExtensions = null; + /** * - * @type {{ - * isFloatRead: Boolean, - * isIntegerDivisionAccurate: Boolean, - * kernelMap: Boolean, - * isTextureFloat: Boolean, - * }|null} + * @type {IKernelFeatures} */ let features = null; diff --git a/src/gpu.js b/src/gpu.js index 3bf4aab7..f9150a09 100644 --- a/src/gpu.js +++ b/src/gpu.js @@ -223,7 +223,25 @@ class GPU { gpu: this, validate, onRequestFallback: (args) => { - const fallbackKernel = new CPUKernel(source, mergedSettings); + const fallbackKernel = new CPUKernel(source, { + graphical: kernel.graphical, + loopMaxIterations: kernel.loopMaxIterations, + constants: kernel.constants, + dynamicOutput: kernel.dynamicOutput, + dynamicArgument: kernel.dynamicArguments, + output: kernel.output, + precision: kernel.precision, + pipeline: kernel.pipeline, + immutable: kernel.immutable, + optimizeFloatMemory: kernel.optimizeFloatMemory, + fixIntegerDivisionAccuracy: kernel.fixIntegerDivisionAccuracy, + functions: kernel.functions, + nativeFunctions: kernel.nativeFunctions, + subKernels: kernel.subKernels, + strictIntegers: kernel.strictIntegers, + debug: kernel.debug, + warnVarUsage: kernel.warnVarUsage, + }); fallbackKernel.build.apply(fallbackKernel, args); const result = fallbackKernel.run.apply(fallbackKernel, args); kernel.replaceKernel(fallbackKernel); @@ -246,7 +264,10 @@ class GPU { } const newKernel = switchableKernels[signature] = new this.Kernel(source, { graphical: kernel.graphical, + loopMaxIterations: kernel.loopMaxIterations, constants: kernel.constants, + dynamicOutput: kernel.dynamicOutput, + dynamicArgument: kernel.dynamicArguments, context: kernel.context, canvas: kernel.canvas, output: kernel.output, @@ -262,6 +283,7 @@ class GPU { debug: kernel.debug, gpu: this, validate, + warnVarUsage: kernel.warnVarUsage, }); newKernel.build.apply(newKernel, args); newKernel.run.apply(newKernel, args); diff --git a/src/index.d.ts b/src/index.d.ts index 61bd43b7..ef62b30f 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -83,6 +83,7 @@ export abstract class Kernel { static nativeFunctionReturnType(source: string): string; static destroyContext(context: any): void; static features: IKernelFeatures; + static getFeatures(): IKernelFeatures; source: string | object; Kernel: Kernel; output: number[]; @@ -169,6 +170,7 @@ export abstract class Kernel { ): string; toJSON(): object; setOutput(flag: number[]): this; + setWarnVarUsage(flag: boolean): this; setOptimizeFloatMemory(flag: boolean): this; setArgumentTypes(flag: any): this; setDebug(flag: boolean): this; @@ -197,10 +199,10 @@ export class GLKernel extends Kernel { export class WebGLKernel extends GLKernel { } -export class WebGL2Kernel extends GLKernel { +export class WebGL2Kernel extends WebGLKernel { } -export class HeadlessGLKernel extends GLKernel { +export class HeadlessGLKernel extends WebGLKernel { } diff --git a/test/all.html b/test/all.html index f0505aab..55f4c454 100644 --- a/test/all.html +++ b/test/all.html @@ -159,6 +159,7 @@ + @@ -273,5 +274,6 @@ + diff --git a/test/features/constants-image-array.js b/test/features/constants-image-array.js index efd533cc..f286916b 100644 --- a/test/features/constants-image-array.js +++ b/test/features/constants-image-array.js @@ -34,7 +34,7 @@ function feature(mode, done) { gpu.createKernel(fn, settings)(); } - image.src = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJ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l+V/5/WpFl/hb5W/Q/Q1D8hj1h2f6v/vlun/1qrta7N7W/7p2Uh7duEf6H+E+4/EVcBp/3/lao5mjSLsc9pVxPdR3vk/K0bMGsmwAO3GehOCeuOfrWnDLFcbJFVliZTjdwUx1Xg5GPQ+/pWbqGns2oytC7xy7VeOTqVIHIyTypGePUdQcUmm3Uj3UsckTLKu57iPkkdBuHqcncD1IK9xW00pJzidkoKcXKHT8P815/f3NO5gk8t9v71dvCt1UnsD3z1H/165d7iNXZcKMHGGBz+NdbA2/zVb+HCv8ATkg/1+lYE5fz5N1pEzbjklevNVh52umRSV2y+Gpd1QrThWnKeeS5pM0ykNTYCTdSbqjpafKBJmlBqOlFKwEwNOBqEVIKmwEympAN/wArVCtSCs2UhwLRf7UX5lf8RVlTUK0ltwJVHRTwPTgGoaNER3yr5luzfKrN5b+2eVP/AH0B+dZ0nlJrtr527zZEeEMvthlP5bgfcVpX6hrJlIyPMTj/AIEKxNTZm1OzBJI+XjPq65rSlHm09TqoPX1Vvv2/EtCT+ytZSOT5re4XyQ3XZjkZz2+bH+cVbksJGldlkwCxIFV9SUSW8e4Z4iP6mr8Mj+TH87fdHf2pSm4pS6m0G9Gt+p//2Q=='; + image.src = 'jellyfish-1.jpeg'; image.onload = () => { settings[0] = image.width; settings[1] = image.height; diff --git a/test/features/constants-image.js b/test/features/constants-image.js index f270bbbb..ae70389c 100644 --- a/test/features/constants-image.js +++ b/test/features/constants-image.js @@ -5,7 +5,7 @@ describe('features: constants image'); function imageConstantTest(mode, done) { const gpu = new GPU({ mode }); const image = new Image(); - image.src = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy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ao5mjSLsc9pVxPdR3vk/K0bMGsmwAO3GehOCeuOfrWnDLFcbJFVliZTjdwUx1Xg5GPQ+/pWbqGns2oytC7xy7VeOTqVIHIyTypGePUdQcUmm3Uj3UsckTLKu57iPkkdBuHqcncD1IK9xW00pJzidkoKcXKHT8P815/f3NO5gk8t9v71dvCt1UnsD3z1H/165d7iNXZcKMHGGBz+NdbA2/zVb+HCv8ATkg/1+lYE5fz5N1pEzbjklevNVh52umRSV2y+Gpd1QrThWnKeeS5pM0ykNTYCTdSbqjpafKBJmlBqOlFKwEwNOBqEVIKmwEympAN/wArVCtSCs2UhwLRf7UX5lf8RVlTUK0ltwJVHRTwPTgGoaNER3yr5luzfKrN5b+2eVP/AH0B+dZ0nlJrtr527zZEeEMvthlP5bgfcVpX6hrJlIyPMTj/AIEKxNTZm1OzBJI+XjPq65rSlHm09TqoPX1Vvv2/EtCT+ytZSOT5re4XyQ3XZjkZz2+bH+cVbksJGldlkwCxIFV9SUSW8e4Z4iP6mr8Mj+TH87fdHf2pSm4pS6m0G9Gt+p//2Q=='; + image.src = 'jellyfish-1.jpeg'; image.onload = function() { const width = image.width; const height = image.height; diff --git a/test/features/dynamic-arguments.js b/test/features/dynamic-arguments.js new file mode 100644 index 00000000..afe1555f --- /dev/null +++ b/test/features/dynamic-arguments.js @@ -0,0 +1,602 @@ +const { assert, skip, test, module: describe, only } = require('qunit'); +const { GPU, input } = require('../../src'); + +describe('features: dynamic arguments'); + +function testHTMLImage(done, mode) { + const image1 = new Image(); + const image2 = new Image(); + image1.src = 'jellyfish.jpeg'; + image2.src = 'jellyfish-1.jpeg'; + let loadedCount = 0; + image1.onload = image2.onload = () => { + loadedCount++; + if (loadedCount === 2) loaded(); + }; + + function loaded() { + const gpu = new GPU({ mode }); + const kernel = gpu.createKernel(function(image) { + const pixel = image[this.thread.y][this.thread.x]; + return (pixel[0] + pixel[1] + pixel[2]) / 3; + }) + .setDynamicArguments(true) + .setDynamicOutput(true) + .setOutput([276, 183]); + + const pixels1 = kernel(image1); + kernel.setOutput([138, 91]); + const pixels2 = kernel(image2); + + assert.ok(pixels1[0][0] > .43); + assert.ok(pixels1[0][0] < .45); + assert.equal(pixels1.length, image1.height); + assert.equal(pixels1[0].length, image1.width); + assert.ok(pixels2[0][0] > .82); + assert.ok(pixels2[0][0] < .83); + assert.equal(pixels2.length, image2.height); + assert.equal(pixels2[0].length, image2.width); + + gpu.destroy(); + done(); + } +} + +(typeof Image !== 'undefined' ? test : skip)('HTML Image auto', t => { + testHTMLImage(t.async()); +}); + +(typeof Image !== 'undefined' && GPU.isWebGLSupported ? test : skip)('HTML Image webgl', t => { + testHTMLImage(t.async(), 'webgl'); +}); + +(typeof Image !== 'undefined' && GPU.isWebGL2Supported ? test : skip)('HTML Image webgl2', t => { + testHTMLImage(t.async(), 'webgl2'); +}); + +(typeof Image !== 'undefined' ? test : skip)('HTML Image cpu', t => { + testHTMLImage(t.async(), 'cpu'); +}); + +function testMemoryOptimizedNumberTexture(mode) { + const gpu = new GPU({ mode }); + const matrix4X4 = [ + [1,2,3,4], + [5,6,7,8], + [9,10,11,12], + [13,14,15,16], + ]; + const texture4X4 = ( + gpu.createKernel(function(value) { + return value[this.thread.y][this.thread.x]; + }) + .setOutput([4, 4]) + .setPrecision('single') + .setOptimizeFloatMemory(true) + .setPipeline(true) + )(matrix4X4); + + const matrix3X3 = [ + [1,2,3], + [4,5,6], + [7,8,9] + ]; + const texture3X3 = ( + gpu.createKernel(function(value) { + return value[this.thread.y][this.thread.x]; + }) + .setOutput([3, 3]) + .setPrecision('single') + .setOptimizeFloatMemory(true) + .setPipeline(true) + )(matrix3X3); + + const matrix2X2 = [ + [1,2], + [3,4] + ]; + const texture2X2 = ( + gpu.createKernel(function(value) { + return value[this.thread.y][this.thread.x]; + }) + .setOutput([2, 2]) + .setPrecision('single') + .setOptimizeFloatMemory(true) + .setPipeline(true) + )(matrix2X2); + + const kernel = gpu.createKernel(function(texture) { + return texture[this.thread.y][this.thread.x]; + }) + .setDynamicArguments(true) + .setDynamicOutput(true) + .setOutput([4,4]); + + assert.deepEqual(kernel(texture4X4), [ + new Float32Array([1,2,3,4]), + new Float32Array([5,6,7,8]), + new Float32Array([9,10,11,12]), + new Float32Array([13,14,15,16]), + ]); + + kernel.setOutput([3, 3]); + assert.deepEqual(kernel(texture3X3), [ + new Float32Array([1,2,3]), + new Float32Array([4,5,6]), + new Float32Array([7,8,9]), + ]); + + kernel.setOutput([2, 2]); + assert.deepEqual(kernel(texture2X2), [ + new Float32Array([1,2]), + new Float32Array([3,4]), + ]); + + assert.ok(kernel.kernelArguments[0].constructor.name.match('DynamicMemoryOptimizedNumberTexture')); + + gpu.destroy(); +} + +(GPU.isSinglePrecisionSupported ? test : skip)('MemoryOptimizedNumberTexture (GPU only) auto', () => { + testMemoryOptimizedNumberTexture(); +}); + +(GPU.isSinglePrecisionSupported ? test : skip)('MemoryOptimizedNumberTexture (GPU only) gpu', () => { + testMemoryOptimizedNumberTexture('gpu'); +}); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('MemoryOptimizedNumberTexture (GPU only) webgl', () => { + testMemoryOptimizedNumberTexture('webgl'); +}); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('MemoryOptimizedNumberTexture (GPU only) webgl2', () => { + testMemoryOptimizedNumberTexture('webgl2'); +}); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('MemoryOptimizedNumberTexture (GPU only) headlessgl', () => { + testMemoryOptimizedNumberTexture('headlessgl'); +}); + +function testNumberTexture(mode) { + const gpu = new GPU({ mode }); + const matrix4X4 = [ + [1,2,3,4], + [5,6,7,8], + [9,10,11,12], + [13,14,15,16], + ]; + const texture4X4 = ( + gpu.createKernel(function(value) { + return value[this.thread.y][this.thread.x]; + }) + .setOutput([4, 4]) + .setPrecision('single') + .setOptimizeFloatMemory(true) + .setPipeline(true) + )(matrix4X4); + + const matrix3X3 = [ + [1,2,3], + [4,5,6], + [7,8,9] + ]; + const texture3X3 = ( + gpu.createKernel(function(value) { + return value[this.thread.y][this.thread.x]; + }) + .setOutput([3, 3]) + .setPrecision('single') + .setOptimizeFloatMemory(true) + .setPipeline(true) + )(matrix3X3); + + const matrix2X2 = [ + [1,2], + [3,4] + ]; + const texture2X2 = ( + gpu.createKernel(function(value) { + return value[this.thread.y][this.thread.x]; + }) + .setOutput([2, 2]) + .setPrecision('single') + .setPipeline(true) + )(matrix2X2); + + const kernel = gpu.createKernel(function(texture) { + return texture[this.thread.y][this.thread.x]; + }) + .setDynamicArguments(true) + .setDynamicOutput(true) + .setOutput([4,4]); + + assert.deepEqual(kernel(texture4X4), [ + new Float32Array([1,2,3,4]), + new Float32Array([5,6,7,8]), + new Float32Array([9,10,11,12]), + new Float32Array([13,14,15,16]), + ]); + + kernel.setOutput([3, 3]); + assert.deepEqual(kernel(texture3X3), [ + new Float32Array([1,2,3]), + new Float32Array([4,5,6]), + new Float32Array([7,8,9]), + ]); + + kernel.setOutput([2, 2]); + assert.deepEqual(kernel(texture2X2), [ + new Float32Array([1,2]), + new Float32Array([3,4]), + ]); + + assert.ok(kernel.kernelArguments[0].constructor.name.match('NumberTexture')); + + gpu.destroy(); +} + +(GPU.isSinglePrecisionSupported ? test : skip)('NumberTexture (GPU only) auto', () => { + testNumberTexture(); +}); + +(GPU.isSinglePrecisionSupported ? test : skip)('NumberTexture (GPU only) gpu', () => { + testNumberTexture('gpu'); +}); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('NumberTexture (GPU only) webgl', () => { + testNumberTexture('webgl'); +}); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('NumberTexture (GPU only) webgl2', () => { + testNumberTexture('webgl2'); +}); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('NumberTexture (GPU only) headlessgl', () => { + testNumberTexture('headlessgl'); +}); + +function testUnsignedPrecisionArray(mode) { + const gpu = new GPU({ mode }); + const kernel = gpu.createKernel(function(input) { + return input[this.thread.x]; + }) + .setPrecision('unsigned') + .setDynamicArguments(true) + .setDynamicOutput(true) + .setOutput([5]); + + assert.deepEqual(kernel([1,2,3,4,5]), new Float32Array([1,2,3,4,5])); + kernel.setOutput([4]); + assert.deepEqual(kernel([1,2,3,4]), new Float32Array([1,2,3,4])); + kernel.setOutput([3]); + assert.deepEqual(kernel([1,2,3]), new Float32Array([1,2,3])); + kernel.setOutput([2]); + assert.deepEqual(kernel([1,2]), new Float32Array([1,2])); + gpu.destroy(); +} + +test('unsigned precision Array auto', () => { + testUnsignedPrecisionArray(); +}); + +test('unsigned precision Array gpu', () => { + testUnsignedPrecisionArray('gpu'); +}); + +(GPU.isWebGLSupported ? test : skip)('unsigned precision Array webgl', () => { + testUnsignedPrecisionArray('webgl'); +}); + +(GPU.isWebGL2Supported ? test : skip)('unsigned precision Array webgl2', () => { + testUnsignedPrecisionArray('webgl2'); +}); + +(GPU.isHeadlessGLSupported ? test : skip)('unsigned precision Array headlessgl', () => { + testUnsignedPrecisionArray('headlessgl'); +}); + +test('unsigned precision Array cpu', () => { + testUnsignedPrecisionArray('cpu'); +}); + +function testSinglePrecisionArray(mode) { + const gpu = new GPU({ mode }); + const kernel = gpu.createKernel(function(input) { + return input[this.thread.x]; + }) + .setPrecision('single') + .setDynamicArguments(true) + .setDynamicOutput(true) + .setOutput([5]); + + assert.deepEqual(kernel([1,2,3,4,5]), new Float32Array([1,2,3,4,5])); + kernel.setOutput([4]); + assert.deepEqual(kernel([1,2,3,4]), new Float32Array([1,2,3,4])); + kernel.setOutput([3]); + assert.deepEqual(kernel([1,2,3]), new Float32Array([1,2,3])); + kernel.setOutput([2]); + assert.deepEqual(kernel([1,2]), new Float32Array([1,2])); + gpu.destroy(); +} + +(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array auto', () => { + testSinglePrecisionArray(); +}); + +(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array gpu', () => { + testSinglePrecisionArray('gpu'); +}); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision Array webgl', () => { + testSinglePrecisionArray('webgl'); +}); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision Array webgl2', () => { + testSinglePrecisionArray('webgl2'); +}); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision Array headlessgl', () => { + testSinglePrecisionArray('headlessgl'); +}); + +test('single precision Array cpu', () => { + testSinglePrecisionArray('cpu'); +}); + +function testUnsignedPrecisionMatrix(mode) { + const gpu = new GPU({ mode }); + const kernel = gpu.createKernel(function(input) { + return input[this.thread.y][this.thread.x]; + }) + .setPrecision('unsigned') + .setDynamicArguments(true) + .setDynamicOutput(true) + .setOutput([4,4]); + + let matrix = [ + [1,2,3,4], + [5,6,7,8], + [9,10,11,12], + [13,14,15,16] + ]; + assert.deepEqual(kernel(matrix), matrix.map(row => new Float32Array(row))); + + kernel.setOutput([3,3]); + matrix = [ + [1,2,3], + [4,5,6], + [7,8,9] + ]; + assert.deepEqual(kernel(matrix), matrix.map(row => new Float32Array(row))); + + kernel.setOutput([2,2]); + matrix = [ + [1,2], + [3,4] + ]; + assert.deepEqual(kernel(matrix), matrix.map(row => new Float32Array(row))); + gpu.destroy(); +} + +test('unsigned precision Matrix auto', () => { + testUnsignedPrecisionMatrix(); +}); + +test('unsigned precision Matrix gpu', () => { + testUnsignedPrecisionMatrix('gpu'); +}); + +(GPU.isWebGLSupported ? test : skip)('unsigned precision Matrix webgl', () => { + testUnsignedPrecisionMatrix('webgl'); +}); + +(GPU.isWebGL2Supported ? test : skip)('unsigned precision Matrix webgl2', () => { + testUnsignedPrecisionMatrix('webgl2'); +}); + +(GPU.isHeadlessGLSupported ? test : skip)('unsigned precision Matrix headlessgl', () => { + testUnsignedPrecisionMatrix('headlessgl'); +}); + +test('unsigned precision Matrix cpu', () => { + testUnsignedPrecisionMatrix('cpu'); +}); + +function testSinglePrecisionMatrix(mode) { + const gpu = new GPU({ mode }); + const kernel = gpu.createKernel(function(input) { + return input[this.thread.y][this.thread.x]; + }) + .setDynamicArguments(true) + .setDynamicOutput(true) + .setOutput([4,4]); + + let matrix = [ + [1,2,3,4], + [5,6,7,8], + [9,10,11,12], + [13,14,15,16] + ]; + assert.deepEqual(kernel(matrix), matrix.map(row => new Float32Array(row))); + + kernel.setOutput([3,3]); + matrix = [ + [1,2,3], + [4,5,6], + [7,8,9] + ]; + assert.deepEqual(kernel(matrix), matrix.map(row => new Float32Array(row))); + + kernel.setOutput([2,2]); + matrix = [ + [1,2], + [3,4] + ]; + assert.deepEqual(kernel(matrix), matrix.map(row => new Float32Array(row))); + gpu.destroy(); +} + +(GPU.isSinglePrecisionSupported ? test : skip)('single precision Matrix auto', () => { + testSinglePrecisionMatrix(); +}); + +(GPU.isSinglePrecisionSupported ? test : skip)('single precision Matrix gpu', () => { + testSinglePrecisionMatrix('gpu'); +}); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision Matrix webgl', () => { + testSinglePrecisionMatrix('webgl'); +}); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision Matrix webgl2', () => { + testSinglePrecisionMatrix('webgl2'); +}); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision Matrix headlessgl', () => { + testSinglePrecisionMatrix('headlessgl'); +}); + +test('single precision Matrix cpu', () => { + testSinglePrecisionMatrix('cpu'); +}); + +function testUnsignedPrecisionInputMatrix(mode) { + const gpu = new GPU({ mode }); + const kernel = gpu.createKernel(function(input) { + return input[this.thread.y][this.thread.x]; + }) + .setPrecision('unsigned') + .setDynamicArguments(true) + .setDynamicOutput(true) + .setOutput([4,4]); + + let matrix = input([ + 1,2,3,4, + 5,6,7,8, + 9,10,11,12, + 13,14,15,16 + ], [4, 4]); + assert.deepEqual(kernel(matrix), [ + new Float32Array([1,2,3,4]), + new Float32Array([5,6,7,8]), + new Float32Array([9,10,11,12]), + new Float32Array([13,14,15,16]), + ]); + + kernel.setOutput([3,3]); + matrix = input([ + 1,2,3, + 4,5,6, + 7,8,9 + ], [3,3]); + assert.deepEqual(kernel(matrix), [ + new Float32Array([1,2,3]), + new Float32Array([4,5,6]), + new Float32Array([7,8,9]) + ]); + + kernel.setOutput([2,2]); + matrix = input([ + 1,2, + 3,4 + ], [2,2]); + assert.deepEqual(kernel(matrix), [ + new Float32Array([1,2]), + new Float32Array([3,4]) + ]); + gpu.destroy(); +} + +test('unsigned precision Input Matrix auto', () => { + testUnsignedPrecisionInputMatrix(); +}); + +test('unsigned precision Input Matrix gpu', () => { + testUnsignedPrecisionInputMatrix('gpu'); +}); + +(GPU.isWebGLSupported ? test : skip)('unsigned precision Input Matrix webgl', () => { + testUnsignedPrecisionInputMatrix('webgl'); +}); + +(GPU.isWebGL2Supported ? test : skip)('unsigned precision Input Matrix webgl2', () => { + testUnsignedPrecisionInputMatrix('webgl2'); +}); + +(GPU.isHeadlessGLSupported ? test : skip)('unsigned precision Input Matrix headlessgl', () => { + testUnsignedPrecisionInputMatrix('headlessgl'); +}); + +test('unsigned precision Input Matrix cpu', () => { + testUnsignedPrecisionInputMatrix('cpu'); +}); + +function testSinglePrecisionInputMatrix(mode) { + const gpu = new GPU({ mode }); + const kernel = gpu.createKernel(function(input) { + return input[this.thread.y][this.thread.x]; + }) + .setDynamicArguments(true) + .setDynamicOutput(true) + .setOutput([4,4]); + + let matrix = input([ + 1,2,3,4, + 5,6,7,8, + 9,10,11,12, + 13,14,15,16 + ], [4, 4]); + assert.deepEqual(kernel(matrix), [ + new Float32Array([1,2,3,4]), + new Float32Array([5,6,7,8]), + new Float32Array([9,10,11,12]), + new Float32Array([13,14,15,16]) + ]); + + kernel.setOutput([3,3]); + matrix = input([ + 1,2,3, + 4,5,6, + 7,8,9 + ], [3, 3]); + assert.deepEqual(kernel(matrix), [ + new Float32Array([1,2,3]), + new Float32Array([4,5,6]), + new Float32Array([7,8,9]) + ]); + + kernel.setOutput([2,2]); + matrix = input([ + 1,2, + 3,4 + ], [2,2]); + assert.deepEqual(kernel(matrix), [ + new Float32Array([1,2]), + new Float32Array([3,4]) + ]); + gpu.destroy(); +} + +(GPU.isSinglePrecisionSupported ? test : skip)('single precision Input Matrix auto', () => { + testSinglePrecisionInputMatrix(); +}); + +(GPU.isSinglePrecisionSupported ? test : skip)('single precision Input Matrix gpu', () => { + testSinglePrecisionInputMatrix('gpu'); +}); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision Input Matrix webgl', () => { + testSinglePrecisionInputMatrix('webgl'); +}); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision Input Matrix webgl2', () => { + testSinglePrecisionInputMatrix('webgl2'); +}); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision Input Matrix headlessgl', () => { + testSinglePrecisionInputMatrix('headlessgl'); +}); + +test('single precision Input Matrix cpu', () => { + testSinglePrecisionInputMatrix('cpu'); +}); diff --git a/test/features/to-string/precision/single/arguments/html-image-array.js b/test/features/to-string/precision/single/arguments/html-image-array.js index eb042da3..29197d9b 100644 --- a/test/features/to-string/precision/single/arguments/html-image-array.js +++ b/test/features/to-string/precision/single/arguments/html-image-array.js @@ -5,10 +5,10 @@ describe('feature: to-string single precision arguments HTMLImageArray'); function testArgument(mode, done) { const imageSources = [ - 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABbAIoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUF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fish-4.jpeg', ]; let loaded = 0; const images = imageSources.map(imageSource => { diff --git a/test/features/to-string/precision/single/arguments/html-image.js b/test/features/to-string/precision/single/arguments/html-image.js index e6801a0f..07d77c65 100644 --- a/test/features/to-string/precision/single/arguments/html-image.js +++ b/test/features/to-string/precision/single/arguments/html-image.js @@ -5,7 +5,7 @@ describe('feature: to-string single precision arguments HTMLImage'); function testArgument(mode, done) { const image = new Image(); - image.src = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxAQEhUPDxIVFRUVFRAPEBUVFRUPFRAVFRUWFhUVFRUYHSggGBolHRUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OFxAQGi0lHSUtLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0vLf/AABEIALcBFAMBEQACEQEDEQH/xAAbAAADAQEBAQEAAAAAAAAAAAABAgMABAUGB//EADgQAAIBAgMGBAQFAwUBAQAAAAECAAMREiExBBNBUWFxBSKBkTKhsdEGQsHh8FJikhQjM3LxwhX/xAAbAQEBAQEBAQEBAAAAAAAAAAABAAIDBAUGB//EADMRAAICAQIDBQgCAgIDAAAAAAABAhEDEiEEMUETUWFx8AUiMoGRobHB0eFS8RSSI0Jy/9oADAMBAAIRAxEAPwD7A0e49L/SfoNR4VIIBH/v3hsWw/cW66fz3gVdwFNsjpwOnpaXMXG9yuGZs5gKxshSsbABFo2Iva8hoPofr9JBQUscvlofaDJpo66NK85SlQFTs8xrEi9O02pWQVWTYlLTIjXgRWnMMh2EEwJkRIXDNWQSICKRGyEImiBaRCmJAiQZEYmVEa8KIN5EMIEM0EDFMQEiRzUwx6Hrn9p0bR0kkihpnjb0y+szqRnYG7I0+n2ylY7C7m/62sfcR1UKdEzs51B72v8ANSZrWa196Dh55dRl9ZX3Bt0CVtxJ73B/eVmH5FFpjUWmbM2w4JWQcELIxpA6/wA7SskXotbI+h5/vOclZFXqTKiRK15vkQ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OHhQhxwohleFEUDzNCMHhRDCpChHFSZ0kOtSDRFA8zQjY4aSDvIURhUlpI28lpIG8jRANSVEKak1REy8aImzzSQCF5qgJs81QCF5qgBjlRC440QccqEIeFCbHKiBjlRALxoAF40DENSNAzgV53ozY4eFDYccKKwh5URRXmWhGDwoRscKEYPCiGDwohscKEYVIUQ4qTNEOtSFCUFSZoh95DSJt5DSRscqI2OWkgF40QDUlpIU1JqgENSOkhDUjpAm1SaSImXmkgELzVALjjRGxyorNjlRBDwoTY5URscqIBeNEKXjRliF40ZPPV56GjnY4eFGrGxwobCHhRWUDwo0MKkzQ2MHhRWMHhQ2OHhQhxwohhUhpIYVIUI6vCiKCpM0I28hpIO8lpIOOFEbHKiAakqEU1JqgFNSNEIakaIQ1IpAxC81QCF5qgELxoBccaCwY5URscqKw45UIccKE2OVFYC8aARnikZbELzVGbPNWrPS4nmUygqTNG9QwqQoVIYVJmjVlA8KN2EVIUVjCpCjSY4qQoUxhUhpGxscKKwipChsYPCiscVIUI4qTNCMKkNI2NvJaSMKkKIO8lpKxTUjpIU1I6SAXjRWIXjRkUvGiENSKRmyZeaSBsU1JqgsXeSozYN5GiswqSokw7yFDYccqGzbyVE2KakaByEapFIw5EzVmtJyctzzw09NHnGxwobGDw0jqGFSZ0mtQ4qzOk0sg+8hRvUMKkKNKTHFSGk1qGFSGk0mMKkKGxhUhQ2MHhQ2OHmaGxhUlpGwipCiDvIUVh3ktI2HeS0kDeSorFNSNFYDUlQWI1Sa0g2IakdJlsQ1JqjLkI1SNGHIQ1I0ZchTUmtJlzFNSWkNZhVlpHWOKkKN6jbyVEpGNSWknMQ1I6Tm5iNUmlE5ynYhea0mLP/Z'; + image.src = 'jellyfish.jpeg'; image.onload = () => { const gpu = new GPU({mode}); const originalKernel = gpu.createKernel(function (a) { diff --git a/test/features/to-string/precision/single/constants/html-image-array.js b/test/features/to-string/precision/single/constants/html-image-array.js index 58ce938f..706acd90 100644 --- a/test/features/to-string/precision/single/constants/html-image-array.js +++ b/test/features/to-string/precision/single/constants/html-image-array.js @@ -5,10 +5,10 @@ describe('feature: to-string single precision constants HTMLImageArray'); function testArgument(mode, done) { const imageSources = [ - 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABbAIoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDtjB/vL/wHP8qUBk//AGv8anjEr/7L/wC1z/hUhib+Lb/wHj+dfQOfc893WjK/+8u3/a6f5/OkU7Plb7nZun4Yqx5TJ93/ANB/w4pvkb/67cH8xS5kNW6htpCtRm2b7yv9du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YapQIuavmUhkqt5lMMtZchsWjJ70wye9VjJTTJVqAiwZPeo2k96rmSmGSqUBMnZ6jL1C0nFMMlaKBLZMXpu+oC9NL8VagS2WfMo8yqvmUoejkFct+ZRvqrvo8yjkKuWt9NL1X300yUKAXJzJTfMqu0nNM8z3q1AycjTMlNMnvVfJ9aTJ9ajlRvcn8zmkMlV8nPWkJPrT5RNkxkphlqBic9aYSfWrUCHImMlMMlQkn1qNic9atRRm5k5k96aZarkn1ppJ9atQM3ULHm0ol96pkn1pyk+tHIJVC4JPel82quTjrRk0uVFqZZMtMMtQEn1qMk+tNQIlUJ2lpnmmoCTnrTc1ooHPKo2z/9k=' + 'jellyfish-1.jpeg', + 'jellyfish-2.jpeg', + 'jellyfish-3.jpeg', + 'jellyfish-4.jpeg', ]; let loaded = 0; const images = imageSources.map(imageSource => { diff --git a/test/features/to-string/precision/single/constants/html-image.js b/test/features/to-string/precision/single/constants/html-image.js index 5d1f9384..8c14334b 100644 --- a/test/features/to-string/precision/single/constants/html-image.js +++ b/test/features/to-string/precision/single/constants/html-image.js @@ -5,7 +5,7 @@ describe('feature: to-string single precision constants HTMLImage'); function testArgument(mode, done) { const image = new Image(); - image.src = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxAQEhUPDxIVFRUVFRAPEBUVFRUPFRAVFRUWFhUVFRUYHSggGBolHRUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OFxAQGi0lHSUtLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0vLf/AABEIALcBFAMBEQACEQEDEQH/xAAbAAADAQEBAQEAAAAAAAAAAAABAgMABAUGB//EADgQAAIBAgMGBAQFAwUBAQAAAAECAAMREiExBBNBUWFxBSKBkTKhsdEGQsHh8FJikhQjM3LxwhX/xAAbAQEBAQEBAQEBAAAAAAAAAAABAAIDBAUGB//EADMRAAICAQIDBQgCAgIDAAAAAAABAhEDEi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w09NHnGxwobGDw0jqGFSZ0mtQ4qzOk0sg+8hRvUMKkKNKTHFSGk1qGFSGk0mMKkKGxhUhQ2MHhQ2OHmaGxhUlpGwipCiDvIUVh3ktI2HeS0kDeSorFNSNFYDUlQWI1Sa0g2IakdJlsQ1JqjLkI1SNGHIQ1I0ZchTUmtJlzFNSWkNZhVlpHWOKkKN6jbyVEpGNSWknMQ1I6Tm5iNUmlE5ynYhea0mLP/Z'; + image.src = 'jellyfish.jpeg'; image.onload = () => { const gpu = new GPU({mode}); const originalKernel = gpu.createKernel(function (a) { diff --git a/test/features/to-string/precision/unsigned/arguments/html-image-array.js b/test/features/to-string/precision/unsigned/arguments/html-image-array.js index 4d2cc398..8085a695 100644 --- a/test/features/to-string/precision/unsigned/arguments/html-image-array.js +++ b/test/features/to-string/precision/unsigned/arguments/html-image-array.js @@ -5,10 +5,10 @@ describe('feature: to-string unsigned precision arguments HTMLImageArray'); function testArgument(mode, done) { const imageSources = [ - 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABbAIoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QA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NL71A8laRpnK2Pkkquz80xpOetQu9dEYENkxems/FV95z1prSVooE3J99OD1TMlKH96fIFy5vpN9VvMo3+9HIO5OXpPMquZKb5lNQFctb6TeKreZRv8AenyBc6EyZxxjHpSGQVR873pDL71yezNLlxpKheWq5l96ieWrjTE2TtL71C0tQNLULS1tGmS2TtJUTSe9QNLURkraMCWyw0mKYZarmSmb6tQFcsmSgSVVL+9AkquQLlvzKXzKqiSl8z3pcg7lgyc0hkqsXpN9CgJss+ZR5nvVUyUnmGq5BGuZuOtJ5x9ap+ZSebWKpl3LZlPrTGl96rGT3phk96pQAnaWojJzUReomf3rRQE2TNJUZkqJpKiaStFAlk5kppfiq5kpDJV8gix5lAeq2+jzKfIBbD8UGSq3mcUnmUuQZZ8yk8yq++ml+aagBYL0nmVWaSm+YapQIuavmUhkqt5lMMtZchsWjJ70wye9VjJTTJVqAiwZPeo2k96rmSmGSqUBMnZ6jL1C0nFMMlaKBLZMXpu+oC9NL8VagS2WfMo8yqvmUoejkFct+ZRvqrvo8yjkKuWt9NL1X300yUKAXJzJTfMqu0nNM8z3q1AycjTMlNMnvVfJ9aTJ9ajlRvcn8zmkMlV8nPWkJPrT5RNkxkphlqBic9aYSfWrUCHImMlMMlQkn1qNic9atRRm5k5k96aZarkn1ppJ9atQM3ULHm0ol96pkn1pyk+tHIJVC4JPel82quTjrRk0uVFqZZMtMMtQEn1qMk+tNQIlUJ2lpnmmoCTnrTc1ooHPKo2z/9k=' + 'jellyfish-1.jpeg', + 'jellyfish-2.jpeg', + 'jellyfish-3.jpeg', + 'jellyfish-4.jpeg', ]; let loaded = 0; const images = imageSources.map(imageSource => { diff --git a/test/features/to-string/precision/unsigned/arguments/html-image.js b/test/features/to-string/precision/unsigned/arguments/html-image.js index 8a486482..649df0da 100644 --- a/test/features/to-string/precision/unsigned/arguments/html-image.js +++ b/test/features/to-string/precision/unsigned/arguments/html-image.js @@ -5,7 +5,7 @@ describe('feature: to-string unsigned precision arguments HTMLImage'); function testArgument(mode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kgF40QDUlpIU1JqgENSOkhDUjpAm1SaSImXmkgELzVALjjRGxyorNjlRBDwoTY5URscqIBeNEKXjRliF40ZPPV56GjnY4eFGrGxwobCHhRWUDwo0MKkzQ2MHhRWMHhQ2OHhQhxwohhUhpIYVIUI6vCiKCpM0I28hpIO8lpIOOFEbHKiAakqEU1JqgFNSNEIakaIQ1IpAxC81QCF5qgELxoBccaCwY5URscqKw45UIccKE2OVFYC8aARnikZbELzVGbPNWrPS4nmUygqTNG9QwqQoVIYVJmjVlA8KN2EVIUVjCpCjSY4qQoUxhUhpGxscKKwipChsYPCiscVIUI4qTNCMKkNI2NvJaSMKkKIO8lpKxTUjpIU1I6SAXjRWIXjRkUvGiENSKRmyZeaSBsU1JqgsXeSozYN5GiswqSokw7yFDYccqGzbyVE2KakaByEapFIw5EzVmtJyctzzw09NHnGxwobGDw0jqGFSZ0mtQ4qzOk0sg+8hRvUMKkKNKTHFSGk1qGFSGk0mMKkKGxhUhQ2MHhQ2OHmaGxhUlpGwipCiDvIUVh3ktI2HeS0kDeSorFNSNFYDUlQWI1Sa0g2IakdJlsQ1JqjLkI1SNGHIQ1I0ZchTUmtJlzFNSWkNZhVlpHWOKkKN6jbyVEpGNSWknMQ1I6Tm5iNUmlE5ynYhea0mLP/Z'; + image.src = 'jellyfish.jpeg'; image.onload = () => { const gpu = new GPU({mode}); const originalKernel = gpu.createKernel(function (a) { diff --git a/test/features/to-string/precision/unsigned/constants/html-image-array.js b/test/features/to-string/precision/unsigned/constants/html-image-array.js index 086d9fc2..db8a7309 100644 --- a/test/features/to-string/precision/unsigned/constants/html-image-array.js +++ b/test/features/to-string/precision/unsigned/constants/html-image-array.js @@ -5,10 +5,10 @@ describe('feature: to-string unsigned precision constants HTMLImageArray'); function testArgument(mode, done) { const imageSources = [ - 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwc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JPrT5RNkxkphlqBic9aYSfWrUCHImMlMMlQkn1qNic9atRRm5k5k96aZarkn1ppJ9atQM3ULHm0ol96pkn1pyk+tHIJVC4JPel82quTjrRk0uVFqZZMtMMtQEn1qMk+tNQIlUJ2lpnmmoCTnrTc1ooHPKo2z/9k=' + 'jellyfish-1.jpeg', + 'jellyfish-2.jpeg', + 'jellyfish-3.jpeg', + 'jellyfish-4.jpeg', ]; let loaded = 0; const images = imageSources.map(imageSource => { diff --git a/test/features/to-string/precision/unsigned/constants/html-image.js b/test/features/to-string/precision/unsigned/constants/html-image.js index a6f9b776..536117ef 100644 --- a/test/features/to-string/precision/unsigned/constants/html-image.js +++ b/test/features/to-string/precision/unsigned/constants/html-image.js @@ -5,7 +5,7 @@ describe('feature: to-string unsigned precision constants HTMLImage'); function testArgument(mode, done) { const image = new Image(); - image.src = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxAQEhUPDxIVFRUVFRAPEBUVFRUPFRAVFRUWFhUVFRUYHSggGBolHRUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OFxAQGi0lHSUtLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0vLf/AABEIALcBFAMBEQACEQEDEQH/xAAbAAADAQEBAQEAAAAAAAAAAAABAgMABAUGB//EADgQAAIBAgMGBAQFAwUBAQAAAAECAAMREiExBBNBUWFxBSKBkTKhsdEGQsHh8FJikhQjM3LxwhX/xAAbAQEBAQEBAQEBAAAAAAAAAAABAAIDBAUGB//EADMRAAICAQIDBQgCAgIDAAAAAAABAhEDEiEEMUETUWFx8AUiMoGRobHB0eFS8RSSI0Jy/9oADAMBAAIRAxEAPwD7A0e49L/SfoNR4VIIBH/v3hsWw/cW66fz3gVdwFNsjpwOnpaXMXG9yuGZs5gKxshSsbABFo2Iva8hoPofr9JBQUscvlofaDJpo66NK85SlQFTs8xrEi9O02pWQVWTYlLTIjXgRW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VlpHWOKkKN6jbyVEpGNSWknMQ1I6Tm5iNUmlE5ynYhea0mLP/Z'; + image.src = 'jellyfish.jpeg'; image.onload = () => { const gpu = new GPU({mode}); const originalKernel = gpu.createKernel(function (a) { diff --git a/test/internal/backend/cpu/function-node.js b/test/internal/backend/cpu/function-node.js index 55b3a75f..5fe47d99 100644 --- a/test/internal/backend/cpu/function-node.js +++ b/test/internal/backend/cpu/function-node.js @@ -1,4 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); +const sinon = require('sinon'); const { CPUFunctionNode } = require('../../../../src'); describe('internal: CPUFunctionNode'); @@ -10,12 +11,22 @@ test('should call warn when using var is used in source', () => { argumentTypes: [], name: 'kernel', }); - let called = false; - node.varWarn = () => { - called = true; - }; + node.varWarn = sinon.spy(); node.toString(); - assert.ok(called); + assert.equal(node.varWarn.callCount, 1); +}); + +test('should not call warn when using var is used in source and warnVarUsage is false', () => { + const node = new CPUFunctionNode(`function() { var v = 1; return v; }`, { + output: [1], + precision: 'unsigned', + argumentTypes: [], + name: 'kernel', + warnVarUsage: false, + }); + node.varWarn = sinon.spy(); + node.toString(); + assert.equal(node.varWarn.callCount, 0); }); test('should not call warn when using const or let is used in source', () => { @@ -25,10 +36,7 @@ test('should not call warn when using const or let is used in source', () => { argumentTypes: [], name: 'kernel', }); - let called = false; - node.varWarn = () => { - called = true; - }; + node.varWarn = node.varWarn = sinon.spy(); node.toString(); - assert.notOk(called); + assert.equal(node.varWarn.callCount, 0); }); diff --git a/test/internal/backend/web-gl/function-node/index.js b/test/internal/backend/web-gl/function-node/index.js index 6b2174bf..dc6f1e48 100644 --- a/test/internal/backend/web-gl/function-node/index.js +++ b/test/internal/backend/web-gl/function-node/index.js @@ -1,4 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); +const sinon = require('sinon'); const { WebGLFunctionNode } = require('../../../../../src'); describe('internal: WebGLFunctionNode'); @@ -10,12 +11,22 @@ test('should call warn when using var is used in source', () => { argumentTypes: [], name: 'kernel', }); - let called = false; - node.varWarn = () => { - called = true; - }; + node.varWarn = sinon.spy(); node.toString(); - assert.ok(called); + assert.equal(node.varWarn.callCount, 1); +}); + +test('should not call warn when using var is used in source and warnVarUsage is false', () => { + const node = new WebGLFunctionNode(`function() { var v = 1; return v; }`, { + output: [1], + precision: 'unsigned', + argumentTypes: [], + name: 'kernel', + warnVarUsage: false, + }); + node.varWarn = sinon.spy(); + node.toString(); + assert.equal(node.varWarn.callCount, 0); }); test('should not call warn when using const or let is used in source', () => { @@ -25,10 +36,7 @@ test('should not call warn when using const or let is used in source', () => { argumentTypes: [], name: 'kernel', }); - let called = false; - node.varWarn = () => { - called = true; - }; + node.varWarn = sinon.spy(); node.toString(); - assert.notOk(called); + assert.equal(node.varWarn.callCount, 0); }); diff --git a/test/issues/487-dynamic-arguments.js b/test/issues/487-dynamic-arguments.js new file mode 100644 index 00000000..3c68bb72 --- /dev/null +++ b/test/issues/487-dynamic-arguments.js @@ -0,0 +1,59 @@ +const { assert, skip, test, module: describe } = require('qunit'); +const { GPU } = require('../../src'); + +describe('issue #487 - pipeline dynamic arguments'); + +function testPipelineDynamicArguments(mode) { + const gpu = new GPU({mode: mode}); + + const kernel = gpu.createKernel(function (w) { + return this.thread.x + this.thread.y * w; + }) + .setPipeline(true) + .setDynamicOutput(true); + + const sumRow = gpu.createKernel(function (texture, w) { + let sum = 0; + for (let i = 0; i < w; i++) + sum = sum + texture[this.thread.x][i]; + return sum; + }) + .setDynamicArguments(true) + .setDynamicOutput(true); + + function doAThing(w, h) { + kernel.setOutput([w, h]); + let intermediate = kernel(w); + const array = intermediate.toArray(); + assert.equal(array.length, h); + assert.equal(array[0].length, w); + sumRow.setOutput([h]); + const result = sumRow(intermediate, w); + assert.equal(result.length, h); + assert.equal(result[0].length, undefined); + } + + doAThing(10, 5); + doAThing(3, 2); + gpu.destroy(); +} + +test('(GPU only) auto', () => { + testPipelineDynamicArguments(); +}); + +test('(GPU only) gpu', () => { + testPipelineDynamicArguments('gpu'); +}); + +(GPU.isWebGLSupported ? test : skip)('(GPU only) webgl', () => { + testPipelineDynamicArguments('webgl'); +}); + +(GPU.isWebGL2Supported ? test : skip)('(GPU only) webgl2', () => { + testPipelineDynamicArguments('webgl2'); +}); + +(GPU.isHeadlessGLSupported ? test : skip)('(GPU only) headlessgl', () => { + testPipelineDynamicArguments('headlessgl'); +}); diff --git a/test/jellyfish-1.jpeg b/test/jellyfish-1.jpeg new file mode 100644 index 00000000..3797dc2b Binary files /dev/null and b/test/jellyfish-1.jpeg differ diff --git a/test/jellyfish-2.jpeg b/test/jellyfish-2.jpeg new file mode 100644 index 00000000..ca9063d3 Binary files /dev/null and b/test/jellyfish-2.jpeg differ diff --git a/test/jellyfish-3.jpeg b/test/jellyfish-3.jpeg new file mode 100644 index 00000000..b8683bb5 Binary files /dev/null and b/test/jellyfish-3.jpeg differ diff --git a/test/jellyfish-4.jpeg b/test/jellyfish-4.jpeg new file mode 100644 index 00000000..65ceb5be Binary files /dev/null and b/test/jellyfish-4.jpeg differ diff --git a/test/jellyfish.jpeg b/test/jellyfish.jpeg new file mode 100644 index 00000000..6adbdee3 Binary files /dev/null and b/test/jellyfish.jpeg differ