[glsl-in] Fix span of gvec3 in layouter

This commit is contained in:
João Capucho
2021-08-01 18:36:37 +01:00
committed by Dzmitry Malyshau
parent c084e2cfa8
commit 6f476eeafe

View File

@@ -51,14 +51,10 @@ pub fn calculate_offset(
// consuming N basic machine units, the base alignment is 2N or 4N, respectively.
// 3. If the member is a three-component vector with components consuming N
// basic machine units, the base alignment is 4N.
TypeInner::Vector { size, width, .. } => {
let val = match size {
crate::VectorSize::Tri => 4 * width as u32,
_ => size as u32 * width as u32,
};
(val, val)
}
TypeInner::Vector { size, width, .. } => match size {
crate::VectorSize::Tri => (4 * width as u32, 3 * width as u32),
_ => (size as u32 * width as u32, size as u32 * width as u32),
},
// 4. If the member is an array of scalars or vectors, the base alignment and array
// stride are set to match the base alignment of a single array element, according
// to rules (1), (2), and (3), and rounded up to the base alignment of a vec4.