From 556c917a08c8723ab850e0a3559bf78ef6c30f78 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sat, 30 Jul 2022 17:20:01 -0700 Subject: [PATCH] gpu: implement Dawn deviceCreateSwapChain Signed-off-by: Stephen Gutekanst --- gpu/src/dawn_impl.zig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gpu/src/dawn_impl.zig b/gpu/src/dawn_impl.zig index bbbeb770..63b8211a 100644 --- a/gpu/src/dawn_impl.zig +++ b/gpu/src/dawn_impl.zig @@ -504,10 +504,11 @@ pub const Interface = gpu.Interface(struct { } pub inline fn deviceCreateSwapChain(device: *gpu.Device, surface: ?*gpu.Surface, descriptor: *const gpu.SwapChain.Descriptor) *gpu.SwapChain { - _ = device; - _ = surface; - _ = descriptor; - unreachable; + return @ptrCast(*gpu.SwapChain, procs.deviceCreateSwapChain.?( + @ptrCast(c.WGPUDevice, device), + @ptrCast(c.WGPUSurface, surface), + @ptrCast(*const c.WGPUSwapChainDescriptor, descriptor), + )); } pub inline fn deviceCreateTexture(device: *gpu.Device, descriptor: *const gpu.Texture.Descriptor) *gpu.Texture {