Skip to content

Docs: wgpuDeviceCreateBuffer returns null if mapAtCreation fails#477

Merged
kainino0x merged 3 commits intowebgpu-native:mainfrom
kainino0x:docs-createbuffer-nullable
Jan 3, 2025
Merged

Docs: wgpuDeviceCreateBuffer returns null if mapAtCreation fails#477
kainino0x merged 3 commits intowebgpu-native:mainfrom
kainino0x:docs-createbuffer-nullable

Conversation

@kainino0x
Copy link
Collaborator

Issue: #57

@kainino0x kainino0x requested a review from lokokung December 21, 2024 02:03
@kainino0x kainino0x enabled auto-merge (squash) January 3, 2025 02:31
@kainino0x kainino0x merged commit 96aa4c7 into webgpu-native:main Jan 3, 2025
5 checks passed
@kainino0x kainino0x deleted the docs-createbuffer-nullable branch January 3, 2025 02:37
@kainino0x kainino0x added the needs docs Non-trivial API contract needs to be documented. Orthogonal to open vs closed; remove when doc'd. label Mar 4, 2025
@kainino0x
Copy link
Collaborator Author

kainino0x commented Mar 4, 2025

We should also specify either that there's an out-of-memory error scope error, or implementation-defined logging, even though it's the only thing that can cause createBuffer to return null (at least for now). Adding needs docs to do this.

@kainino0x
Copy link
Collaborator Author

I don't think it should be an out-of-memory error because the JS spec doesn't produce one in this case. It just throws a RangeError from createBuffer(). https://gpuweb.github.io/gpuweb/#dom-gpudevice-createbuffer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs docs Non-trivial API contract needs to be documented. Orthogonal to open vs closed; remove when doc'd.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants