gpu: implement NativeInstance.createSurface

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-06 21:27:37 -07:00 committed by Stephen Gutekanst
parent 89b1f31de8
commit 368f53ece1
3 changed files with 105 additions and 68 deletions

View file

@ -1,5 +1,14 @@
//! A native WebGPU surface
// The type erased pointer to the Surface implementation
ptr: *anyopaque,
vtable: *const VTable,
pub const VTable = struct {
reference: fn (ptr: *anyopaque) void,
release: fn (ptr: *anyopaque) void,
};
pub const DescriptorTag = enum {
metal_layer,
windows_hwnd,
@ -37,3 +46,8 @@ pub const Descriptor = union(DescriptorTag) {
selector: []const u8,
},
};
test "syntax" {
_ = DescriptorTag;
_ = Descriptor;
}