Conversation
|
pkg.pr.new packages benchmark commit |
📊 Bundle Size Comparison
👀 Notable resultsStatic test results:No major changes. Dynamic test results:No major changes. 📋 All resultsClick to reveal the results table (344 entries).
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu. |
There was a problem hiding this comment.
Pull request overview
This PR adds a new documentation page covering Accessors — TypeGPU's schema-aware typed placeholders for GPU resources. It explains how accessors differ from slots when referencing GPU resources in reusable functions, and includes code examples with their corresponding WGSL output for all supported binding types.
Changes:
- New
accessors.mdxdocumentation page covering basic usage, supported binding types, deep/nested property access, mutable accessors, and a comparison table with slots and bind groups. - Navigation entry for the new Accessors page added to the sidebar in
astro.config.mjs, placed after "Slots".
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
apps/typegpu-docs/src/content/docs/fundamentals/accessors.mdx |
New documentation page for the Accessors API, with TypeScript and WGSL examples |
apps/typegpu-docs/astro.config.mjs |
Adds the "Accessors" sidebar navigation entry after "Slots" |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| **Choose bind groups** when you need to swap resources at runtime without changing the compiled shader — the classic WebGPU pattern for per-frame or per-draw-call resource binding. | ||
|
|
||
| :::note | ||
| Accessors and slots operate at **compile time**: the WGSL output reflects which buffer or variable was bound. |
There was a problem hiding this comment.
Actually, why is that? What stops the following from working?
const slot = tgpu.slot(5);
const fn = tgpu.fn([])(() => {
return slot.$;
});
console.log(fn());
cieplypolar
left a comment
There was a problem hiding this comment.
Very nice, very cool, very comprehensive. Left one nit. ![]()
Co-authored-by: Szymon Szulc <103948576+cieplypolar@users.noreply.github.com>
No description provided.