gpu: add foundation for interface

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-06 15:47:27 -07:00 committed by Stephen Gutekanst
parent bf8076918b
commit 414887db2a
8 changed files with 181 additions and 64 deletions

12
gpu/src/Device.zig Normal file
View 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,
};