106 Commits

Author SHA1 Message Date
Robert Plummer
8dcd0546b6 feat: Read from ImageData
And tests and docs
2022-01-26 17:12:49 -05:00
Robert Plummer
5622b0127b feat: Read from ImageBitmap
Also fixed CPU processing of OffscreenCanvas
2022-01-26 16:28:14 -05:00
Robert Plummer
8a7babaf00 feat: Read from OffscreenCanvas
And unit tests
2022-01-26 15:35:04 -05:00
Robert Plummer
7e3fa3acb0 feat: Removal of istanbul handling
https://github.com/gotwarlost/istanbul/issues/922 & https://github.com/istanbuljs/istanbuljs/issues/499
2021-01-05 15:57:15 -05:00
Robert Plummer
e3fd163505 fix: Ensure arguments are targeted correctly
fix: Added a missing jsdoc
2020-12-02 15:16:35 -05:00
Robert Plummer
bee71782fe feat: Experimental internally defined matrixes 2020-08-25 14:04:39 -04:00
Robert Plummer
7e62639033 fix: #585 check for inaccurate results for very small kernel
fix: #585 add features.isSpeedTacticSupported and tests
2020-03-30 08:21:09 -04:00
Robert Plummer
1955ad3500 fix: #586 2020-03-24 07:53:57 -04:00
Robert Plummer
61dfe8a46a fix: #572 excessive calls, reuse textures
feat: introduce WebGL._replaceOutputTexture and WebGL._replaceSubOutputTextures to cut down on resource usage
feat: All supportable Math.methods added
fix: Safari not able to render texture arguments
feat: CPU gets a pipeline that acts like GPU with/without immutable
2020-03-22 17:29:26 -04:00
Robert Plummer
772eaec5a8 fix: Build 2020-03-20 08:35:40 -04:00
Robert Plummer
3fe63f6db3 feat: Add texture.empty() support and tests 2020-03-10 16:16:13 -04:00
Robert Plummer
3cc8987d79 fix: Underscore and test, version bump, and code coverage command
ty c8!
2020-02-16 14:38:33 -05:00
Robert Plummer
5a6d817d77 fix: #519 funny names from minification and upgrade typescript
So c35717e3b4 is properly supported.
2020-01-23 07:20:40 -05:00
Robert Plummer
de98b0102d feat: Finish HTMLCanvas input from PR https://github.com/gpujs/gpu.js/pull/566
fix: #567
fix: #569
fix: #568
fix: #565
fix: #564
2020-01-18 08:42:09 -05:00
Robert Plummer
254b06791f feat: Handle ++ in function-tracer.js
This is in favor of using for loop variable position tracking, which is removed.
feat: Removal of no longer needed `warnVarUsage`
feat: If ternary returns void, use if statement in webgl
fix: Update documentation and clarify variable declarations
  Officially support private functions - WOOHOO!
2020-01-14 07:01:23 -05:00
Robert Plummer
03972cc1fa fix: #553 call gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false); on every texture type and add unit tests
fix: Framebuffer loss after texture is deleted
fix: Split up array and primitive (index.js) types of KernelValues and introduce .setup()
  * This was needed to handle .toArray() from the fix from #553
fix: Performance fix, define texture types in `kernelValue.setup()`, rather than on every `kernelValue.updateValue()`
2020-01-06 13:36:00 -05:00
Robert Plummer
316e35a3a1 fix: #559 (line 16 of kernel-run-shortcut.js)
fix: Slight memory leak, and loss of first kernel when switching kernels
fix: Feed `value.constructor` to `this.onUpdateValueMismatch()` where it was missing
2020-01-02 19:48:13 -05:00
Robert Plummer
ef17f8f41d fix: #556 followup fix, not all declared types need to be integers 2020-01-02 12:28:17 -05:00
Robert Plummer
fbb853865a fix: #556 & tests and ensure OffscreenCanvas gets GPU
Make unsafe when meets the qualification and warn
2019-12-27 16:37:14 -05:00
Robert Plummer
d221e974dd fix: Experiment with end to end working strategy and unit tests 2019-12-20 12:28:23 -05:00
Robert Plummer
ed1cd94448 feat: Added features and fixes for the following issues:
...it kind of snowballed from some needs
Fixes #521 - If `tactic` is not set, check precision allowed from WebGL, and automatically change based off needs, otherwise use value from `tactic`.
Fixes #535 - Internally check if texture from argument is the same as output, if so, clone this texture, and then clean it up after the kernel runs.
Fixes #536 - Normalize all declarations to non-destructured, and then parse
Fixes #537 - Change logic
Fixes #538 - Found the GL script that would work, and reduced the methods to use it
Fixes #539 - Found a better way of testing random, and this gives me an error for 1 in 10 runs, acceptable

