diff --git a/src/valid/type.rs b/src/valid/type.rs index af2e6fa706..85678d6ab8 100644 --- a/src/valid/type.rs +++ b/src/valid/type.rs @@ -356,9 +356,16 @@ impl super::Validator { TypeFlags::empty() }; + let alignment = if let As::PhysicalStorage { .. } = space { + // Buffer pointers require proper alignment. + Alignment::BUFFER_POINTER + } else { + Alignment::ONE + }; + TypeInfo::new( data_flag | argument_flag | TypeFlags::SIZED | TypeFlags::COPY, - Alignment::ONE, + alignment, ) } Ti::ValuePointer { @@ -396,9 +403,16 @@ impl super::Validator { TypeFlags::empty() }; + let alignment = if let As::PhysicalStorage { .. } = space { + // Buffer pointers require proper alignment. + Alignment::BUFFER_POINTER + } else { + Alignment::ONE + }; + TypeInfo::new( data_flag | argument_flag | TypeFlags::SIZED | TypeFlags::COPY, - Alignment::ONE, + alignment, ) } Ti::Array { base, size, stride } => {