From c13097cae6a62ba80760b8a45c55a2fbeddb8d26 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Tue, 8 Mar 2022 23:46:14 -0700 Subject: [PATCH] gpu: fix descriptor parameter type to nativeCreateSwapChain Signed-off-by: Stephen Gutekanst --- gpu/src/Device.zig | 4 ++-- gpu/src/NativeInstance.zig | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gpu/src/Device.zig b/gpu/src/Device.zig index f8985c94..949627f7 100644 --- a/gpu/src/Device.zig +++ b/gpu/src/Device.zig @@ -37,7 +37,7 @@ pub const VTable = struct { // WGPU_EXPORT void wgpuDeviceCreateRenderPipelineAsync(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallback callback, void * userdata); // WGPU_EXPORT WGPUSampler wgpuDeviceCreateSampler(WGPUDevice device, WGPUSamplerDescriptor const * descriptor); createShaderModule: fn (ptr: *anyopaque, descriptor: *const ShaderModule.Descriptor) ShaderModule, - nativeCreateSwapChain: fn (ptr: *anyopaque, surface: ?Surface, descriptor: SwapChain.Descriptor) SwapChain, + nativeCreateSwapChain: fn (ptr: *anyopaque, surface: ?Surface, descriptor: *const SwapChain.Descriptor) SwapChain, // WGPU_EXPORT WGPUTexture wgpuDeviceCreateTexture(WGPUDevice device, WGPUTextureDescriptor const * descriptor); // WGPU_EXPORT void wgpuDeviceDestroy(WGPUDevice device); // WGPU_EXPORT size_t wgpuDeviceEnumerateFeatures(WGPUDevice device, WGPUFeatureName * features); @@ -73,7 +73,7 @@ pub inline fn createShaderModule(device: Device, descriptor: *const ShaderModule return device.vtable.createShaderModule(device.ptr, descriptor); } -pub inline fn nativeCreateSwapChain(device: Device, surface: ?Surface, descriptor: SwapChain.Descriptor) SwapChain { +pub inline fn nativeCreateSwapChain(device: Device, surface: ?Surface, descriptor: *const SwapChain.Descriptor) SwapChain { return device.vtable.nativeCreateSwapChain(device.ptr, surface, descriptor); } diff --git a/gpu/src/NativeInstance.zig b/gpu/src/NativeInstance.zig index 54edf1d4..e67dd1cd 100644 --- a/gpu/src/NativeInstance.zig +++ b/gpu/src/NativeInstance.zig @@ -343,7 +343,7 @@ const device_vtable = Device.VTable{ } }).createShaderModule, .nativeCreateSwapChain = (struct { - pub fn nativeCreateSwapChain(ptr: *anyopaque, surface: ?Surface, descriptor: SwapChain.Descriptor) SwapChain { + pub fn nativeCreateSwapChain(ptr: *anyopaque, surface: ?Surface, descriptor: *const SwapChain.Descriptor) SwapChain { const desc = c.WGPUSwapChainDescriptor{ .nextInChain = null, .label = if (descriptor.label) |l| @ptrCast([*c]const u8, l) else null,