From f6e1c473fa14a044832381dfc84b1ea60c5dc974 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sat, 30 Jul 2022 19:19:23 -0700 Subject: [PATCH] gpu: implement Dawn textureCreateView Signed-off-by: Stephen Gutekanst --- gpu/src/dawn_impl.zig | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/gpu/src/dawn_impl.zig b/gpu/src/dawn_impl.zig index fb934002..6b599adf 100644 --- a/gpu/src/dawn_impl.zig +++ b/gpu/src/dawn_impl.zig @@ -1118,13 +1118,11 @@ pub const Interface = gpu.Interface(struct { } pub inline fn swapChainGetCurrentTextureView(swap_chain: *gpu.SwapChain) *gpu.TextureView { - _ = swap_chain; - unreachable; + return @ptrCast(*gpu.TextureView, procs.swapChainGetCurrentTextureView.?(@ptrCast(c.WGPUSwapChain, swap_chain))); } pub inline fn swapChainPresent(swap_chain: *gpu.SwapChain) void { - _ = swap_chain; - unreachable; + procs.swapChainPresent.?(@ptrCast(c.WGPUSwapChain, swap_chain)); } pub inline fn swapChainReference(swap_chain: *gpu.SwapChain) void { @@ -1136,9 +1134,10 @@ pub const Interface = gpu.Interface(struct { } pub inline fn textureCreateView(texture: *gpu.Texture, descriptor: ?*const gpu.TextureView.Descriptor) *gpu.TextureView { - _ = texture; - _ = descriptor; - unreachable; + return @ptrCast(*gpu.TextureView, procs.textureCreateView.?( + @ptrCast(c.WGPUTexture, texture), + @ptrCast(*const c.WGPUTextureViewDescriptor, descriptor), + )); } pub inline fn textureDestroy(texture: *gpu.Texture) void {