gpu: implement Device.createTexture

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-18 17:56:09 -07:00 committed by Stephen Gutekanst
parent 418d379f1c
commit 85d5de1077
3 changed files with 16 additions and 2 deletions

View file

@ -444,6 +444,14 @@ const device_vtable = Device.VTable{
));
}
}).nativeCreateSwapChain,
.createTexture = (struct {
pub fn createTexture(ptr: *anyopaque, descriptor: *const Texture.Descriptor) Texture {
return wrapTexture(c.wgpuDeviceCreateTexture(
@ptrCast(c.WGPUDevice, ptr),
@ptrCast(*const c.WGPUTextureDescriptor, descriptor),
));
}
}).createTexture,
.destroy = (struct {
pub fn destroy(ptr: *anyopaque) void {
c.wgpuDeviceDestroy(@ptrCast(c.WGPUDevice, ptr));