Skip to content

Modified Webgpu to work with the stable webgpu-header.#536

Open
jalexcole wants to merge 13 commits intogfx-rs:trunkfrom
jalexcole:webgpu-header-1.0
Open

Modified Webgpu to work with the stable webgpu-header.#536
jalexcole wants to merge 13 commits intogfx-rs:trunkfrom
jalexcole:webgpu-header-1.0

Conversation

@jalexcole
Copy link

I updated the header file to latest, and patched the lib and wgpu.h file in order to pass cargo test.

@jalexcole
Copy link
Author

Need help with the GitHub actions:
Android requires: bits/libc-header-start.h
IOS requires: math.h
Windows i686 requires: math.h

@kolkov
Copy link
Contributor

kolkov commented Mar 2, 2026

Thanks for working on this @jalexcole — getting the headers updated is the most impactful thing for the ecosystem right now. A few technical observations:

Instance API

The new webgpu.h replaces wgpuGetInstanceCapabilities with two separate functions:

  • void wgpuGetInstanceFeatures(WGPUSupportedInstanceFeatures * features)
  • WGPUStatus wgpuGetInstanceLimits(WGPUInstanceLimits * limits)

Currently the PR keeps the old function name wgpuGetInstanceCapabilities and changes the parameter type to WGPUInstanceLimits, but the header no longer declares wgpuGetInstanceCapabilities — so downstream projects linking against the new header won't find that symbol. It would need to be renamed to wgpuGetInstanceLimits, and wgpuGetInstanceFeatures would need an implementation (or at least an unimplemented!() stub).

Related stubs that the new header expects:

  • wgpuHasInstanceFeature
  • wgpuSupportedInstanceFeaturesFreeMembers
  • wgpuBufferReadMappedRange / wgpuBufferWriteMappedRange

InstanceDescriptor

The wgpuCreateInstance implementation checks requiredLimits via raw pointer, which looks correct. requiredFeatures / requiredFeatureCount are not handled yet — might be fine to ignore for now since no features are supported, but worth a comment in the code.

CI

Per @almarklein's suggestion, disabling the failing platforms to unblock this sounds right.

Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! Can you brin it up to date with latest main and we'll get it merged!

@jalexcole
Copy link
Author

@cwfitzgerald Up to date.

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.

3 participants