gpu: implement Adapter.reference, Adapter.release

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-07 20:17:41 -07:00 committed by Stephen Gutekanst
parent 77b16a3671
commit a1c9fe6897
2 changed files with 22 additions and 3 deletions

View file

@ -210,7 +210,18 @@ fn wrapAdapter(adapter: c.WGPUAdapter) Adapter {
};
}
const adapter_vtable = Adapter.VTable{};
const adapter_vtable = Adapter.VTable{
.reference = (struct {
pub fn reference(ptr: *anyopaque) void {
c.wgpuAdapterReference(@ptrCast(c.WGPUAdapter, ptr));
}
}).reference,
.release = (struct {
pub fn release(ptr: *anyopaque) void {
c.wgpuAdapterRelease(@ptrCast(c.WGPUAdapter, ptr));
}
}).release,
};
// TODO: implement Device interface