Skip to content

fix(const_eval): use component count, not arg. count, for component-wise iter. #5103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions naga/src/proc/constant_evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ macro_rules! gen_component_wise_extractor {
.and_then(|comps| Ok(handler(comps)?.into())),
)+
&Expression::Compose { ty, ref components } => match &eval.types[ty].inner {
&TypeInner::Vector { size: _, scalar } => match scalar.kind {
&TypeInner::Vector { size, scalar } => match scalar.kind {
$(ScalarKind::$scalar_kind)|* => {
let first_ty = ty;
let mut component_groups =
Expand Down Expand Up @@ -132,7 +132,7 @@ macro_rules! gen_component_wise_extractor {
let component_groups = component_groups.into_inner().unwrap();
let mut new_components =
ArrayVec::<_, { crate::VectorSize::MAX }>::new();
for idx in 0..N {
for idx in 0..(size as u8).into() {
let group = component_groups
.iter()
.map(|cs| cs[idx])
Expand Down