- Add CompilerMSL::Options::use_fast_math_pragmas to direct whether the MSL
should include pragma directives to control floating point compilation options.
- Add CompilerMSL::get_fp_fast_math_flags() to return a set of FPFastMathModeMask
flags that are safe to be applied to all floating-point types, based on
FPFastMathDefault and FPFastMathMode decorations on individual operations,
or execution modes SignedZeroInfNanPreserve and ContractionOff.
- Add SPIREntryPoint::fp_fast_math_defaults to track FPFastMathDefault by type ID.
- Add Decoration::fp_fast_math_mode to support DecorationFPFastMathMode.
- Use add_pragma_line() for all emitted pragmas, to better control line spacing.
- Update numerous shader references that were affected by a reordering
in emitted pragma lines, due to the consistent use of add_pragma_line().
Clang added -Wunqualified-std-cast-call in
https://reviews.llvm.org/D119670, which warns on unqualified std::move
and std::forward calls. This change qualifies these calls to allow the
project to build on HEAD Clang -Werror.
We don't need to keep track of them because when the block.condition is
either a SPIRConstant or a SPIRVariable, we can get the type directly in
the get_case_list.
Signed-off-by: Sebastián Aedo <[email protected]>
Now we added block.cases_32bit as requested and we only parse if the
remaining ops are a multiple of 2. None of them are mutable because we
return a reference of them depending of the op.condition width.
Signed-off-by: Sebastián Aedo <[email protected]>
Apparently, it's legal to use a selection construct where both paths
branch to same location, but a different merge point is used.
This breaks many assumptions the variable scope analyzer makes.
The only logical way to generate code for this scenario is to treat the
selection construct as a trivial switch construct with only a default
case.
We don't need to keep track of the type itself, only its width since the
type check of the OpSwitch can be done at runtime. This also avoids
creating a dangling reference.
Signed-off-by: Sebastián Aedo <[email protected]>
Moving out the logic from the parser as requested because it's sensitive
to try to keep the parsing the most simple process as said.
For that, the load_types is now tracked in the ParsedIR, which can be
accessed in the Compiler struct. The switch cases are fixed in the CFG
stage since that's the point where the nullptr is deref.
Signed-off-by: Sebastián Aedo <[email protected]>
According to the spec, if the `condition` has a type wider than 32 bits,
the literals to be compared with will be of that size as well.
This caused some misalignments if the `condition` was bigger than 32,
causing a nullptr return without further explanation.
Currently neither GLSL nor MSL supports uint64 as the condition but the
SPIRV allows it anyway.
This also fixes#1768.
Signed-off-by: Sebastián Aedo <[email protected]>
Fairly minor differences, so can keep them side by side without too much
effort. NV support is effectively deprecated now however.
- Add OpConvertUToAccelerationStructureKHR
- Ignore/Terminate ray is now a terminator in KHR, but a call in NV.
- Fix some bugs with reportIntersection.