From 2a3e6e572bfa525160f7a96a7156cead6434e31e Mon Sep 17 00:00:00 2001 From: Rukai Date: Sun, 22 Mar 2020 22:06:55 +1100 Subject: [PATCH] [rs] Improve BufferCopyView documentation --- wgpu/examples/capture/main.rs | 2 +- wgpu/examples/cube/main.rs | 2 +- wgpu/examples/mipmap/main.rs | 2 +- wgpu/src/lib.rs | 7 +++++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/wgpu/examples/capture/main.rs b/wgpu/examples/capture/main.rs index 8425937758..650c50052a 100644 --- a/wgpu/examples/capture/main.rs +++ b/wgpu/examples/capture/main.rs @@ -77,7 +77,7 @@ async fn run() { buffer: &output_buffer, offset: 0, bytes_per_row: size_of::() as u32 * size, - rows_per_image: size, + rows_per_image: 0, }, texture_extent, ); diff --git a/wgpu/examples/cube/main.rs b/wgpu/examples/cube/main.rs index 4080243f81..d9ddeb1134 100644 --- a/wgpu/examples/cube/main.rs +++ b/wgpu/examples/cube/main.rs @@ -180,7 +180,7 @@ impl framework::Example for Example { buffer: &temp_buf, offset: 0, bytes_per_row: 4 * size, - rows_per_image: size, + rows_per_image: 0, }, wgpu::TextureCopyView { texture: &texture, diff --git a/wgpu/examples/mipmap/main.rs b/wgpu/examples/mipmap/main.rs index a690658856..1427f323fe 100644 --- a/wgpu/examples/mipmap/main.rs +++ b/wgpu/examples/mipmap/main.rs @@ -268,7 +268,7 @@ impl framework::Example for Example { buffer: &temp_buf, offset: 0, bytes_per_row: 4 * size, - rows_per_image: size, + rows_per_image: 0, }, wgpu::TextureCopyView { texture: &texture, diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index 6f0dec1801..7f62eefd22 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -408,13 +408,16 @@ pub struct BufferCopyView<'a> { /// The buffer to be copied to or from. pub buffer: &'a Buffer, - /// The offset in bytes from the start of the buffer. This must be aligned to 512 bytes. + /// The offset in bytes from the start of the buffer. + /// In the future this must be aligned to 512 bytes, however the requirement is currently unimplemented. pub offset: BufferAddress, - /// The size in bytes of a single row of the texture. This must be a multiple of 256 bytes. + /// The size in bytes of a single row of the texture. + /// In the future this must be a multiple of 256 bytes, however the requirement is currently unimplemented. pub bytes_per_row: u32, /// The height in texels of the imaginary texture view overlaid on the buffer. + /// Must be zero for copies where `copy_size.depth == 1`. pub rows_per_image: u32, }