Skip to content

Commit

Permalink
Add missing division for bits-to-bytes conversions (vulkano-rs#2313)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rua authored and hakolao committed Feb 20, 2024
1 parent d2bdeec commit 4052dc0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion vulkano/src/acceleration_structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions vulkano/src/command_buffer/commands/acceleration_structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4052dc0

Please # to comment.