From 4f2ee95ecdf7042a5148b2505d29fe31702ddf5a Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 17 Apr 2024 20:34:10 -0700 Subject: [PATCH] renderer/metal: docs --- src/renderer/metal/buffer.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/renderer/metal/buffer.zig b/src/renderer/metal/buffer.zig index b11861817..20590afc2 100644 --- a/src/renderer/metal/buffer.zig +++ b/src/renderer/metal/buffer.zig @@ -64,7 +64,12 @@ pub fn Buffer(comptime T: type) type { return ptr[0..len]; } - /// Sync new contents to the buffer. + /// Sync new contents to the buffer. The data is expected to be the + /// complete contents of the buffer. If the amont of data is larger + /// than the buffer length, the buffer will be reallocated. + /// + /// If the amount of data is smaller than the buffer length, the + /// remaining data in the buffer is left untouched. pub fn sync(self: *Self, device: objc.Object, data: []const T) !void { // If we need more bytes than our buffer has, we need to reallocate. const req_bytes = data.len * @sizeOf(T);