libvpx arm32 build with NEON can be supported in theory (and it works
on Android armv7), but our SCons logic for it is super convoluted and
broken. It needs significant rework to be made less error prone, and
ensure we can compile `.s` files properly with cross-compilation
toolchains.
The demand to play WebM videos on older Pi3-style SoCs is likely low,
so for now this is a simple compromise.
Could be improved with some effort if someone is motivated.
Still paying the cost of not having refactored all architecture handling
in the 3.x branch so we have this broken hybrid of arch/bits which is
unreliable.
The architecture handling in 3.x is all over the place, and I'm not
going to start a major refactor like I did for 4.0 so late in its life
cycle.
So let's add more hacks! ⚔️
This requires manually passing `arch=arm64` when compiling, but this is
already the case for other parts of the codebase.
The commit b5a8055b5c should target GCC builds only as
-flax-vector-conversions has different behaviour in Clang and is
currently making the build fail.
Signed-off-by: Filipe Rinaldi <filipe.rinaldi@gmail.com>
(cherry picked from commit 2841144096)
This is a change done upstream in the `devel3` branch for 3.13.6:
82ca6b5ccb
They also seem to define it for macOS, but for us it breaks the build...
¯\_(ツ)_/¯
Also change wrong use of CPPFLAGS (pre-processor) where CXXFLAGS (C++)
makes more sense.
(cherry picked from commit b5a8055b5c)
Upon investigating the extremely slow MSVC build times in #80513, I noticed
that while Godot policy is to never use exceptions, we weren't enforcing it
with compiler flags, and thus still included exception handling code and
stack unwinding.
This is wasteful on multiple aspects:
- Binary size: Around 20% binary size reduction with exceptions disabled
for both MSVC and GCC binaries.
- Compile time:
* More than 50% build time reduction with MSVC.
* 10% to 25% build time reduction with GCC + LTO.
- Performance: Possibly, needs to be benchmarked.
Since users may want to re-enable exceptions in their own thirdparty code
or the libraries they compile with Godot, this behavior can be toggled with
the `disable_exceptions` SCons option, which defaults to true.
A common bug with using acos and asin is that input outside -1 to 1 range will result in Nan output. This can occur due to floating point error in the input.
The standard solution is to provide safe_acos function with clamped input. For Godot it may make more sense to make the standard functions safe.