[docs] textures: Writing arrays of images to a 3D texture crashes
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- documentation
Research direction
Start with the “Writing arrays of images” section linked in the issue and compare its 3D texture example with the stated WebGPU restriction. Update the example to use a 2D-array texture or add a note that image sources cannot be written to 3D textures. Done means the documentation no longer presents the crashing example as valid.
Written by the indexing model from the issue text.
Description
Docs
This may be me who hasn't understood yet how it works but it seems that the "Writing arrays of images" docs example doesn't work :
const texture3d = root.createTexture({
size: [256, 256, 3],
format: 'rgba8unorm',
dimension: '3d',
}).$usage('sampled');
texture3d.write([imageBitmap1, imageBitmap2, imageBitmap3]); // ↓
WebGPU's copyExternalImageToTexture (used internally by .write()) only accepts 2D textures as destination — dimension: '3d' is invalid by spec, regardless of usage flags.
Workaround
Drop dimension: '3d'. The default creates a 2D-array texture, which works:
const texture3d = root.createTexture({
size: [256, 256, 3],
format: 'rgba8unorm',
}).$usage('sampled', 'render');
texture3d.write([imageBitmap1, imageBitmap2, imageBitmap3]); // ✅
The docs example should be updated to use a 2D-array, or include a note that dimension: '3d' cannot be written from image sources.
Environment
- TypeGPU
0.11.2 - Arc / macOS
- Dominant language
- TypeScript
- Stars
- 3.2k
- Forks
- 123
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 34
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from software-mansion/TypeGPU
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
software-mansion/TypeGPU#3008 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
software-mansion/TypeGPU#2948 · 2 comments ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
software-mansion/TypeGPU#2897 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
software-mansion/TypeGPU#2890 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
software-mansion/TypeGPU#2821 · 1 comment ·
All issues in software-mansion/TypeGPU
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fullcalendar/fullcalendar#8106 ·