wgpu-native icon indicating copy to clipboard operation
wgpu-native copied to clipboard

Update library to latest webgpu-native headers

Open PJB3005 opened this issue 1 year ago • 7 comments

This goes up to https://github.com/webgpu-native/webgpu-headers/commit/6f549cc3409663303b06f50483b9ebf9d1cf19dd 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.
  • *EnumerateFeatures() has been replaced with *GetFeatures().
  • All strings are now passed as WGPUStringView.

PJB3005 avatar Sep 19 '24 15:09 PJB3005

Remaining Windows CI failure is caused by https://github.com/webgpu-native/webgpu-headers/issues/339

PJB3005 avatar Sep 19 '24 16:09 PJB3005

For WGPUFuture, we need to have access to submission index (and return that in the future's id). Here is the beginning of an attempt at adding this upstream: https://github.com/gfx-rs/wgpu/pull/6360

eliemichel avatar Oct 03 '24 07:10 eliemichel

FYI I started trying to build upon this PR and upgrade wgpu to my PR that adds submission indices for futures, WIP is here: https://github.com/eliemichel/wgpu-native/tree/eliemichel/2024-10-10-upgrade-wgpu-futures

Ongoing work: I need to figure out what replaced the DynComputePass and DynRenderPass types in newest wgpu.

eliemichel avatar Oct 10 '24 07:10 eliemichel

There is a missing fonction wgpuGetInstanceFeatures on the rust code but describe on yaml as :

  - name: get_instance_features
    doc: Query the supported instance features
    args:
      - name: features
        doc: The supported instance features
        type: struct.instance_features
        pointer: mutable

ygdrasil-io avatar Oct 13 '24 14:10 ygdrasil-io

FYI I started trying to build upon this PR and upgrade wgpu

This is now ready, PR: #441

eliemichel avatar Oct 13 '24 22:10 eliemichel

@ygdrasil-io done, thanks for pointing that out. Though note it's not very useful since WaitAny isn't implemented yet.

PJB3005 avatar Oct 19 '24 14:10 PJB3005

@rajveermalviya Any specific reason why this PR is on hold? (You not having had time to review it yet is a perfectly fine reason, just trying to figure out if there is a technical blocker I could help with!)

eliemichel avatar Oct 20 '24 16:10 eliemichel

Merged latest commits into #441 and did some extra upgrade of webgpu.h, leading to #445, still hoping for this to get merged!

eliemichel avatar Nov 12 '24 23:11 eliemichel

Closing since the other PR was merged.

PJB3005 avatar Feb 25 '25 02:02 PJB3005