Skip to content

Commit 697c112

Browse files
Closes #299
Add documentation for sharing canvas and contexts.
1 parent 1bb6304 commit 697c112

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ Or alternatively you can experiment around with the [kernel playground here](htt
3939
# Table of Contents
4040

4141
* [Installation](#installation)
42-
* [Options](#options)
42+
* [`GPU` Options](#gpu-options)
43+
* [`gpu.createKernel` Options](#gpu-createkernel-options)
4344
* [Creating and Running Functions](#creating-and-running-functions)
4445
* [Accepting Input](#accepting-input)
4546
* [Graphical Output](#graphical-output)
@@ -87,7 +88,12 @@ In JavaScript, initialize the library:
8788
const gpu = new GPU();
8889
```
8990

90-
## Options
91+
## `GPU` Options
92+
Options are an object used to create an instance of `GPU`. Example: `new GPU(options)`
93+
* `canvas`: `HTMLCanvasElement`. Optional. For sharing canvas. Example: use THREE.js and GPU.js on same canvas.
94+
* `webGl`: `WebGL2RenderingContext` or `WebGLRenderingContext`. For sharing rendering context. Example: use THREE.js and GPU.js on same rendering context.
95+
96+
## `gpu.createKernel` Options
9197
Options are an object used to create a `kernel` or `kernelMap`. Example: `gpu.createKernel(options)`
9298
* `output`: array or object that describes the output of kernel.
9399
* as array: `[width]`, `[width, height]`, or `[width, height, depth]`
@@ -104,7 +110,8 @@ Options are an object used to create a `kernel` or `kernelMap`. Example: `gpu.c
104110
* nativeFunctions: object
105111
* subKernels: array
106112
* outputImmutable: boolean
107-
* default to false`
113+
* default to `false`
114+
108115

109116

110117
## Creating and Running Functions

0 commit comments

Comments
 (0)