Skip to content

Proposal: remove WGPUVertexStepMode_VertexBufferNotUsed, with 1:1 mapping to JS #439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 2, 2024

Conversation

kainino0x
Copy link
Collaborator

@kainino0x kainino0x commented Nov 26, 2024

I realized that there was actually no good way to paper over the difference between the C API we had proposed, and the current JS API.

This draft finds a compromise that does work: it distinguishes between WGPUVertexStepMode_Undefined and WGPUVertexStepMode_Vertex if .attributeCount == 0.

In other words, the sentinel is
{.stepMode=Undefined, .attributeCount=0} instead of just
{.stepMode=VertexBufferNotUsed}, or just
{.attributeCount=0}.

Notably, this is flexible to whatever JS does in gpuweb/gpuweb#4999
since it can still represent both null and { stepMode: whatever, attributes: [] }.

Fixes #432
(dawn bug https://crbug.com/383147017)

@kainino0x kainino0x changed the title Remove WGPUVertexStepMode_VertexBufferNotUsed Proposal: remove WGPUVertexStepMode_VertexBufferNotUsed, with 1:1 mapping to JS Nov 27, 2024
@kainino0x kainino0x marked this pull request as ready for review November 27, 2024 23:30
@kainino0x kainino0x requested a review from lokokung November 27, 2024 23:34
@kainino0x
Copy link
Collaborator Author

I think this is sound and reasonable and would like to merge it tentatively (with #432 still on the agenda to discuss). PTAL

@kainino0x kainino0x enabled auto-merge (squash) December 2, 2024 21:44
@kainino0x kainino0x merged commit 73d0ce3 into webgpu-native:main Dec 2, 2024
5 checks passed
@kainino0x kainino0x deleted the vertex-buffer-hole branch December 2, 2024 21:45
copybara-service bot pushed a commit to google/dawn that referenced this pull request Dec 18, 2024
Spec PR: webgpu-native/webgpu-headers#439

Bug: 383147017
Change-Id: Ice767dc0de53f85c69b77fd3ea0d6732c86da39d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/219814
Commit-Queue: Fr <beaufort.francois@gmail.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
aarongable pushed a commit to chromium/chromium that referenced this pull request Dec 20, 2024
Spec PR: webgpu-native/webgpu-headers#439

Bug: 383147017
Change-Id: Idffb2d98a0c4f64281b4800225acadb7e3df59a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6097797
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Fr <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/main@{#1399127}
hubot pushed a commit to google/skia that referenced this pull request Dec 24, 2024
Spec PR: webgpu-native/webgpu-headers#439

Bug: 383147017
Change-Id: I1a8e84c8900b3e2d29c36ddb1732b1d6c54aedde
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/931016
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
copybara-service bot pushed a commit to google/dawn that referenced this pull request Jan 3, 2025
Spec PR: webgpu-native/webgpu-headers#439

Bug: 383147017
Change-Id: I3bde3b146c1de31e5ea39f76286e4967e7c2320c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/216675
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Fr <beaufort.francois@gmail.com>
copybara-service bot pushed a commit to google/dawn that referenced this pull request Jan 6, 2025
Spec PR: webgpu-native/webgpu-headers#439

Bug: 383147017
Change-Id: If8761986ce0e02b4d37785480f145bceb479e525
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/221154
Commit-Queue: Fr <beaufort.francois@gmail.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use attributeCount=0 as sentinel instead of VertexBufferNotUsed?
2 participants