Skip to content

Commit 2ee7604

Browse files
ErichDonGublerteoxoy
authored andcommitted
fix(const_eval): use component count, not arg. count, for component-wise iter.
1 parent a0862aa commit 2ee7604

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

naga/src/proc/constant_evaluator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ macro_rules! gen_component_wise_extractor {
9797
.and_then(|comps| Ok(handler(comps)?.into())),
9898
)+
9999
&Expression::Compose { ty, ref components } => match &eval.types[ty].inner {
100-
&TypeInner::Vector { size: _, scalar } => match scalar.kind {
100+
&TypeInner::Vector { size, scalar } => match scalar.kind {
101101
$(ScalarKind::$scalar_kind)|* => {
102102
let first_ty = ty;
103103
let mut component_groups =
@@ -132,7 +132,7 @@ macro_rules! gen_component_wise_extractor {
132132
let component_groups = component_groups.into_inner().unwrap();
133133
let mut new_components =
134134
ArrayVec::<_, { crate::VectorSize::MAX }>::new();
135-
for idx in 0..N {
135+
for idx in 0..(size as u8).into() {
136136
let group = component_groups
137137
.iter()
138138
.map(|cs| cs[idx])

0 commit comments

Comments
 (0)