Skip to content

Commit d401e84

Browse files
committed
update comments with approriate units for func arguments.
1 parent ec04880 commit d401e84

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/wgpu.zig

+4-5
Original file line numberDiff line numberDiff line change
@@ -1347,8 +1347,8 @@ pub const Buffer = *opaque {
13471347
}
13481348
extern fn wgpuBufferGetConstMappedRange(buffer: Buffer, offset: usize, size: usize) ?*const anyopaque;
13491349

1350-
// `offset` has to be a multiple of 8 (otherwise `null` will be returned).
1351-
// `@sizeOf(T) * len` has to be a multiple of 4 (otherwise `null` will be returned).
1350+
// `offset` - in bytes, has to be a multiple of 8 (otherwise `null` will be returned).
1351+
// `len` - length of slice to return, in elements of type T, `@sizeOf(T) * len` has to be a multiple of 4 (otherwise `null` will be returned).
13521352
pub fn getMappedRange(buffer: Buffer, comptime T: type, offset: usize, len: usize) ?[]T {
13531353
if (len == 0) return null;
13541354
const ptr = wgpuBufferGetMappedRange(buffer, offset, @sizeOf(T) * len);
@@ -1372,9 +1372,8 @@ pub const Buffer = *opaque {
13721372
}
13731373
extern fn wgpuBufferGetUsage(buffer: Buffer) BufferUsage;
13741374

1375-
// `offset` has to be a multiple of 8 (Dawn's validation layer will warn).
1376-
// `size` has to be a multiple of 4 (Dawn's validation layer will warn).
1377-
// `size == 0` will map entire range (from 'offset' to the end of the buffer).
1375+
// `offset` - in bytes, has to be a multiple of 8 (Dawn's validation layer will warn).
1376+
// `size` - size of buffer to map in bytes, has to be a multiple of 4 (Dawn's validation layer will warn).
13781377
pub fn mapAsync(
13791378
buffer: Buffer,
13801379
mode: MapMode,

0 commit comments

Comments
 (0)