gpu: add ExternalTexture.destroy
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
cd2dc0c2e8
commit
3c44baa863
2 changed files with 13 additions and 4 deletions
|
|
@ -8,8 +8,7 @@ vtable: *const VTable,
|
|||
pub const VTable = struct {
|
||||
reference: fn (ptr: *anyopaque) void,
|
||||
release: fn (ptr: *anyopaque) void,
|
||||
// TODO:
|
||||
// WGPU_EXPORT void wgpuExternalTextureDestroy(WGPUExternalTexture externalTexture);
|
||||
destroy: fn (ptr: *anyopaque) void,
|
||||
setLabel: fn (ptr: *anyopaque, label: [:0]const u8) void,
|
||||
};
|
||||
|
||||
|
|
@ -25,8 +24,13 @@ pub inline fn setLabel(texture: ExternalTexture, label: [:0]const u8) void {
|
|||
texture.vtable.setLabel(texture.ptr, label);
|
||||
}
|
||||
|
||||
pub inline fn destroy(texture: ExternalTexture) void {
|
||||
texture.vtable.destroy(texture.ptr);
|
||||
}
|
||||
|
||||
test "syntax" {
|
||||
_ = VTable;
|
||||
_ = reference;
|
||||
_ = release;
|
||||
_ = destroy;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue