Skip to content

Commit 4fdc44e

Browse files
authored
chore(🐙): minor documentation improvements (#405)
1 parent eb1dc8d commit 4fdc44e

3 files changed

Lines changed: 25 additions & 9 deletions

File tree

apps/docs/content/api/index.mdx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,33 @@ title: Overview
33
description: How this API Reference relates to the standard WebGPU API.
44
---
55

6+
## WebGPU API
7+
68
React Native WebGPU implements the standard [WebGPU API](https://www.w3.org/TR/webgpu/).
79
Types such as `GPUDevice`, `GPUBuffer`, `GPUTexture`, and `GPURenderPipeline` behave exactly as they do on the web, so any code or tutorial written against the WebGPU specification works here unchanged.
810

9-
For that reason, this reference does **not** duplicate the standard WebGPU API.
10-
Re-documenting it would only drift out of date with the specification.
1111
To learn the core API, use the resources below:
1212

1313
- [WebGPU Fundamentals](https://webgpufundamentals.org/): the best place to learn WebGPU from the ground up.
1414
- [MDN WebGPU reference](https://developer.mozilla.org/en-US/docs/Web/API/WebGPU_API): per-type and per-method documentation.
1515
- [WebGPU specification](https://www.w3.org/TR/webgpu/): the authoritative source.
1616

17+
## Core WebGPU concepts
18+
19+
Understanding the foundational WebGPU objects and how they interact is essential to WebGPU development.
20+
Each concept below links to its reference on MDN.
21+
22+
| Concept | Description |
23+
| ------- | ----------- |
24+
| [Instance](https://developer.mozilla.org/en-US/docs/Web/API/GPU) | The entry point to WebGPU, exposed as `navigator.gpu`, granting access to adapters |
25+
| [Adapter](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter) | Represents a specific GPU on the device |
26+
| [Device](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice) | Your logical connection to the GPU where resources are created |
27+
| [Queue](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue) | The mechanism used to submit commands to the GPU |
28+
| [Shader Module](https://developer.mozilla.org/en-US/docs/Web/API/GPUShaderModule) | Your GPU code, written in the WebGPU Shading Language (WGSL) |
29+
| [Pipelines](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPipeline) | Objects describing the entire GPU state (shaders, blending) for a task |
30+
| [Bind Groups](https://developer.mozilla.org/en-US/docs/Web/API/GPUBindGroup) | Ties data buffers (ex: textures) to shaders |
31+
| [Command Encoder](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder) | An object used to build a sequence of GPU commands into a command buffer |
32+
1733
## What this reference covers
1834

1935
This section documents only the additions that are specific to React Native, the surface you will not find in the WebGPU specification:

apps/docs/content/docs/getting-started/installation.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ description: Your first React Native WebGPU App
55

66
React Native WebGPU brings the [WebGPU API](https://www.w3.org/TR/webgpu/) to iOS, Android, macOS, and visionOS using [Dawn](https://dawn.googlesource.com/dawn).
77

8+
## Install the package
9+
10+
```npm
11+
npm i react-native-webgpu
12+
```
13+
814
## Requirements
915

1016
| Package | Version | Required |
@@ -14,12 +20,6 @@ React Native WebGPU brings the [WebGPU API](https://www.w3.org/TR/webgpu/) to iO
1420

1521
Please note that this module does not work on the legacy architecture.
1622

17-
## Install the package
18-
19-
```npm
20-
npm i react-native-webgpu
21-
```
22-
2323
## Setup
2424

2525
Once installed, the global `navigator.gpu` API is available - the same entry point as in Chrome or Safari:

apps/docs/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./.next/types/routes.d.ts";
3+
import "./.next/dev/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

0 commit comments

Comments
 (0)