From f59435f0b06da09cb4c8ab1430726c6ed29ec9ad Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 29 Jul 2022 23:00:48 -0700 Subject: [PATCH] gpu: convert *opaque -> opaque for SwapChain Signed-off-by: Stephen Gutekanst --- gpu/src/device.zig | 2 +- gpu/src/instance.zig | 2 +- gpu/src/surface.zig | 6 +++--- gpu/src/swap_chain.zig | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gpu/src/device.zig b/gpu/src/device.zig index 119bfe8e..3b7ec9c4 100644 --- a/gpu/src/device.zig +++ b/gpu/src/device.zig @@ -105,7 +105,7 @@ pub const Device = opaque { return Impl.deviceCreateShaderModule(device, descriptor); } - pub inline fn createSwapChain(device: *Device, surface: ?Surface, descriptor: *const SwapChainDescriptor) SwapChain { + pub inline fn createSwapChain(device: *Device, surface: ?Surface, descriptor: *const SwapChainDescriptor) *SwapChain { return Impl.deviceCreateSwapChain(device, surface, descriptor); } diff --git a/gpu/src/instance.zig b/gpu/src/instance.zig index b0000e76..8c6ace3c 100644 --- a/gpu/src/instance.zig +++ b/gpu/src/instance.zig @@ -11,7 +11,7 @@ pub const Instance = opaque { next_in_chain: ?*const ChainedStruct = null, }; - pub inline fn createSurface(instance: *Instance, descriptor: *const SurfaceDescriptor) Surface { + pub inline fn createSurface(instance: *Instance, descriptor: *const SurfaceDescriptor) *Surface { return Impl.instanceCreateSurface(instance, descriptor); } diff --git a/gpu/src/surface.zig b/gpu/src/surface.zig index 9c09c326..9989af7a 100644 --- a/gpu/src/surface.zig +++ b/gpu/src/surface.zig @@ -1,12 +1,12 @@ const ChainedStruct = @import("types.zig").ChainedStruct; const Impl = @import("interface.zig").Impl; -pub const Surface = *opaque { - pub inline fn reference(surface: Surface) void { +pub const Surface = opaque { + pub inline fn reference(surface: *Surface) void { Impl.surfaceReference(surface); } - pub inline fn release(surface: Surface) void { + pub inline fn release(surface: *Surface) void { Impl.surfaceRelease(surface); } }; diff --git a/gpu/src/swap_chain.zig b/gpu/src/swap_chain.zig index be943809..08be829f 100644 --- a/gpu/src/swap_chain.zig +++ b/gpu/src/swap_chain.zig @@ -6,24 +6,24 @@ const TextureFormat = @import("texture.zig").TextureFormat; const TextureView = @import("texture_view.zig").TextureView; const Impl = @import("interface.zig").Impl; -pub const SwapChain = *opaque { - pub inline fn configure(swap_chain: SwapChain, format: TextureFormat, allowed_usage: TextureUsageFlags, width: u32, height: u32) void { +pub const SwapChain = opaque { + pub inline fn configure(swap_chain: *SwapChain, format: TextureFormat, allowed_usage: TextureUsageFlags, width: u32, height: u32) void { Impl.swapChainConfigure(swap_chain, format, allowed_usage, width, height); } - pub inline fn getCurrentTextureView(swap_chain: SwapChain) TextureView { + pub inline fn getCurrentTextureView(swap_chain: *SwapChain) TextureView { return Impl.swapChainGetCurrentTextureView(swap_chain); } - pub inline fn present(swap_chain: SwapChain) void { + pub inline fn present(swap_chain: *SwapChain) void { Impl.swapChainPresent(swap_chain); } - pub inline fn reference(swap_chain: SwapChain) void { + pub inline fn reference(swap_chain: *SwapChain) void { Impl.swapChainReference(swap_chain); } - pub inline fn release(swap_chain: SwapChain) void { + pub inline fn release(swap_chain: *SwapChain) void { Impl.swapChainRelease(swap_chain); } };