gpu: enable slice helpers to take arrays

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-08-11 12:43:34 -07:00 committed by Stephen Gutekanst
parent 3104083143
commit c09b587db9
2 changed files with 6 additions and 3 deletions

View file

@ -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,

View file

@ -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,