725 Commits

Author SHA1 Message Date
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
a37fe28818 fix: Memory leaks on build if called more than once 2020-03-20 08:27:24 -04:00
sarthak saxena
bfa3433585
Add type for Uint8ClampedArray in KernelVariable
```
render = new GPU.GPU({ mode: "gpu" })
render(image.data, 14 * Math.sin(Date.now() / 400))
```
Since image data is of type Uint8ClampedArray & KernelVariable does not support the same hence gives type error


Ex: https://observablehq.com/@fil/image-to-gpu
2020-03-18 20:01:17 +05:30
Robert Plummer
8cfbf0cad7 fix: Clearing cloned textures produces new internal copy when multi references 2020-03-16 10:59:04 -04:00
Robert Plummer
6df34b3a90 fix: Don't call beforeMutate if immutable and unit test 2020-03-16 08:40:04 -04:00
Robert Plummer
b1af9b3c4c fix: Don't call kernel.updateTextureArgumentRefs if kernel is mutable 2020-03-12 07:40:15 -04:00
Robert Plummer
f88d92cc40 feat: Bring back kernel.immutable and kernel.setImmutable() with defaults to false
Along with tests and documentation on which versions are affected.  Sorry for the inconvenience!
feat: Add more advanced-typescript.ts
fix: Alter documentation mentioning v2
fix: Example of fluid.html, to use `immutable`
2020-03-11 07:36:50 -04:00
Robert Plummer
3fe63f6db3 feat: Add texture.empty() support and tests 2020-03-10 16:16:13 -04:00
Robert Plummer
54518beecd fix: Add missing Math.tanh support and test 2020-03-09 05:46:34 -04:00
Robert Plummer
9286f5669d fix: Move argument sanitization to when writing strings only 2020-02-16 15:58:24 -05: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
b69644c17a fix: Use case of CallExpression
in WebGL.astCallExpression
2020-02-11 08:12:45 -05:00
Robert Plummer
012cfff566 fix: #522 related, add missing deprecated method with warning 2020-01-24 10:41:27 -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
b2c9051f7e fix: #534 2020-01-21 08:17:02 -05:00
Robert Plummer
db54434166 fix: Modulo performance and simplify tests
fix: Modulo negatives
fix: Modulo accuracy issue on OSX with `integerCorrectionModulo`
fix: Follow naming convention `div_with_int_check` to `divWithIntCheck`
fix: Member expression with function
fix: CPU variable assignment
fix: `gpu.addFunction` needed to be before createKernel and documentation
fix: mandelbulb.html from above .addFunction
2020-01-21 07:37:48 -05:00
Robert Plummer
16bed1596e fix: If already an IGPUFunction don't convert to one 2020-01-19 07:47:05 -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
13f70f427d
Merge pull request #566 from InkLabApp/develop
Added Canvas Elements as valid input to Kernel
2020-01-17 15:23:30 -05:00
InkLab
84debbb4d3 Added Canvas Elements as valid input to Kernel
This small change only allows single canvas elements as kernel input. They have
the exact same properties and use cases as html images, bit if you need to use
a canvas directly it is more efficient than converting it to an image first.
2020-01-14 17:49:44 -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
cd0b417c67 fix: #552 remove incorrect texture size checks
fix: texture.renderRawOutput to use existing framebuffer, or make it so it can be deleted
fix: glKernelString to handle the framebuffer from texture.renderRawOutput
fix: WebGLKernelArray.checkSize so display error for all three scenarios
  1. width too big
  2. height too big
  3. width and height too big
2020-01-08 07:13:37 -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
78b6e301c4 fix: #556 upgrade acorn, and handle function() {} syntax 2020-01-02 13:03:46 -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
83641519dd fix: Rename Texture.texture.refs to more private Texture.texture._refs
fix: Create framebuffer for internal texture, and not per GPU Texture
fix: Set window.GPU by use of getter, and have no setter
2019-12-27 08:20:00 -05:00
Robert Plummer
a3c930d583 fix: Memory recycling bug, and remove no longer needed renderStrategy
Also cleanup documentation a bit
2019-12-25 09:10:56 -05:00
Robert Plummer
6e2f1dacde feat: Cleanup and bring texture recycling to webgl2, and add unit test 2019-12-22 17:41:29 -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
bcae4ba2bb Merge branch 'develop' into refed-textures 2019-12-18 13:33:08 -05:00
Robert Plummer
103b5e19b4 fix: Add demos and fix return type 2019-12-17 09:37:35 -05:00
Robert Plummer
7456afd629 feat: Provide overloading methods with types
Also separate and better fine types for use therein.
2019-12-17 08:36:59 -05:00
ddsol
b051d84031 feat: Made textures referenced
By making textures referenced, we prevent duplicating them when not needed and allow for reuse of textures where possible.
2019-12-13 20:02:09 -05:00
Robert Plummer
f78f6895ea
Merge pull request #540 from gpujs/pre-2.3.0
Pre 2.3.0 work
2019-11-26 10:56:56 -05:00
Robert Plummer
7669b7aeb8 fix: Fixes #537 for CPU 2019-11-26 10:56:13 -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
a7a9e1e3c9 Merge branch 'master' into develop 2019-11-05 04:41:18 -05:00
Robert Plummer
67f3b3c8ad fix: Allow false for removeIstanbulCoverage 2019-10-30 16:55:51 -04:00
Robert Plummer
01728ad36c fix: Bump version and build 2019-10-29 17:52:27 -04:00
Robert Plummer
c4f6a1b687
Merge pull request #528 from gpujs/524-coverage-compatibility
524 coverage compatibility
2019-10-29 17:49:56 -04:00
Robert Plummer
a1b80b7204
Merge pull request #527 from gpujs/523-texture-memory
fix: #523 cleanup texture memory
2019-10-29 17:48:48 -04:00
Robert Plummer
ade8885672 fix: #524 Add default for webgl to remove coverage 2019-10-29 10:42:57 -04:00
Robert Plummer
c338399431 fix: #523 cleanup texture memory 2019-10-29 10:41:40 -04:00
Robert Plummer
29e2dd25c4 fix: #524 allow for coverage 2019-10-29 10:39:00 -04:00
Robert Plummer
9856270483
Merge pull request #494 from franciscofabian/develop
check array length before accessing array elements
2019-10-20 20:23:29 -04:00
Robert Plummer
b98798b573 fix: Use uniformly distributed rather than triangle for random
fix: Rename plugin files for better identification
2019-10-18 07:20:03 -04:00