Skip to content

Commit 9932236

Browse files
committed
[naga wgsl-in] Rename TemplateListIter::scalar to scalar_ty.
The name `scalar` suggests that it returns a scalar value, and `scalar_ty` is analogous to `ty`.
1 parent 2f2462c commit 9932236

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

naga/src/front/wgsl/lower/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2681,11 +2681,11 @@ impl<'source, 'temp> Lowerer<'source, 'temp> {
26812681
conv::PredeclaredType::TypeGenerator(type_generator) => {
26822682
let ty_inner = match type_generator {
26832683
conv::TypeGenerator::Vector { size } => {
2684-
let (scalar, _) = tl.scalar(self, ctx)?;
2684+
let (scalar, _) = tl.scalar_ty(self, ctx)?;
26852685
ir::TypeInner::Vector { size, scalar }
26862686
}
26872687
conv::TypeGenerator::Matrix { columns, rows } => {
2688-
let (scalar, span) = tl.scalar(self, ctx)?;
2688+
let (scalar, span) = tl.scalar_ty(self, ctx)?;
26892689
if scalar.kind != ir::ScalarKind::Float {
26902690
return Err(Box::new(Error::BadMatrixScalarKind(span, scalar)));
26912691
}
@@ -2715,7 +2715,7 @@ impl<'source, 'temp> Lowerer<'source, 'temp> {
27152715
ir::TypeInner::Array { base, size, stride }
27162716
}
27172717
conv::TypeGenerator::Atomic => {
2718-
let (scalar, _) = tl.scalar(self, ctx)?;
2718+
let (scalar, _) = tl.scalar_ty(self, ctx)?;
27192719
ir::TypeInner::Atomic(scalar)
27202720
}
27212721
conv::TypeGenerator::Pointer => {
@@ -2729,7 +2729,7 @@ impl<'source, 'temp> Lowerer<'source, 'temp> {
27292729
arrayed,
27302730
multi,
27312731
} => {
2732-
let (scalar, span) = tl.scalar(self, ctx)?;
2732+
let (scalar, span) = tl.scalar_ty(self, ctx)?;
27332733
let ir::Scalar { kind, width } = scalar;
27342734
if width != 4 {
27352735
return Err(Box::new(Error::BadTextureSampleType { span, scalar }));

naga/src/front/wgsl/lower/template_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<'iter, 'source> TemplateListIter<'iter, 'source> {
6363
lowerer.type_expression(expr, ctx)
6464
}
6565

66-
pub fn scalar(
66+
pub fn scalar_ty(
6767
&mut self,
6868
lowerer: &mut Lowerer<'source, '_>,
6969
ctx: &mut ExpressionContext<'source, '_, '_>,

0 commit comments

Comments
 (0)