gpu: add ExternalTexture.destroy

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-11 13:23:47 -07:00 committed by Stephen Gutekanst
parent cd2dc0c2e8
commit 3c44baa863
2 changed files with 13 additions and 4 deletions

View file

@ -379,7 +379,7 @@ const device_vtable = Device.VTable{
}).nativeCreateSwapChain,
.destroy = (struct {
pub fn destroy(ptr: *anyopaque) void {
c.wgpuDeviceDestroy(@ptrCast(c.WGPUDestroy, ptr));
c.wgpuDeviceDestroy(@ptrCast(c.WGPUDevice, ptr));
}
}).destroy,
};
@ -766,6 +766,11 @@ const external_texture_vtable = ExternalTexture.VTable{
c.wgpuExternalTextureSetLabel(@ptrCast(c.WGPUExternalTexture, ptr), label);
}
}).setLabel,
.destroy = (struct {
pub fn destroy(ptr: *anyopaque) void {
c.wgpuExternalTextureDestroy(@ptrCast(c.WGPUExternalTexture, ptr));
}
}).destroy,
};
fn wrapBindGroup(group: c.WGPUBindGroup) BindGroup {
@ -843,7 +848,7 @@ const buffer_vtable = Buffer.VTable{
}).setLabel,
.destroy = (struct {
pub fn destroy(ptr: *anyopaque) void {
c.wgpuBufferDestroy(@ptrCast(c.WGPUDestroy, ptr));
c.wgpuBufferDestroy(@ptrCast(c.WGPUBuffer, ptr));
}
}).destroy,
};