gpu: add BindGroup.Descriptor slice helper

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-08-16 17:16:52 -07:00
parent 67d07b0c55
commit c3bb1683a6
2 changed files with 21 additions and 0 deletions

View file

@ -163,6 +163,11 @@ The slice helpers are:
* `RenderBundleEncoder.setBindGroup`
* `RenderPassEncoder.setBindGroup`
And, to initialize data structures with slices in them, the following helpers are provided:
* `BindGroupLayout.Descriptor.init`
* `BindGroup.Descriptor.init`
### Typed callbacks
Most WebGPU callbacks provide a way to provide a `userdata: *anyopaque` pointer to the callback for context. We alter these APIs to expose a typed context pointer instead (again, the original API is always available via the `gpu.Impl` type should you want it):