From e1acf31a2e79871b86555aadeb5dd5ba1e365156 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 4c1d0bb5..6bd6870d 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 d92c5bd3..7821ab6c 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