gpu: update interface to latest webgpu headers

This commit is contained in:
Ali Chraghi 2023-01-13 22:30:26 +03:30 committed by Stephen Gutekanst
parent e4f2f08431
commit a52c6e5f5c
11 changed files with 135 additions and 31 deletions

View file

@ -13,6 +13,12 @@ pub const Buffer = opaque {
read_only_storage = 0x00000003,
};
pub const MapState = enum(u32) {
unmapped = 0x00000000,
pending = 0x00000001,
mapped = 0x00000002,
};
pub const MapAsyncStatus = enum(u32) {
success = 0x00000000,
err = 0x00000001,
@ -69,6 +75,10 @@ pub const Buffer = opaque {
Impl.bufferDestroy(buffer);
}
pub inline fn getMapState(buffer: *Buffer) MapState {
return Impl.bufferGetMapState(buffer);
}
/// Default `offset_bytes`: 0
/// Default `len`: `gpu.whole_map_size` / `std.math.maxint(usize)` (whole range)
pub inline fn getConstMappedRange(