Skip to content

Commit

Permalink
TODO: narrow spans for more ExpressionError cases?
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Jan 28, 2025
1 parent 53e4588 commit 9105b3c
Showing 1 changed file with 29 additions and 19 deletions.
48 changes: 29 additions & 19 deletions naga/src/valid/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,24 @@ impl ExpressionError {
Self::InvalidBaseType(handle) => just(handle),
Self::InvalidIndexType(handle) => just(handle),
Self::NegativeIndex(handle) => just(handle),
Self::IndexOutOfBounds(..) => Vec::new(),
Self::IndexOutOfBounds(handle, _) => Vec::new(),
Self::FunctionArgumentDoesntExist(..) => Vec::new(),
Self::InvalidPointerType(handle) => just(handle),
Self::InvalidArrayType(handle) => just(handle),
Self::InvalidRayQueryType(handle) => just(handle),
Self::InvalidSplatType(handle) => just(handle),
Self::InvalidVectorType(handle) => just(handle),
Self::InvalidSwizzleComponent(..) => Vec::new(),
Self::Compose(..) => Vec::new(),
Self::IndexableLength(..) => Vec::new(),
Self::InvalidSwizzleComponent(swizzle_component, vector_size) => Vec::new(),
Self::Compose(ref compose_error) => Vec::new(),
Self::IndexableLength(indexable_length_error) => Vec::new(),
Self::InvalidUnaryOperandType(_unary_operator, handle) => just(handle),
Self::InvalidBinaryOperandTypes { .. } => Vec::new(),
Self::InvalidBinaryOperandTypes {
op,
lhs_expr,
ref lhs_type,
rhs_expr,
ref rhs_type,
} => Vec::new(),
Self::SelectValuesTypeMismatch {
accept,
ref accept_ty,
Expand All @@ -183,38 +189,42 @@ impl ExpressionError {
}
Self::InvalidBooleanVector(handle) => just(handle),
Self::InvalidFloatArgument(handle) => just(handle),
Self::Type(..) => Vec::new(),
Self::Type(resolve_error) => Vec::new(),
Self::ExpectedGlobalVariable => Vec::new(),
Self::ExpectedGlobalOrArgument => Vec::new(),
Self::ExpectedBindingArrayType(..) => Vec::new(),
Self::ExpectedImageType(..) => Vec::new(),
Self::ExpectedSamplerType(..) => Vec::new(),
Self::InvalidImageClass(..) => Vec::new(),
Self::ExpectedBindingArrayType(handle) => Vec::new(),
Self::ExpectedImageType(handle) => Vec::new(),
Self::ExpectedSamplerType(handle) => Vec::new(),
Self::InvalidImageClass(image_class) => Vec::new(),
Self::InvalidDerivative => Vec::new(),
Self::InvalidImageArrayIndex => Vec::new(),
Self::InvalidImageOtherIndex => Vec::new(),
Self::InvalidImageArrayIndexType(handle) => just(handle),
Self::InvalidImageOtherIndexType(handle) => just(handle),
Self::InvalidImageCoordinateType(_image_dimension, handle) => just(handle),
Self::ComparisonSamplingMismatch { .. } => Vec::new(),
Self::ComparisonSamplingMismatch {
image,
sampler,
has_ref,
} => Vec::new(),
Self::InvalidSampleOffsetExprType => Vec::new(),
Self::InvalidSampleOffset(_image_dimension, handle) => just(handle),
Self::InvalidDepthReference(handle) => just(handle),
Self::InvalidDepthSampleLevel => Vec::new(),
Self::InvalidGatherLevel => Vec::new(),
Self::InvalidGatherComponent(..) => Vec::new(),
Self::InvalidGatherDimension(..) => Vec::new(),
Self::InvalidGatherComponent(swizzle_component) => Vec::new(),
Self::InvalidGatherDimension(image_dimension) => Vec::new(),
Self::InvalidSampleLevelExactType(handle) => just(handle),
Self::InvalidSampleLevelBiasType(handle) => just(handle),
Self::InvalidSampleLevelBiasDimension(..) => Vec::new(),
Self::InvalidSampleLevelBiasDimension(image_dimension) => Vec::new(),
Self::InvalidSampleLevelGradientType(_image_dimension, handle) => just(handle),
Self::InvalidCastArgument => Vec::new(),
Self::WrongArgumentCount(..) => Vec::new(),
Self::WrongArgumentCount(math_function) => Vec::new(),
Self::InvalidArgumentType(_math_function, _, handle) => just(handle),
Self::InvalidWorkGroupUniformLoadResultType(..) => Vec::new(),
Self::MissingCapabilities(..) => Vec::new(),
Self::Literal(..) => Vec::new(),
Self::UnsupportedWidth(..) => Vec::new(),
Self::InvalidWorkGroupUniformLoadResultType(handle) => Vec::new(),
Self::MissingCapabilities(capabilities) => Vec::new(),
Self::Literal(ref literal_error) => Vec::new(),
Self::UnsupportedWidth(math_function, scalar_kind, _) => Vec::new(),
}
.into_iter()
}
Expand Down

0 comments on commit 9105b3c

Please sign in to comment.