-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(core): Rename api to core (#1783)
- Loading branch information
Showing
374 changed files
with
989 additions
and
737 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,48 @@ | ||
# Core API | ||
# Overview | ||
|
||
The core module exports the `@luma.gl/api`. | ||
The `@luma.gl/core` module provides an abstract API that enables application code | ||
to portably work with both WebGPU and WebGL. The main export is the `Device` class | ||
which provides methods for creating GPU resources such as `Buffer`, `Texture`, `Shader` etc. | ||
|
||
## Installing adapters | ||
|
||
The `@luma.gl/core` module is not usable on its own. A device adapter module must | ||
be imported and registered. | ||
|
||
```typescript | ||
import {luma} from '@luma.gl/core'; | ||
import {WebGPUAdapter} from '@luma.gl/webgpu'; | ||
|
||
luma.registerDevice([WebGPUAdapter]) | ||
const device = await luma.createDevice({type: 'webgpu', canvas: ...}); | ||
``` | ||
|
||
It is possible to register more than one device adapter to create an application | ||
that can work in both WebGL and WebGPU environments. | ||
|
||
```typescript | ||
luma.registerDevice([WebGPUAdapter]) | ||
import {luma} from '@luma.gl/core'; | ||
import {WebGPUAdapter} from '@luma.gl/webgpu'; | ||
import {WebGLAdapter} '@luma.gl/webgl'; | ||
|
||
const webgpuDevice = luma.createDevice({type: 'best-available', canvas: ...}); | ||
``` | ||
## Creating GPU Resources | ||
Once the application has created a `Device`, GPU resources can be created: | ||
```typescript | ||
const buffer = device.createBuffer(...) | ||
``` | ||
## Accessing the CanvasContext | ||
A `Device` may (optinally) be used to render in one or more canvases (HTML canvas elements). | ||
The connection between a Device and a canvas is managed by the `CanvasContext` class. | ||
:::info | ||
In WebGL there is always exactly one canvas associated with the device and it is not | ||
possible to create a canvas-less context or render into multiple contexts. | ||
::: |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.