Commit Graph

98 Commits

Author SHA1 Message Date
pstef 70aaa0a55c Fix non-griffin build for 3DS and make it the default
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
2025-04-06 18:35:41 +00:00
pstef 50ecf3877c Fix UI freeze when threaded rendering is enabled on 3DS
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
2025-03-25 17:18:29 +00:00
Joe Osborn 56014a27d6
Enable pthreads on Emscripten (#17586)
* 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/23518
https://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
2025-02-20 00:59:25 +01:00
Eric Warmenhoven 4351ea3098
apple: fix reinit of gcd task queue (#17262) 2024-12-16 06:00:45 -08:00
Eric Warmenhoven 62c725579a
apple: use gcd for task queue (#17248) 2024-12-11 22:55:46 -08:00
libretroadmin f4ed638347 Rewrite libretro-common task_queue, use flags 2024-09-10 02:42:07 +02:00
sonninnos 3c4dd50974
More widget additions and adjustments (#16287) 2024-02-25 20:23:08 -08:00
libretroadmin 24287b1cce Cleanups/simplifications 2023-08-17 21:58:41 +02:00
Jamiras 85c44f9245
more thread-awareness in task callbacks (#14337)
* more thread-awareness in task callbacks
2022-08-23 15:11:11 +02:00
LibretroAdmin a96d12e8bc Put back property locking in threaded_gather_internal - without this,
core updater tasks would crash/segfault - heap corruption
2022-08-22 03:41:17 +02:00
Jamiras e0a065d20e
don't hold property_lock while gathering tasks (#14328) 2022-08-18 04:28:40 +02:00
libretroadmin 0e85113eb3 (libretro-common) Style nits/cleanups 2022-07-10 18:13:49 +02:00
libretroadmin 821bb86b37 Get rid of HAVE_THREADS macros 2022-07-06 15:01:53 +02:00
Cthulhu-throwaway 7a70b36c8b
(Threaded Tasks) Fix race condition at task_queue_wait (#13898) 2022-04-29 14:29:07 +02:00
twinaphex d63c6b9706 main_thread_id initial value should be 0, not NULL 2021-11-08 20:08:32 +01:00
Jamiras 84cab492b2 add task_in_on_main_thread function 2021-11-08 09:35:25 -07:00
Jamiras 9aa42c9d5e only wait for save task to complete 2020-07-10 20:18:03 -06:00
twinaphex e48ffd14cd Cleanups 2020-07-09 00:24:09 +02:00
twinaphex 6e59d52184 Cleanups/comments 2020-07-07 05:58:07 +02:00
twinaphex 28399641da task_queue_put - prevent dereference of null pointer 2020-06-29 19:57:52 +02:00
twinaphex 3541b2aa0e task_init - use malloc 2020-06-28 06:41:07 +02:00
jdgleaver c1d41e190c (task_queue) Add warning about the usage of 'task_queue_remove()' 2020-04-06 14:16:24 +01:00
jdgleaver 13df7795fc Fix task deadlocks 2020-04-06 13:51:22 +01:00
Jamiras 23ba478f82 fix race condition where task could momentarily not be in the queue when reordering 2020-04-04 09:37:55 -06:00
Jamiras c8c05306a3 add comments 2020-02-22 13:01:07 -07:00
Jamiras e00449c410 delay subsequent unlock attempts on failure 2020-02-22 07:11:01 -07:00
twinaphex e7e7a284f5 Cleanups 2020-02-02 02:16:19 +01:00
twinaphex cd9ca691ca (libretro-common) Update copyright 2020-01-31 15:43:42 +01:00
twinaphex 74cd84399f Cleanups - Replace '== NULL' 2020-01-30 16:47:33 +01:00
twinaphex eb4e365820 (libretro-common) Cleanups 2020-01-27 17:00:18 +01:00
twinaphex 44b83cf353 Cleanups 2019-04-30 11:16:14 +02:00
twinaphex 34be5862ee (task_database) Use task_init 2019-04-30 10:25:23 +02:00
Brad Parker e0b75ec3fb fix a whole bunch of memory leaks 2019-03-01 12:05:14 -05:00
twinaphex 386657a366 (menu widgets backport) Re-commit task queue changes 2019-02-08 08:00:32 +01:00
twinaphex 7022786f34 Revert parts of menu_widgets that were causing breakage, but leave
all the hooks in so we can add them back piece by piece again
2019-02-08 07:26:43 +01:00
natinusala c20ab3864d First version of menu widgets (gl only) 2019-02-06 20:48:24 +01:00
orbea bfc366decc Squeeze extra blank lines with cat(1).
Example:

find . -type f -iname '*.c' | while read -r i; do
  cat -s "$i" > "$i.new"
  mv "$i.new" "$i"
done
2019-01-08 11:04:58 -08:00
twinaphex 768ebbfdb5 Merge commit 'ce9ce1d35387ef8144e53bf071396fa075bfb6c5' as 'libretro-common' 2018-05-12 17:56:34 +02:00
twinaphex 0548349991 Remove libretro-common 2018-05-12 17:56:14 +02:00
twinaphex be7eb4de1c Update libretro-common 2018-04-16 08:57:17 +02:00
Brad Parker e62e0c83da win32: Show progress meter on taskbar for downloads (Windows 7 and up) 2018-01-01 02:08:09 -05:00
gblues 6904101c44 Clean up trailing whitespace
== DETAILS

Really simple code cleanup, because my editor flags trailing whitespaces
and it's pretty annoying.
2017-12-12 00:24:18 -08:00
aliaspider b00776b09e allow easier scheduling of tasks in single threaded mode by adding a
condition callback to task_queue_wait.
2017-05-22 11:18:42 +01:00
twinaphex 80d9d1f143 Rewrite task_queue 2017-05-14 20:43:48 +02:00
twinaphex 379ce5eb05 Revert "Guard crash on OSX"
This reverts commit 1afda04966.
2017-01-23 14:14:46 +01:00
twinaphex 3e87196a43 Revert "Implicit declaration buildfix"
This reverts commit 77fa8c39ef.
2017-01-23 14:14:40 +01:00
twinaphex 77fa8c39ef Implicit declaration buildfix 2017-01-23 14:11:22 +01:00
Twinaphex 1afda04966 Guard crash on OSX 2017-01-23 14:10:51 +01:00
twinaphex 64bb848daf Update headers (pt. 2 - libretro-common) 2017-01-22 13:58:20 +01:00
Brad Parker 51504286be revert flush flug for positive OSD progress 2017-01-07 12:23:18 -05:00