gpu: update to latest std.mem.span API

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2023-02-08 02:45:30 -07:00 committed by Stephen Gutekanst
parent af1276d9a8
commit f80e02b7c1
2 changed files with 6 additions and 9 deletions

View file

@ -92,14 +92,13 @@ pub const CommandEncoder = opaque {
command_encoder: *CommandEncoder,
buffer: *Buffer,
buffer_offset_bytes: u64,
data_span: anytype,
data_slice: anytype,
) void {
const data_slice = std.mem.span(data_span);
Impl.commandEncoderWriteBuffer(
command_encoder,
buffer,
buffer_offset_bytes,
@ptrCast([*]const u8, data_slice.ptr),
@ptrCast([*]const u8, std.mem.sliceAsBytes(data_slice).ptr),
@intCast(u64, data_slice.len) * @sizeOf(std.meta.Elem(@TypeOf(data_slice))),
);
}