Improve BufferCopyView documentation

This commit is contained in:
Rukai
2020-03-22 22:06:55 +11:00
parent 04db8c973c
commit 111f6c4f75
4 changed files with 8 additions and 5 deletions

View File

@@ -77,7 +77,7 @@ async fn run() {
buffer: &output_buffer,
offset: 0,
bytes_per_row: size_of::<u32>() as u32 * size,
rows_per_image: size,
rows_per_image: 0,
},
texture_extent,
);

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,
}