diff --git a/gpu/src/Surface.zig b/gpu/src/Surface.zig index e56b8eb8..e54e4520 100644 --- a/gpu/src/Surface.zig +++ b/gpu/src/Surface.zig @@ -1,5 +1,7 @@ //! A native WebGPU surface +const Surface = @This(); + // The type erased pointer to the Surface implementation ptr: *anyopaque, vtable: *const VTable, @@ -9,6 +11,14 @@ pub const VTable = struct { release: fn (ptr: *anyopaque) void, }; +pub inline fn reference(surface: Surface) void { + surface.vtable.reference(surface.ptr); +} + +pub inline fn release(surface: Surface) void { + surface.vtable.release(surface.ptr); +} + pub const DescriptorTag = enum { metal_layer, windows_hwnd, @@ -48,6 +58,9 @@ pub const Descriptor = union(DescriptorTag) { }; test "syntax" { + _ = VTable; + _ = reference; + _ = release; _ = DescriptorTag; _ = Descriptor; }