aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webgl_validations/tex_image_2d.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/webgl_validations/tex_image_2d.rs')
-rw-r--r--components/script/dom/webgl_validations/tex_image_2d.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/script/dom/webgl_validations/tex_image_2d.rs b/components/script/dom/webgl_validations/tex_image_2d.rs
index ecd0a167ce6..c8ab11b87d8 100644
--- a/components/script/dom/webgl_validations/tex_image_2d.rs
+++ b/components/script/dom/webgl_validations/tex_image_2d.rs
@@ -435,8 +435,8 @@ fn valid_compressed_data_len(
let block_width = compression.block_width as u32;
let block_height = compression.block_height as u32;
- let required_blocks_hor = (width + block_width - 1) / block_width;
- let required_blocks_ver = (height + block_height - 1) / block_height;
+ let required_blocks_hor = width.div_ceil(block_width);
+ let required_blocks_ver = height.div_ceil(block_height);
let required_blocks = required_blocks_hor * required_blocks_ver;
let required_bytes = required_blocks * compression.bytes_per_block as u32;