mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-24 07:43:49 +00:00
[msl] fix Select on vectors
This commit is contained in:
parent
a090afa3f5
commit
00f4c07609
@ -522,19 +522,37 @@ impl<W: Write> Writer<W> {
|
|||||||
condition,
|
condition,
|
||||||
accept,
|
accept,
|
||||||
reject,
|
reject,
|
||||||
} => {
|
} => match *context.resolve_type(condition) {
|
||||||
if !is_scoped {
|
crate::TypeInner::Scalar {
|
||||||
write!(self.out, "(")?;
|
kind: crate::ScalarKind::Bool,
|
||||||
|
..
|
||||||
|
} => {
|
||||||
|
if !is_scoped {
|
||||||
|
write!(self.out, "(")?;
|
||||||
|
}
|
||||||
|
self.put_expression(condition, context, false)?;
|
||||||
|
write!(self.out, " ? ")?;
|
||||||
|
self.put_expression(accept, context, false)?;
|
||||||
|
write!(self.out, " : ")?;
|
||||||
|
self.put_expression(reject, context, false)?;
|
||||||
|
if !is_scoped {
|
||||||
|
write!(self.out, ")")?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
self.put_expression(condition, context, false)?;
|
crate::TypeInner::Vector {
|
||||||
write!(self.out, " ? ")?;
|
kind: crate::ScalarKind::Bool,
|
||||||
self.put_expression(accept, context, false)?;
|
..
|
||||||
write!(self.out, " : ")?;
|
} => {
|
||||||
self.put_expression(reject, context, false)?;
|
write!(self.out, "{}::select(", NAMESPACE)?;
|
||||||
if !is_scoped {
|
self.put_expression(accept, context, true)?;
|
||||||
|
write!(self.out, ", ")?;
|
||||||
|
self.put_expression(reject, context, true)?;
|
||||||
|
write!(self.out, ", ")?;
|
||||||
|
self.put_expression(condition, context, true)?;
|
||||||
write!(self.out, ")")?;
|
write!(self.out, ")")?;
|
||||||
}
|
}
|
||||||
}
|
_ => return Err(Error::Validation),
|
||||||
|
},
|
||||||
crate::Expression::Derivative { axis, expr } => {
|
crate::Expression::Derivative { axis, expr } => {
|
||||||
let op = match axis {
|
let op = match axis {
|
||||||
crate::DerivativeAxis::X => "dfdx",
|
crate::DerivativeAxis::X => "dfdx",
|
||||||
|
Loading…
Reference in New Issue
Block a user