-ffast-math was added in ff14092d8d with a comment that it "helps SINC
resampler to auto-vectorize". The flag is an alias for "-fno-math-errno
-funsafe-math-optimizations -ffp-contract=fast -fno-honor-infinities
-fno-honor-nans". The last two of those cause compiler complaints
because while the flag was meant for this file, it's shared across the
codebase that includes statements that operate on infinities and NaNs.
GCC 13.3 with -fopt-info-vec reports 18 vectorizations for `-O3
-ffast-math`, 17 for `-O3 -fno-math-errno -funsafe-math-optimizations
-ffp-contract=fast` and also 17 for plain `-O3`. So using the subset of
-ffast-math without the offending flags buys nothing and loses 1
vectorization.
Both GCC and Clang provide the "fast-math" pragma directive, which I add
to this one file that benefits from it, under the condition that it's
supported. -ffast-math is removed from most of the makefiles.
Change the flags parameter to int32_t for explicit sizing. Add a check
and cast for MSVC __cpuid compatibility when int is 32-bit.
This silences a -Wincompatible-pointer-types warning where int32_t is
long int.
While here:
* remove input_overlay and task_overlay from linking blacklist
* move -Werror to CC invocation since C++ refuses to use it
* copy the quiet build mode from the main Makefile and make it the
default
* temporarily define DEPRECATED for gpu_old.h to allow succesful build
* replace the call to command_event() with one to retroarch_main_quit()
in a failure case
* add missing uncompr.o in Makefile.common for HAVE_BUILTINZLIB
Before this change, there was at least one scenario in which the UI
would seemingly freeze and a restart was needed. That's when an update
of cores was attempted with threaded rendering enabled.
Fixes https://github.com/libretro/RetroArch/issues/17727
Before this change, an 8-bit value was guaranteed to be lesser than the
size of this array (256). Instead of removing the check, I make it
meaningful by reducing the size of the array.
At optimization level -O3, GCC generates a warning about its own
optimizations, likely due to loop unrolling. Manually unroll the loop to
eliminate any ambiguity and prevent the warning.
* workerized RA
* Workerized (non-async) web player, using OPFS
This patch eliminates the need for asyncify and uses modern filesystem
APIs instead of the deprecated, unmaintained BrowserFS.
This is a WIP patch because it won't fully work until these two
Emscripten PRs land and are released:
https://github.com/emscripten-core/emscripten/pull/23518https://github.com/emscripten-core/emscripten/pull/23021
The former fixes an offscreen canvas context recreation bug, and the
latter adds an equivalent to BrowserFS's XHR filesystem (but without
the hazardous running-XHR-on-the-main-thread problem).
The biggest issue is that local storage of users who were using the
old version of the webplayer will be gone when they switch to the new
webplayer. I don't have a good story for converting the old BrowserFS
IDBFS contents into the new OPFS filesystem (the move is worth doing
because OPFS supports seeking and reading only bits of a file, and
because BrowserFS is dead).
I've kept around the old libretro webplayer under
pkg/emscripten/libretro-classic, and with these make flags you can
build a non-workerized RA that uses asyncify to sleep as before:
make -f Makefile.emscripten libretro=$CORE HAVE_WORKER=0 HAVE_WASMFS=0 PTHREAD=0 HAVE_AL=1
I also moved the default directory for core content on emscripten to
not be a subdirectory of the local filesystem mount, because it's
confusing to have a subdirectory that's lazily fetched and not
mirrored to the local storage. I think it won't impact existing users
of the classic web player because they already have a retroarch.cfg in
place.
* Get fetchfs working without manifest support
* makefile fixes
* fix scaling, remove zip dependency
* Support asset/cheats/etc downloaders for emscripten
- Add http transfer support for emscripten
- At the task_http level, not the net_http level --- so no netplay
or webdav.
- Change default paths to be more like other platforms
- Gives us smaller bundles and a faster boot time
- Had to work around a task queue bug on Emscripten
- I made the smallest possible change to do it, but it may be better
to fix in rthread.c
* Load an emscripten file_packager package on first run
If no ozone assets are present, load a libretro_minimal package
created using Emscripten's built-in file packager.
* updated readme, removed indexer from wasmfs libretro-web
* Put back zip dependency, load asset bundle into opfs on first run
* fix upload path
* Remove unused function
* easy testing setup for two multithreaded conditions
1. make PROXY_TO_PTHREAD=1 (slower)
2. make PROXY_TO_PTHREAD=0 (bad audio, because doesn't sleep in
openal.c)
* Remove condition on sleep in openal
also make input_driver check existence of drv->axis, drv->button
before calling them.
* Fix resizing under EGL
* Don't force config file path on emscripten
* Add time.h include to netplay, default HAVE_NETPLAYDISCOVERY to 0
* Remove nearly all proxied joypad calls under emscripten
* Fix file uploads under firefox
* Fix safari API uses, but Safari still hangs in OPFS filesystem mount
I think this can be fixed by moving the backend creation off the main
thread.
* Move filesystem init into emscripten C entry point
* Setup filesystems off of main thread
* re-set default player to async
Also improve Safari compatibility under proxy-to-pthread condition
* Safari upload file fixes
* Remove some excess prints
* Fix typo
* workerized RA
* Workerized (non-async) web player, using OPFS
This patch eliminates the need for asyncify and uses modern filesystem
APIs instead of the deprecated, unmaintained BrowserFS.
This is a WIP patch because it won't fully work until these two
Emscripten PRs land and are released:
https://github.com/emscripten-core/emscripten/pull/23518https://github.com/emscripten-core/emscripten/pull/23021
The former fixes an offscreen canvas context recreation bug, and the
latter adds an equivalent to BrowserFS's XHR filesystem (but without
the hazardous running-XHR-on-the-main-thread problem).
The biggest issue is that local storage of users who were using the
old version of the webplayer will be gone when they switch to the new
webplayer. I don't have a good story for converting the old BrowserFS
IDBFS contents into the new OPFS filesystem (the move is worth doing
because OPFS supports seeking and reading only bits of a file, and
because BrowserFS is dead).
I've kept around the old libretro webplayer under
pkg/emscripten/libretro-classic, and with these make flags you can
build a non-workerized RA that uses asyncify to sleep as before:
make -f Makefile.emscripten libretro=$CORE HAVE_WORKER=0 HAVE_WASMFS=0 PTHREAD=0 HAVE_AL=1
I also moved the default directory for core content on emscripten to
not be a subdirectory of the local filesystem mount, because it's
confusing to have a subdirectory that's lazily fetched and not
mirrored to the local storage. I think it won't impact existing users
of the classic web player because they already have a retroarch.cfg in
place.
* Get fetchfs working without manifest support
* makefile fixes
* net_http: refactor net_http_new
The goal is to move calls to getaddrinfo() and connect() into
net_http_update(). This will make it possible for them to be replaced
with non-blocking alternatives later.
The net_http calling pattern right now allows callers to create the
http_connection_t, call net_http_new() which creates the http_t from
the http_connection_t, free the http_connection_t, and then start
calling net_http_update(). In order to preserve that, the http_t needs
to copy the values out of the http_connection_t on create. This also
preserves the http_connection_t values instead of freeing them, so the
connection would be able to be used later.
* net_http: implement dns cache
* net_http: separate out address resolution, connect, and request send
* net_http: perform getaddrinfo on separate thread
* net_http: implement basic connection pool
* net_http: refactor receive calls to read faster, do fewer reallocs
* net_http: build fix for platforms without SSL
* net_http: build fix for non-griffin builds
* net_http: build fix for non-threaded platforms