Some refactoring for less duplicate code and documentation
2019-11-26 10:55:28 -05:00
Robert Plummer
29e2dd25c4 fix: #524 allow for coverage 2019-10-29 10:39:00 -04:00
Robert Plummer
ab75103032 feat: Add texture.clone() support and tests
feat: Upgrade gpu-mock.js
fix: Typescript `Texture` definition
fix: Typescript JSON definition
fix: Some internal documentation
fix: Some removal of unused or duplicate code
2019-10-13 16:06:30 -04:00
Robert Plummer
c7df01e66f fix: #514 fix and upgrade tests to detect behaviour
fix: Documentation for what types are and are not tracked
fix: Added documentation for testing and building
fix: Some destructuring
2019-10-08 10:29:54 -04:00
Robert Plummer
83cedd89a7 fix: Unit tests for #500, #501, #502, #503, #504
fix: typescript to include video and KernelValues
fix: Duplicate image in unit test
fix: Bump and build
2019-09-24 10:22:16 -04:00
Robert Plummer
2bc76ad82d feat: Video input, injectNative, tests.
v2.0.0 Cosmic Jellyfish
2019-09-17 10:51:53 -04:00
Robert Plummer
6eafe70f8e feat: add tactic feature
To switch internally from `lowp`, to `mediump`, or `highp`.
Also added unit tests.
2019-08-23 10:19:54 -04:00
Robert Plummer
75895512e4 fix: dev mode for adding functions
fix: dev mode kernel to be added to GPU.kernels
fix: Array switching with array type is not defined in single precision mode
fix: GPU.destroy when no context is set
2019-08-06 16:14:05 -04:00
Robert Plummer
4260a345c7 fix: #493, and add setStrictIntegers to typescript def
fix: Remove repeated literal `${ast.start},${ast.end}`, in favor of var
2019-07-29 16:06:17 -04:00
Robert Plummer
21b9e3b759 fix: Shorten up kernelRunShortcut
fix: Update typescript definitions
fix: `GPU.createKernel`'s `onRequestFallback` to switch kernels entirely so the fallback doesn't continue to happen over and over
fix: `GPU.createKernel`'s `onRequestFallback` to use `argumentTypes`
fix: Minification
fix: examples to use minification
fix: Fix kernel string to support `Array1D(2|3|4)` and `Array3D(2|3|4)`
fix: `lookupKernelValueType` to as well get type, to make lookup easier for `Texture`s
fix: `Kernel` to properly build `this.kernelArguments` and `this.kernelConstants`
fix: `KernelValue` to get its type from `value.type` if it exists
fix: `@returns` keyword in favor of `@return` in some places
fix: DoxDox documentation issue
fix: Remove old reference to "Automatically-built Documentation", no longer applicable
fix: Bump and build
2019-07-26 14:57:36 -04:00
Robert Plummer
86af54efef fix: Node support for v8+
fix: Move `make` cli command to gulp so it runs in parallel
fix: Add official support for `Array1D(2|3|4)`, `Array2D(2|3|4)`, and `Array3D(2|3|4)` and unit tests
fix: Add offical support for `Array(2)`, `Array(3)`, and `Array(4)` and unit tests
fix: Mandelbulb constant used a constant, so moved to appropriate location
fix: Failing unit test for Safari
fix: When not falling back in HeadlessGL, call `STACKGL_resize_drawingbuffer`
fix: Remove `xyz` variable from glsl
fix: Add `uniform4fv` and `uniform4iv` to WebGL implementation
fix: Check for kernel settings `constantTypes` and `argumentTypes`
fix: Inherit type from kernel in KernelValue constructors
fix: Add some typescript details for `GPUVariableType`, `IKernelSettings`, and `ITypesList`
fix: Add support for 4d array in `utils.getMemoryOptimizedFloatTextureSize` for the special use case of `Array3D(2|3|4)`
fix: Add `utils.flatten4dArrayTo` for the special use case of `Array3D(2|3|4)`
fix: Add support for 4d array in `utils.flattenTo`
fix: Bump and build
2019-07-24 12:56:05 -04:00
Robert Plummer
5605504d92 fix: Upgrade gpu-mock.js to latest 100% code coverage tested
fix: Added tests for building kernels with "dev" mode
feat: Added a `.toArray()` method on `Input`, for usage with "dev" mode
fix: `Input.size` to reflect exactly what was sent in, rather than make up dimensions that aren't there
fix: `KernelArgument.dimensions` to fill in missing dimensions from size
fix: Only safe declarations when using a literal
2019-07-11 13:18:33 -04:00
Robert Plummer
82832902cc fix: Move jellyfish images to actual files
fix: added `warnVarUsage` and `Dealing With Transpilation`
fix: Test dynamic arguments and provide some fixes for
fix: Dynamic arguments for `CPUFunctionNode`
fix: Dynamic arguments for `WebGLKernelValueDynamicHTMLImage`, `WebGLKernelValueDynamicNumberTexture`, `WebGLKernelValueDynamicSingleInput`, `WebGL2KernelValueDynamicHTMLImage`, `WebGL2KernelValueDynamicNumberTexture`, and `WebGL2KernelValueDynamicSingleInput`
fix: `onRequestFallback` settings in `createKernel` and `createKernel` inclusion of `loopMaxIterations`, `dynamicOutput`, and `dynamicArgument` in settings for when switching kernels
fix: `WebGL2Kernel` and `HeadlessGLKernel` typescript definition extensions
2019-07-05 11:03:25 -04:00
Tom MacWright
e4c2b34104 Browser compatibility
This allows downstream consumers to use GPU.js with requirejs,
d3-require, unpkg, jsdelivr, and probably some other systems. The main
changes:

