mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-24 15:54:00 +00:00
diag(naga): add type info to InvalidBinaryOperandTypes
This commit is contained in:
parent
2a2655def8
commit
e8a8281203
@ -106,6 +106,10 @@ By @ErichDonGubler in [#6456](https://github.com/gfx-rs/wgpu/pull/6456), [#6148]
|
||||
|
||||
### Changes
|
||||
|
||||
#### Naga
|
||||
|
||||
- Show types of LHS and RHS in binary operation type mismatch errors. By @ErichDonGubler in [#6450](https://github.com/gfx-rs/wgpu/pull/6450).
|
||||
|
||||
#### General
|
||||
|
||||
- Make `Surface::as_hal` take an immutable reference to the surface. By @jerzywilczek in [#9999](https://github.com/gfx-rs/wgpu/pull/9999)
|
||||
|
@ -39,11 +39,20 @@ pub enum ExpressionError {
|
||||
IndexableLength(#[from] IndexableLengthError),
|
||||
#[error("Operation {0:?} can't work with {1:?}")]
|
||||
InvalidUnaryOperandType(crate::UnaryOperator, Handle<crate::Expression>),
|
||||
#[error("Operation {op:?} can't work with {lhs:?} and {rhs:?}")]
|
||||
#[error(
|
||||
"Operation {:?} can't work with {:?} (of type {:?}) and {:?} (of type {:?})",
|
||||
op,
|
||||
lhs_expr,
|
||||
lhs_type,
|
||||
rhs_expr,
|
||||
rhs_type
|
||||
)]
|
||||
InvalidBinaryOperandTypes {
|
||||
op: crate::BinaryOperator,
|
||||
lhs: Handle<crate::Expression>,
|
||||
rhs: Handle<crate::Expression>,
|
||||
lhs_expr: Handle<crate::Expression>,
|
||||
lhs_type: crate::TypeInner,
|
||||
rhs_expr: Handle<crate::Expression>,
|
||||
rhs_type: crate::TypeInner,
|
||||
},
|
||||
#[error("Selecting is not possible")]
|
||||
InvalidSelectTypes,
|
||||
@ -849,8 +858,10 @@ impl super::Validator {
|
||||
);
|
||||
return Err(ExpressionError::InvalidBinaryOperandTypes {
|
||||
op,
|
||||
lhs: left,
|
||||
rhs: right,
|
||||
lhs_expr: left,
|
||||
lhs_type: left_inner.clone(),
|
||||
rhs_expr: right,
|
||||
rhs_type: right_inner.clone(),
|
||||
});
|
||||
}
|
||||
ShaderStages::all()
|
||||
|
Loading…
Reference in New Issue
Block a user