Skip to content

gpu: plan for making gpu.Interface more generic, compatible with WASM implementations #676

@emidoots

Description

@emidoots

In summary (notes for myself for later):

  • gpu.Interface should aim to reflect dawn.json excluding Dawn-specific methods (not super urgent, but we should make this change sometime), as this is what webgpu.h has standardized on effectively. The only true standard is that what is in the web API, as it's likely to generally be a subset of native functionality. We can capture the standard web+native APIs in one unified gpu.Interface I believe.
  • gpu.Interface should have destroy and release methods for objects, but NOT reference, there is webgpu-native discussion about this reasoning but primarily it is a place where standardization has yet to happen. Regardless we would need this for correctness, and seems to be the way standardization is going.
  • Non-standard (Dawn-specific, Mach-specific, Crescent-specific, etc.) methods should be exposable via a gpu.Interface implementation, it only guarantees a standard set of methods is available not that more do not exist. Comptime checks can test if an implementation supports custom methods.
  • We will add Mach-specific methods (for now just ability to choose adapter) to mach/gpu-dawn, implemented in our Dawn fork and part of the emitted webgpu.h / dawn.json info. In the future could be things like raytracing etc that we haven't gotten upstreamed (or they don't want to upstream) yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions