From ecb0b11566beaef603cbd63e7fc818d582198387 Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Fri, 25 Feb 2022 16:09:54 -0500 Subject: [PATCH] hal/gles: Fix minimum rows_per_image calculation --- wgpu-hal/src/gles/queue.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wgpu-hal/src/gles/queue.rs b/wgpu-hal/src/gles/queue.rs index 124a0c4093..31c837cdbb 100644 --- a/wgpu-hal/src/gles/queue.rs +++ b/wgpu-hal/src/gles/queue.rs @@ -463,8 +463,9 @@ impl super::Queue { .map_or(copy.size.width * format_info.block_size as u32, |bpr| { bpr.get() }); - let minimum_rows_per_image = - u32::max(1, copy.size.height / format_info.block_dimensions.1 as u32); + let block_height = format_info.block_dimensions.1 as u32; + let minimum_rows_per_image = (copy.size.height + block_height - 1) + / format_info.block_dimensions.1 as u32; let rows_per_image = copy .buffer_layout .rows_per_image