41 Commits

Author SHA1 Message Date
David Tittsworth
40a83eccfa Added a fix for a crash when using a pipeline kernel and a constant texture 2021-01-18 08:09:26 -08: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
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
Robert Plummer
54518beecd fix: Add missing Math.tanh support and test 2020-03-09 05:46:34 -04:00
Robert Plummer
b69644c17a fix: Use case of CallExpression
in WebGL.astCallExpression
2020-02-11 08:12:45 -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
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
bdcdf8c98a fix: Remove unneeded file 2020-01-06 13:40:33 -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
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
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
045b470280 fix: Remove unneeded files 2019-10-02 21:36:32 -04:00
Robert Plummer
354c2014ee fix: A few broken unit test for node 2019-09-24 10:38:52 -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
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
Robert Plummer
8aac6ab2e2 fix: Failing unit test 2019-06-29 10:11:29 -04:00
Robert Plummer
e9bdc31a18 fix: Examples file reference
fix: move `GLKernel.fixIntegerDivisionAccuracy` to `Kernel.fixIntegerDivisionAccuracy` as it has to do with typing
fix: FunctionTracer 'ConditionalExpression' needed `ast.test`
test: Add test for FunctionTracer 'ConditionalExpression' `ast.test` usage
fix: division type handling with `Kernel.fixIntegerDivisionAccuracy` true
test: Add test for division handling with and without `Kernel.fixIntegerDivisionAccuracy` true
2019-06-29 10:07:29 -04:00
Robert Plummer
1c820a7724 fix: Deep types and tests to lookup arguments BEFORE return types
fix: Error messages when on single line
fix: Bump and build
2019-06-24 21:11:20 -04:00
Robert Plummer
914bae02ea fix: #483 Handle and test Int32Array, Int16Array, and Int8Array transfer types
feat: Allow for arrow functions as kernels
fix: Deep types where the argument contains a function call, and test
fix: Only set argument type if it isn't already set
fix: Bump version and build
fix: Add Sponsorship from browser-stack
2019-06-20 10:11:12 -04:00
Robert Plummer
7bcfbed234 feat: Pre type check with FunctionTracer
feat: Add cat demo
feat: Type check even on CPU
fix: ArrayTexture support as arguments for internal arrays
fix: Typo from "Interger" to "Integer"
feat: Bump and build version number
2019-06-17 18:00:36 -04: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
2b25c75d70 feat: Dynamic recompiling 2019-05-16 21:39:01 -04:00
Robert Plummer
20ee1f74f7 feat: Break up the argument and constant handlers into reusable code 2019-05-08 15:21:51 -04:00
Robert Plummer
8bb5e6be4d fix: Check getExtension is truthy before calling and unit tests
fix: Add missing test for headlessgl to all.html
2019-04-24 07:48:35 -04:00
Robert Plummer
b9f7d7bff0 fix: Move varWarn to and unit test that all FunctionNode's use it
fix: Test that getExtension is set to be able to use on TravisCI
fix: Remove wraparound, is no longer being used anywhere
fix: add getMemoryOptimizedPackedTextureSize to string kernel
fix: Remove console.log() usage
fix: Move addFunction functionality into new utils method `functionToIFunction`
fix: Fix mergeSettings to use `functions` settings and use `functionToIFunction`
fix: Remove the spread operator for now, for compatibility with safari
fix: Add typings for `setFunctions`
fix; Failing unit tests for sarafi
feat: Add CONTRIBUTING.md
feat: Add ISSUE_TEMPLATE.md
fix: Remove typescript from dependencies
fix: Document, document, document
fix: Bump version and build
2019-04-23 22:03:14 -04:00
Robert Plummer
b60e571646 fix: 8 and 16 bit packing when using single precision float
fix: 2,3,4 array output render strategies
fix: Add deprecation handling
fix: Add addArgument and addConstant tests for webgl2
fix: remove floatTextures as a property
2019-04-21 12:02:34 -04:00
Robert Plummer
00ee2ba982 feat: Refactor dimensional values and expose the bitRatio all the way to the function node
fix: Added test suite for arrays and inputs for webgl and webgl2
fix: Rename "floatOutput" feature to "precision".  Values can be "unsigned" or "single"
fix: Add input and Input to typings
fix: Use Int32Array for input.size
2019-04-20 09:59:49 -04:00
Robert Plummer
d068ba211d fix: Add 'Input' handling to astCallExpression and astBinaryExpression
fix: Add unit tests for above
2019-04-14 11:59:59 -04:00
Robert Plummer
ee7baf70ba fix: Array handling (2,3,4) for webgl2 & webgl1 (headlessgl next)
fix: Float handling
feat: added `optimizeFloatMemory` to better exemplify what it does and replace `floatTextures` and its voodoo in webgl2
feat: end to end strong type detection
Note: added a bunch of TODO's this is just a good resting point.
2019-04-11 19:41:58 -04:00
Robert Plummer
1e60084020 feat: Full type inference (this is a HUGE feature)
feat: Add mandelbulb.html example
fix: Bump and build
2019-03-19 19:51:03 -04:00
Robert Plummer
4aa08ca393 fix: Casting for all non-float arguments used with Math.fn()
fix: Greater than, less than evaluation when comparing an integer with a literal that is a float, try not to cast left, but rather cast left to right
fix: Constants that do not have a type defined should fail
fix: Don't prevent "random" as a native function name
fix: Allow Texture constructor to inherit instance of GPU for easy .toArray()
fix: Texture constructor as settings object for easier understanding of order input
fix: Typescript corrections for Texture
fix: Bump headless-gl version to that of Multiple Render Targets
2019-03-17 22:12:09 -04:00
Robert Plummer
6050e6a8a6 fix: When literals are returned from kernel, freeze their type
feat: Parse GLSL and get return type and argument types
feat: Properly look up native function return types and cast if needed
feat: Properly look up native function argument types and cast if needed
fix: Move this.chooseKernel() to beginning of GPU instantiation

As well as test all the above
2019-03-13 12:36:19 -04:00
Robert Plummer
5f59354219 fix: this.thread, and this.output type handling, and block statements 2019-02-18 10:55:30 -05:00
Robert Plummer
0cce0a0a82 fix: Clone GPU for loop into CPU
Add unit tests to browser all.html
fix a typo in file and in desc
Add a few missing items to index.d.ts
Move debug console.log to match GPU counterpart
Build files
All unit tests pass or skip (when appropriate) for Chrome, Firefox, Safari, and Node
This marks v1 rc1.
2019-02-10 22:58:18 -05:00
Robert Plummer
22046269b6 feat: Added "dev" mode, so we can easily debug
refactored webgl for statements, to be more performant
added unit tests for "for" statements
will do the same for cpu for statements next
fixed some issues in typings file
exposed FunctionNode from standard importer
2019-02-10 12:17:31 -05:00
Robert Plummer
cf5a358422 fix: Got 100% unit tests in chrome, ff, safari, and node. 2019-02-07 19:08:19 -05:00
Robert Plummer
f48409cc56 fix: Web side tests
Also cleanup moving methods around for reuse and so code can be more concise.
Removed some older references, where now we use `this.thread.x` or `this.output.x`.
Removed some older methods we no longer use (astFunctionPrototype).
Removed some overloaded functions from webgl1 and webgl2 glsl.  We no longer need them.
Removed some references to `=== null` in favor of truthy.  `if (undefined === null)` is true, and can lead to unexpected results, where we really wanted truthy, and is simpler to write.
2019-02-05 21:17:20 -05:00
Robert Plummer
630bd94ead feat: Completely new type checking system, and refined state management 2019-02-04 19:46:55 -05:00