-
Notifications
You must be signed in to change notification settings - Fork 105
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
Upgrade to latest webgpu headers #445
Open
eliemichel
wants to merge
31
commits into
gfx-rs:trunk
Choose a base branch
from
eliemichel:eliemichel/2024-11-12-upgrade-webgpu-headers
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Upgrade to latest webgpu headers #445
eliemichel
wants to merge
31
commits into
gfx-rs:trunk
from
eliemichel:eliemichel/2024-11-12-upgrade-webgpu-headers
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This goes up to webgpu-native/webgpu-headers@2b59747 Things I *didn't* do: * I didn't update the library to make sure "instance dropped" callback error codes are guaranteed to happen, like they seem to be in Dawn. List of changes (roughly in order of header commits): Various enum and struct renames Updated callbacks to use the new *CallbackInfo structs and 2-userdata system. Also updated functions to return WGPUFuture, though the WGPUFuture thing is just stubbed out at the moment as I don't think wgpu-core has the necessary functionality for it. wgpuInstanceWaitAny is unimplemented!() DepthClipControl merged into PrimitiveState, related code simplified. Updated depthWriteEnabled to use an optional bool, mostly matters due to added validation. Add TODOs for missing features (sliced 3D compressed textures) *Reference() became *AddRef() Added unorm10-10-10-2 vertex format Usage field in TextureViewDescriptor, just used for validation as wgpu-core doesn't allow specifying it anyways. Removed maxInterStageShaderComponents Added clang_macro_fallback to bindgen config, since the headers switched to using UINT32_MAX etc. UINT64_MAX still doesn't work so I had to manually define those. Renamed flags enums. Added a conversion helper function to convert them from u64 -> u32 for mapping. (means added direct dependency on bitflags crate) Removed device argument from (unimplemented) wgpuGetProcAddress Suboptimal surface texture acquisition moved to enum return value, was easy since wgpu-core already returns it like that. "Undefined" present mode added, it just selects FIFO.
This enum was replaced with WGPUMapAsyncStatus, but I didn't quite notice. The error codes map different.
Replaces *EnumerateFeatures with *GetFeatures. Also fixes CI due to fix in headers.
Upstream removed the "Flags" suffix from flags types and moved them to no longer be C enums. This matches that change. WGPUInstanceFlag still has "Flag" in the name because, well, there'd be nothing left to distinguish it from WGPUInstance, and it makes sense for it.
Also updates wgpu.h to use WGPUStringView everywhere.
All stubs, since we don't have WaitAny at the moment.
Update to webgpu-native/webgpu-headers@f1cdc3f Also went through a bunch of existing enum conversions and fixed up some seemingly spec-incorrect cases of undefined enums not being handled properly. As part of this, I made a new helper map_enum_with_undefined!() which distinguishes undefined and unknown enum values. Previously, much code relied on undefined being caught in the same net as an unknown value. This is no longer the case.
This updates the headers to webgpu-native/webgpu-headers@af63d34 These changes are exclusively in the header enum values, so no Rust code needs changing. Making this a separate commit for easier review.
Update headers to webgpu-native/webgpu-headers@b7656d0 Adds dual source blending. Other two features (float32 blendable and clip distances feature in wgsl) are not supported by wgpu. Also made map_blend_factor use the shorter macro form, as all the enum names match (they didn't 3 years ago when this code was originally written, according to Git history).
Oops that's not how these chained structs work.
Updates headers to webgpu-native/webgpu-headers@6f549cc Also made matching changes to wgpu.h
Build available in this release: v23.0.0-beta @ eliemichel/wgpu-native |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This builds on top of #441 (which upgrades
wgpu-core
to v23.0.0), as well as the commits added to #427 after it was forked.webgpu.h
(@PJB3005 did all the heavy work, thanks!).unimplemented.rs
needs to be double checked.