Add missing division for bits-to-bytes conversions (#2313)

This commit is contained in:
Rua 2023-08-26 23:00:51 +02:00 committed by GitHub
parent 4ee8aa5f1a
commit e1acf31a2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -1056,7 +1056,7 @@ impl AccelerationStructureGeometryTrianglesData {
.filter(|&c| c != 0) .filter(|&c| c != 0)
.min() .min()
.unwrap() as u32; .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 { if vertex_stride % smallest_component_bytes != 0 {
return Err(Box::new(ValidationError { return Err(Box::new(ValidationError {

View File

@ -1050,7 +1050,7 @@ where
.filter(|&c| c != 0) .filter(|&c| c != 0)
.min() .min()
.unwrap() as u32; .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 if vertex_data.device_address().unwrap().get() % smallest_component_bytes as u64
!= 0 != 0
@ -1837,7 +1837,7 @@ where
.filter(|&c| c != 0) .filter(|&c| c != 0)
.min() .min()
.unwrap() as u32; .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 if vertex_data.device_address().unwrap().get() % smallest_component_bytes as u64
!= 0 != 0