You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-14Lines changed: 15 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,10 +148,10 @@ Settings are an object used to create an instance of `GPU`. Example: `new GPU(s
148
148
149
149
## `gpu.createKernel` Settings
150
150
Settings are an object used to create a `kernel` or `kernelMap`. Example: `gpu.createKernel(settings)`
151
-
*`output`: array or object that describes the output of kernel.
151
+
*`output` or `kernel.setOutput(output)`: `array` or `object` that describes the output of kernel. When using `kernel.setOutput()` you _can_ call it after the kernel has compiled if `kernel.dynamicOutput` is `true`, to resize your output. Example:
152
152
* as array: `[width]`, `[width, height]`, or `[width, height, depth]`
153
153
* as object: `{ x: width, y: height, z: depth }`
154
-
*`pipeline`**New in V2!**: boolean, default = `false`
154
+
*`pipeline`or `kernel.setPipeline(true)`**New in V2!**: boolean, default = `false`
155
155
* Causes `kernel()` calls to output a `Texture`. To get array's from a `Texture`, use:
156
156
```js
157
157
constresult=kernel();
@@ -161,19 +161,20 @@ Settings are an object used to create a `kernel` or `kernelMap`. Example: `gpu.
161
161
```js
162
162
kernel(texture);
163
163
```
164
-
*`graphical`: boolean, default = `false`
165
-
*`loopMaxIterations`: number, default = 1000
166
-
*`constants`: object, default = null
167
-
*`hardcodeConstants`: boolean, default = false
168
-
*`optimizeFloatMemory`**New in V2!**: boolean - causes a float32 texture to use all 4 channels rather than 1, using less memory, but consuming more GPU.
169
-
*`precision`**New in V2!**: 'single' or 'unsigned' - if 'single' output texture uses float32 for each colour channel rather than 8
170
-
*`fixIntegerDivisionAccuracy`: boolean - some cards have accuracy issues dividing by factors of three and some other primes (most apple kit?). Default on for affected cards, disable if accuracy not required.
171
-
*`functions`: array, array of functions to be used inside kernel. If undefined, inherits from `GPU` instance.
172
-
*`nativeFunctions`: object, defined as: `{ functionName: functionSource }`
164
+
*`graphical` or `kernel.setGraphical(boolean)`: boolean, default = `false`
165
+
*`loopMaxIterations` or `kernel.setLoopMaxIterations(number)`: number, default = 1000
166
+
*`constants` or `kernel.setConstants(object)`: object, default = null
167
+
*`dynamicOutput` or `kernel.setDynamicOutput(boolean)`: boolean, default = false - turns dynamic output on or off
168
+
*`dynamicArguments` or `kernel.setDynamicArguments(boolean)`: boolean, default = false - turns dynamic arguments (use different size arrays and textures) on or off
169
+
*`optimizeFloatMemory` or `kernel.setOptimizeFloatMemory(boolean)`**New in V2!**: boolean - causes a float32 texture to use all 4 channels rather than 1, using less memory, but consuming more GPU.
170
+
*`precision` or `kernel.setPrecision('unsigned' | 'single')`**New in V2!**: 'single' or 'unsigned' - if 'single' output texture uses float32 for each colour channel rather than 8
171
+
*`fixIntegerDivisionAccuracy` or `kernel.setFixIntegerDivisionAccuracy(boolean)` : boolean - some cards have accuracy issues dividing by factors of three and some other primes (most apple kit?). Default on for affected cards, disable if accuracy not required.
172
+
*`functions` or `kernel.setFunctions(object)`: array, array of functions to be used inside kernel. If undefined, inherits from `GPU` instance.
173
+
*`nativeFunctions` or `kernel.setNativeFunctions(object)`: object, defined as: `{ functionName: functionSource }`
173
174
* VERY IMPORTANT! - Use this to add special native functions to your environment when you need specific functionality is needed.
174
-
*`subKernels`: array, generally inherited from `GPU` instance.
175
-
*`immutable`: boolean, default = `false`
176
-
*`strictIntegers`: boolean, default = `false` - allows undefined argumentTypes and function return values to use strict integer declarations.
175
+
*`subKernels` or `kernel.setSubKernels(array)`: array, generally inherited from `GPU` instance.
176
+
*`immutable` or `kernel.setImmutable(boolean)`: boolean, default = `false`
177
+
*`strictIntegers` or `kernel.setStrictIntegers(boolean)`: boolean, default = `false` - allows undefined argumentTypes and function return values to use strict integer declarations.
0 commit comments