From c09b587db983896d28c3e90cd647582bc7467d78 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Thu, 11 Aug 2022 12:43:34 -0700 Subject: [PATCH] gpu: enable slice helpers to take arrays Signed-off-by: Stephen Gutekanst --- gpu/src/command_encoder.zig | 3 ++- gpu/src/queue.zig | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gpu/src/command_encoder.zig b/gpu/src/command_encoder.zig index 2268a227..165f265c 100644 --- a/gpu/src/command_encoder.zig +++ b/gpu/src/command_encoder.zig @@ -86,8 +86,9 @@ pub const CommandEncoder = opaque { command_encoder: *CommandEncoder, buffer: *Buffer, buffer_offset_bytes: u64, - data_slice: anytype, + data_span: anytype, ) void { + const data_slice = std.mem.span(data_span); Impl.commandEncoderWriteBuffer( command_encoder, buffer, diff --git a/gpu/src/queue.zig b/gpu/src/queue.zig index 25fb18d1..c2d1d483 100644 --- a/gpu/src/queue.zig +++ b/gpu/src/queue.zig @@ -58,8 +58,9 @@ pub const Queue = opaque { queue: *Queue, buffer: *Buffer, buffer_offset_bytes: u64, - data_slice: anytype, + data_span: anytype, ) void { + const data_slice = std.mem.span(data_span); Impl.queueWriteBuffer( queue, buffer, @@ -74,8 +75,9 @@ pub const Queue = opaque { destination: *const ImageCopyTexture, data_layout: *const Texture.DataLayout, write_size: *const Extent3D, - data_slice: anytype, + data_span: anytype, ) void { + const data_slice = std.mem.span(data_span); Impl.queueWriteTexture( queue, destination,