Skip to content

Commit

Permalink
[spv-in] translate ModfStruct & FrexpStruct to their IR equivalents
Browse files Browse the repository at this point in the history
  • Loading branch information
teoxoy authored and jimblandy committed Oct 18, 2023
1 parent 4b7a555 commit cf113bd
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/front/spv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2949,15 +2949,15 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
Glo::InverseSqrt => Mf::InverseSqrt,
Glo::MatrixInverse => Mf::Inverse,
Glo::Determinant => Mf::Determinant,
Glo::Modf => Mf::Modf,
Glo::ModfStruct => Mf::Modf,
Glo::FMin | Glo::UMin | Glo::SMin | Glo::NMin => Mf::Min,
Glo::FMax | Glo::UMax | Glo::SMax | Glo::NMax => Mf::Max,
Glo::FClamp | Glo::UClamp | Glo::SClamp | Glo::NClamp => Mf::Clamp,
Glo::FMix => Mf::Mix,
Glo::Step => Mf::Step,
Glo::SmoothStep => Mf::SmoothStep,
Glo::Fma => Mf::Fma,
Glo::Frexp => Mf::Frexp, //TODO: FrexpStruct?
Glo::FrexpStruct => Mf::Frexp,
Glo::Ldexp => Mf::Ldexp,
Glo::Length => Mf::Length,
Glo::Distance => Mf::Distance,
Expand All @@ -2978,7 +2978,16 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
Glo::UnpackSnorm2x16 => Mf::Unpack2x16snorm,
Glo::FindILsb => Mf::FindLsb,
Glo::FindUMsb | Glo::FindSMsb => Mf::FindMsb,
_ => return Err(Error::UnsupportedExtInst(inst_id)),
// TODO: https://github.com/gfx-rs/naga/issues/2526
Glo::Modf | Glo::Frexp => return Err(Error::UnsupportedExtInst(inst_id)),
Glo::IMix
| Glo::PackDouble2x32
| Glo::UnpackDouble2x32
| Glo::InterpolateAtCentroid
| Glo::InterpolateAtSample
| Glo::InterpolateAtOffset => {
return Err(Error::UnsupportedExtInst(inst_id))
}
};

let arg_count = fun.argument_count();
Expand Down

0 comments on commit cf113bd

Please sign in to comment.