- Set { standalone: 'UMD' } in browserify configuration. This makes it
  publish a UMD build that exposes a 'UMD' export or global for
  CommonJS, require, and AMD.
- Move bin/ to dist/, because these are properly distribution files
  rather than binaries.
- Update tests to point to the dist/ version.
- Simplify browser.js to always export, because it is not the
  recommended entry point for any browser.
- Add unpkg and jsdelivr fields to package.json so that those CDNs
  automatically pick up on the right file when someone tries to include
  from them.
2019-06-26 14:14:40 -07:00
Robert Plummer
27f4efb8d9 fix: Proper kernel.toString() unit tests (good grief, so many!) for CPU and GPU
feat: `switch` statements
feat: `kernel.toString()` has as well `.getPixels()`
fix: Proper fallback when arguments or constants are not supported
fix: Removal of infamous `|| 'Number'` for argument types and return types
fix: detect circlical logic in `FunctionBuilder.lookupReturnType()` and tests
fix: Allow subKernels to get their type detected as well
fix: `FunctionNode`'s `typeLookupMap` didn't have 'Float' or 'Integer'
feat: Turn off context checking in kernel, via `{ checkContext: false }`, used for `kernel.toString()`
fix: `GPU.upgradeDeprecatedCreateKernelSettings` to have a default return value
fix: Typings
fix: `kernelRunShortcut()` to better switch kernel when replacing
feat: It order to flatten methods, for `kernel.toString()` `utils.flattenFunctionToString()` and light unit testing of it
fix: Added sinon for testing
fix: Bump gl-wiretap
2019-06-03 19:32:21 -04:00
Robert Plummer
8ed25cfc67 fix: #410 fully, with backward compatibility to old encoder 2019-05-27 15:02:28 -04:00
Robert Plummer
2c4ef75e51 feat: #166 finally bitwise operators 2019-05-25 07:08:11 -04:00
Robert Plummer
49a06ba305 fix: #470
the math didn't end up being wrong, but found an issue with argument type, and went ahead and fixed it
2019-05-24 09:36:28 -04:00
Robert Plummer
dd6665a513 fix: #471, was already fixed, but added unit test anyway
fix: Rename describe for conformity
2019-05-23 21:01:13 -04:00
Robert Plummer
4d46279fd4 fix: #472 compilation issue, and add Uint8ClampedArray support 2019-05-23 18:13:12 -04:00
Robert Plummer
181c553601 fix: #473 resize canvas when needed in headlessgl and unit test 2019-05-23 16:49:56 -04:00
Robert Plummer
20a9ed54c7 fix: #370 provide means of handling textures form CPU
fix: Add `Kernel.features.channelCount` to each kernel, and unit test
fix: Was curios for code relating to https://github.com/gpujs/gpu.js/wiki/Quick-Concepts and so added a unit tests for matrix-multiply-precision.js
2019-05-22 16:00:03 -04:00
Robert Plummer
a0a92586c0 fix: #378 unit test, showing the issue resolved
fix: Random demo, when webgl or webgl2 not available, use try to keep demo running
2019-05-22 09:43:44 -04:00
Robert Plummer
05dd1744ea fix: partial (maybe whole) for #408 Break up texture constructors
So we can use `texture.toArray()`, this uses much less resources
2019-05-22 08:50:46 -04:00
Robert Plummer
62d4ea739d fix: #396 by changing documentation and adding unit test 2019-05-21 10:08:42 -04:00
Robert Plummer
aca274198d feat: Added dynamicOutput && dynamicArguments as official settings
fix: Some documentation was out of date with the new features, so fixed
2019-05-20 18:54:12 -04:00
Robert Plummer
e3aded43b1 feat: Allow for pixel flipping
fix: Move the flipPixels method to utilities, for reuse
fix: Invert pixel orientation
fix: Add text for issue #422
2019-05-18 17:25:47 -04:00
Robert Plummer
2b45882c58 feat: Raw output
feat: Consolidate subKernels rendering code as part of the renderStrategy
fix: remove tabs, replace with spaces
fix: make FunctionBuilder.fromKernel typing static
fix: Add missing FunctionBuilder.getPrototypeString definition
fix: Move building logic to kernelRunShortcut as well as exec method
2019-05-17 18:42:35 -04:00
Robert Plummer
2b25c75d70 feat: Dynamic recompiling 2019-05-16 21:39:01 -04:00
Robert Plummer
ef3f0cf001 feat: support for boolean as variable, argument, and constant
fix: implied else issue discovered, and fixed when testing boolean using leading and following return statements
fix: Added a section in documentation about types and added reference to boolean
fix: Bump and build
2019-04-29 08:45:43 -04:00