gpu: update README to reflect handle methods strategy
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
c3cc9d5ae2
commit
3c8dfa06a1
1 changed files with 3 additions and 1 deletions
|
|
@ -94,7 +94,9 @@ When updating, every single change is verified against [the WebGPU spec itself](
|
|||
|
||||
The rules for translating `webgpu.h` are as follows:
|
||||
|
||||
* `WGPUBuffer` -> `gpu.Buffer` (opaque pointer types only go into their own `Buffer.zig` file, with a `ptr: *anyopaque` field.)
|
||||
* `WGPUBuffer` -> `gpu.Buffer`:
|
||||
* Handles like these become a `pub const Buffer = enum(usize) {_}` to ensure they are still pointers compatible with the C ABI, while still allowing us to declare methods on them.
|
||||
* As a result, `null` is represented as `gpu.Buffer.none` which is defined as `pub const none: Buffer = @intToEnum(Buffer, 0);` iff the type can be nullable.g
|
||||
* `WGPUBufferBindingType` -> `gpu.Buffer.BindingType` (purely because it's prefix matches an opaque pointer type, it thus goes into that file.)
|
||||
* Reserved Zig keywords:
|
||||
* `undefined` -> `undef`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue