From 4052dc0b41c52c49e7abddf1a64d24a40eaf01c6 Mon Sep 17 00:00:00 2001 From: Rua Date: Sat, 26 Aug 2023 23:00:51 +0200 Subject: [PATCH] Add missing division for bits-to-bytes conversions (#2313) --- vulkano/src/acceleration_structure.rs | 2 +- vulkano/src/command_buffer/commands/acceleration_structure.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vulkano/src/acceleration_structure.rs b/vulkano/src/acceleration_structure.rs index 4c1d0bb5ba..6bd6870d1f 100644 --- a/vulkano/src/acceleration_structure.rs +++ b/vulkano/src/acceleration_structure.rs @@ -1056,7 +1056,7 @@ impl AccelerationStructureGeometryTrianglesData { .filter(|&c| c != 0) .min() .unwrap() as u32; - let smallest_component_bytes = (smallest_component_bits + 7) & !7; + let smallest_component_bytes = ((smallest_component_bits + 7) & !7) / 8; if vertex_stride % smallest_component_bytes != 0 { return Err(Box::new(ValidationError { diff --git a/vulkano/src/command_buffer/commands/acceleration_structure.rs b/vulkano/src/command_buffer/commands/acceleration_structure.rs index d92c5bd389..7821ab6c81 100644 --- a/vulkano/src/command_buffer/commands/acceleration_structure.rs +++ b/vulkano/src/command_buffer/commands/acceleration_structure.rs @@ -1050,7 +1050,7 @@ where .filter(|&c| c != 0) .min() .unwrap() as u32; - let smallest_component_bytes = (smallest_component_bits + 7) & !7; + let smallest_component_bytes = ((smallest_component_bits + 7) & !7) / 8; if vertex_data.device_address().unwrap().get() % smallest_component_bytes as u64 != 0 @@ -1837,7 +1837,7 @@ where .filter(|&c| c != 0) .min() .unwrap() as u32; - let smallest_component_bytes = (smallest_component_bits + 7) & !7; + let smallest_component_bytes = ((smallest_component_bits + 7) & !7) / 8; if vertex_data.device_address().unwrap().get() % smallest_component_bytes as u64 != 0