From 2b994d6b241358df0eddd7a6dd66b00beab4a5c1 Mon Sep 17 00:00:00 2001 From: iddev5 Date: Sat, 21 May 2022 23:51:23 +0530 Subject: [PATCH] gpu: Fix build in 32-bit platforms Because of the use of u64, this currently fails to build in 32-bit platforms like wasm. usize is platform dependent but safe enough for most use cases. --- gpu/src/Queue.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpu/src/Queue.zig b/gpu/src/Queue.zig index 3c4e0f2c..aba981f4 100644 --- a/gpu/src/Queue.zig +++ b/gpu/src/Queue.zig @@ -71,7 +71,7 @@ pub inline fn writeTexture( queue.ptr, destination, @ptrCast(*const anyopaque, data.ptr), - @intCast(u64, data.len) * @sizeOf(std.meta.Elem(@TypeOf(data))), + @intCast(usize, data.len) * @sizeOf(std.meta.Elem(@TypeOf(data))), data_layout, write_size, );