Commit Graph

4 Commits

Author SHA1 Message Date
Bill Hollings
40141ffddf MSL: Selectively enable fast-math in MSL code to match Vulkan CTS results.
Based on CTS testing, math optimizations between MSL and Vulkan are inconsistent.
In some cases, enabling MSL's fast-math compilation option matches Vulkan's math
results. In other cases, disabling it does. Broadly enabling or disabling fast-math
across all shaders results in some CTS test failures either way.

To fix this, selectively enable/disable fast-math optimizations in the MSL code,
using metal::fast and metal::precise function namespaces, where supported, and
the [[clang::optnone]] function attribute otherwise.

Adjust SPIRV-Cross unit test reference shaders to accommodate these changes.
2021-09-22 18:58:31 -04:00
Hans-Kristian Arntzen
e1919744e9 Hack some constants in UE4 tests.
Need to make output 100% exact for MSVC and GCC libc testing, but they are 1 ULP
off when converting fp32 to string in some weird corner cases.
Roundtrip should be correct though, but that outside the scope of
SPIRV-Cross.
2019-10-28 11:20:41 +01:00
Hans-Kristian Arntzen
d1479f871a MSL: Do not generate UnsafeArray<> for any array inside buffer objects.
This avoids a lot of huge code changes.
Arrays generally cannot be copied in and out of buffers, at least no
compiler frontend seems to do it.

Also avoids a lot of issues surrounding packed vectors and matrices.
2019-10-24 12:22:30 +02:00
Lukas Hermanns
c236ca4572 Moved all UE4 test shaders into 'shaders-ue4/' folder. 2019-10-23 17:39:05 -04:00