gpu: add foundation for interface
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
bf8076918b
commit
414887db2a
8 changed files with 181 additions and 64 deletions
12
gpu/src/Device.zig
Normal file
12
gpu/src/Device.zig
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
//! A standard interface to a WebGPU implementation.
|
||||
//!
|
||||
//! Like std.mem.Allocator, but representing a WebGPU implementation.
|
||||
|
||||
// The type erased pointer to the Device implementation
|
||||
ptr: *anyopaque,
|
||||
vtable: *const VTable,
|
||||
|
||||
pub const VTable = struct {
|
||||
// TODO(gpu): make these *const fn once stage2 is released.
|
||||
free: fn (ptr: *anyopaque, buf: []u8, buf_align: u29, ret_addr: usize) void,
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue