diff --git a/gpu/README.md b/gpu/README.md index d29d2fd2..a5109c8f 100644 --- a/gpu/README.md +++ b/gpu/README.md @@ -221,6 +221,7 @@ The following are definitive candidates for helpers we haven't implemented yet: * `gpu.Device.enumerateFeatures` (owned slice) * `gpu.Queue.writeBuffer` (slices) * `gpu.Queue.writeTexture` (slices) +* `gpu.Queue.submit` (slice param) * `gpu.RenderBundleEncoder.setBindGroup` (slice param) * `gpu.RenderPassEncoder.executeBundles` (slice param) * `gpu.RenderPassEncoder.setBindGroup` (slice param) diff --git a/gpu/src/dawn_impl.zig b/gpu/src/dawn_impl.zig index b88813a0..28d2b5ef 100644 --- a/gpu/src/dawn_impl.zig +++ b/gpu/src/dawn_impl.zig @@ -738,11 +738,11 @@ pub const Interface = struct { procs.queueSetLabel.?(@ptrCast(c.WGPUQueue, queue), label); } - pub inline fn queueSubmit(queue: *gpu.Queue, command_count: u32, commands: [*]*gpu.CommandBuffer) void { + pub inline fn queueSubmit(queue: *gpu.Queue, command_count: u32, commands: [*]*const gpu.CommandBuffer) void { procs.queueSubmit.?( @ptrCast(c.WGPUQueue, queue), command_count, - @ptrCast([*]c.WGPUCommandBuffer, commands), + @ptrCast([*]const c.WGPUCommandBuffer, commands), ); } diff --git a/gpu/src/interface.zig b/gpu/src/interface.zig index 1ca27be6..0945bde8 100644 --- a/gpu/src/interface.zig +++ b/gpu/src/interface.zig @@ -136,7 +136,7 @@ pub fn Interface(comptime T: type) type { assertDecl(T, "queueCopyTextureForBrowser", fn (queue: *gpu.Queue, source: *const gpu.ImageCopyTexture, destination: *const gpu.ImageCopyTexture, copy_size: *const gpu.Extent3D, options: *const gpu.CopyTextureForBrowserOptions) callconv(.Inline) void); assertDecl(T, "queueOnSubmittedWorkDone", fn (queue: *gpu.Queue, signal_value: u64, callback: gpu.Queue.WorkDoneCallback, userdata: ?*anyopaque) callconv(.Inline) void); assertDecl(T, "queueSetLabel", fn (queue: *gpu.Queue, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(T, "queueSubmit", fn (queue: *gpu.Queue, command_count: u32, commands: [*]*gpu.CommandBuffer) callconv(.Inline) void); + assertDecl(T, "queueSubmit", fn (queue: *gpu.Queue, command_count: u32, commands: [*]*const gpu.CommandBuffer) callconv(.Inline) void); assertDecl(T, "queueWriteBuffer", fn (queue: *gpu.Queue, buffer: *gpu.Buffer, buffer_offset: u64, data: *anyopaque, size: usize) callconv(.Inline) void); assertDecl(T, "queueWriteTexture", fn (queue: *gpu.Queue, destination: *const gpu.ImageCopyTexture, data: *const anyopaque, data_size: usize, data_layout: *const gpu.Texture.DataLayout, write_size: *const gpu.Extent3D) callconv(.Inline) void); assertDecl(T, "queueReference", fn (queue: *gpu.Queue) callconv(.Inline) void); @@ -826,7 +826,7 @@ pub fn Export(comptime T: type) type { } // WGPU_EXPORT void wgpuQueueSubmit(WGPUQueue queue, uint32_t commandCount, WGPUCommandBuffer const * commands); - export fn wgpuQueueSubmit(queue: *gpu.Queue, command_count: u32, commands: [*]*gpu.CommandBuffer) void { + export fn wgpuQueueSubmit(queue: *gpu.Queue, command_count: u32, commands: [*]*const gpu.CommandBuffer) void { T.queueSubmit(queue, command_count, commands); } @@ -1952,7 +1952,7 @@ pub const StubInterface = Interface(struct { unreachable; } - pub inline fn queueSubmit(queue: *gpu.Queue, command_count: u32, commands: [*]*gpu.CommandBuffer) void { + pub inline fn queueSubmit(queue: *gpu.Queue, command_count: u32, commands: [*]*const gpu.CommandBuffer) void { _ = queue; _ = command_count; _ = commands; diff --git a/gpu/src/queue.zig b/gpu/src/queue.zig index 2b5005d3..9c43cae9 100644 --- a/gpu/src/queue.zig +++ b/gpu/src/queue.zig @@ -49,7 +49,7 @@ pub const Queue = opaque { Impl.queueSetLabel(queue, label); } - pub inline fn submit(queue: *Queue, command_count: u32, commands: [*]*CommandBuffer) void { + pub inline fn submit(queue: *Queue, command_count: u32, commands: [*]*const CommandBuffer) void { Impl.queueSubmit(queue, command_count, commands); }