Skip to content

Commit 423118e

Browse files
committed
Warning comment has been added
1 parent 8038247 commit 423118e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/app/headless_renderer.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,10 @@ impl render_graph::Node for ImageCopyDriver {
360360
let block_dimensions = src_image.texture_format.block_dimensions();
361361
let block_size = src_image.texture_format.block_copy_size(None).unwrap();
362362

363+
// Calculating correct size of image row because
364+
// copy_texture_to_buffer can copy image only by rows aligned wgpu::COPY_BYTES_PER_ROW_ALIGNMENT
365+
// That's why image in buffer can be little bit wider
366+
// This should be taken into account
363367
let padded_bytes_per_row = RenderDevice::align_copy_bytes_per_row(
364368
(src_image.size.x as usize / block_dimensions.0 as usize) * block_size as usize,
365369
);

0 commit comments

Comments
 (0)