Skip to content

Commit 61dfe8a

Browse files
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
1 parent fdedd6f commit 61dfe8a

29 files changed

+1840
-353
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,10 @@ const matMult = gpu.createKernel(function(a, b) {
823823
## Pipelining
824824
[Pipeline](https://en.wikipedia.org/wiki/Pipeline_(computing)) is a feature where values are sent directly from kernel to kernel via a texture.
825825
This results in extremely fast computing. This is achieved with the kernel setting `pipeline: boolean` or by calling `kernel.setPipeline(true)`
826+
In an effort to make the CPU and GPU work similarly, pipeline on CPU and GPU modes causes the kernel result to be reused when `immutable: false` (which is default).
827+
If you'd like to keep kernel results around, use `immutable: true` and ensure you cleanup memory:
828+
* In gpu mode using `texture.delete()` when appropriate.
829+
* In cpu mode allowing values to go out of context
826830

827831
### Cloning Textures **New in V2!**
828832
When using pipeline mode the outputs from kernels can be cloned using `texture.clone()`.
@@ -1006,14 +1010,24 @@ This is a list of the supported ones:
10061010

10071011
* `Math.abs()`
10081012
* `Math.acos()`
1013+
* `Math.acosh()`
10091014
* `Math.asin()`
1015+
* `Math.asinh()`
10101016
* `Math.atan()`
1017+
* `Math.atanh()`
10111018
* `Math.atan2()`
1019+
* `Math.cbrt()`
10121020
* `Math.ceil()`
10131021
* `Math.cos()`
1022+
* `Math.cosh()`
10141023
* `Math.exp()`
1024+
* `Math.expm1()`
10151025
* `Math.floor()`
1026+
* `Math.fround()`
1027+
* `Math.imul()`
10161028
* `Math.log()`
1029+
* `Math.log10()`
1030+
* `Math.log1p()`
10171031
* `Math.log2()`
10181032
* `Math.max()`
10191033
* `Math.min()`
@@ -1030,8 +1044,15 @@ This is a list of the supported ones:
10301044
* `Math.round()`
10311045
* `Math.sign()`
10321046
* `Math.sin()`
1047+
* `Math.sinh()`
10331048
* `Math.sqrt()`
10341049
* `Math.tan()`
1050+
* `Math.tanh()`
1051+
* `Math.trunc()`
1052+
1053+
This is a list and reasons of unsupported ones:
1054+
* `Math.clz32` - bits directly are hard
1055+
* `Math.hypot` - dynamically sized
10351056

10361057
## How to check what is supported
10371058

0 commit comments

Comments
 (0)