mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[glsl-in] Fix span of gvec3 in layouter
This commit is contained in:
committed by
Dzmitry Malyshau
parent
c084e2cfa8
commit
6f476eeafe
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user