Commit Graph

497 Commits

Author SHA1 Message Date
Rick Gibbed
a3e5ea8575 [Base] Fix missing include in utf8.cc. 2022-05-27 17:56:14 -05:00
Triang3l
12ff951972 [Base] More flexible Xenos float16 conversion functions 2022-04-26 22:35:37 +03:00
Joel Linn
e3dd873892 [Base] Fix wait for callback return
- If wait item has disarmed itself and is then disarmed by another
  thread, still wait for the callback to return to meet guaratees
2022-04-26 13:56:11 -05:00
Joel Linn
3b4dc7da3b [Base] Use disruptorplus spin wait
- Attempt to fix deadlocks when using valgrind on CI
2022-04-26 13:56:11 -05:00
Joel Linn
e59a0e1206 [Base] Relax some timing constraints.
- Because setting the timer is scheduled by us but the wait on POSIX is
  currently scheduled by pthreads, this solves issues on overprovisioned
  CIs
2022-04-26 13:56:11 -05:00
Joel Linn
4a36a7962c [Base] Remove unneeded delay scheduler 2022-04-26 13:56:11 -05:00
Joel Linn
15950eec37 [Base] Use chrono APIs for Timers 2022-04-26 13:56:11 -05:00
Joel Linn
1478be14c7 [Base] Add chrono tests 2022-04-26 13:56:11 -05:00
Joel Linn
23eef94984 [Base] Add chrono support
- WinSystemClock is a FILETIME clock without scaling, can convert to
  system_time
- XSystemClock is a FILTETIME clock with scaling applied, can only
  convert to WinSystemClock
2022-04-26 13:56:11 -05:00
Joel Linn
9b4168cce9 [Base] Make HighResolutionTimer platform agnostic 2022-04-26 13:56:11 -05:00
Joel Linn
75357caeaf [Base] Add TimerQueue
- Cross platform functionality similar to Windows' `CreateTimerQueue`
  with `WT_EXECUTEINTIMERTHREAD`
2022-04-26 13:56:11 -05:00
Joel Linn
a85fc25040 [Base] Add more tests for HighResolutionTimer 2022-04-26 13:56:11 -05:00
Joel Linn
b72ab7b4a4 [Base] Refactor POSIX timers, fix user-after-free
Since timer_delete does not clean up already queued signals, signal info
data needs to be retained after timer deletion and object destruction in
order to circumvent use-after-free bugs.
2022-03-08 12:17:57 -06:00
Joel Linn
257b904a5e [Base] Add DelayScheduler class
Schedule callbacks whith the only guarantee that they will not be run for
the minimum duration specified. Useful for garbage collecting POSIX
timer_create() signal info data.
2022-03-08 12:17:57 -06:00
Joel Linn
e0f34b97fb [Base] Check for correct thread in HResTimer tests 2022-03-08 12:17:57 -06:00
Joel Linn
fb741db2fe [Base] Fix callback threads for POSIX timers 2022-03-08 12:17:57 -06:00
Joel Linn
986dcf4f65 [Base] Check success of sync primitive creation
- Mainly use `assert`s, since failure is very rare
- Forward failure of `CreateSemaphore` to guests because it is more easy
  to trigger with invalid initial parameters.
2022-03-08 12:17:57 -06:00
Joel Linn
6bd1279fc0 [Base] Forward handle=null as nullptr for win 2022-03-08 12:17:57 -06:00
Joel Linn
4ea6e45e0c [Base] Remove Sleeps from more test cases
Timing dependencies in this tests were causing spurious test failures:
- Create and Run Thread
- Test Thread QueueUserCallback

They have been largely replaced by spin waits.
2022-03-08 12:17:57 -06:00
Joel Linn
e75e0eb39c [Base] Fix Semaphore::Create invalid parameters 2022-03-08 12:17:57 -06:00
Joel Linn
bb42829308 [Base] Fix WaitMultiple on POSIX
- Never use `cond_.notify_one()` because it may wake a thread that is
  unrelated to the signalled wait handle, resulting in a lost wake and
  possible deadlock. Wait conditions are to be checked by the threads
  themselves.
- Refactor and simplify `WaitMultiple`
2022-03-08 12:17:57 -06:00
Joel Linn
ca6296089e [Base] Remove timing dependency from test
- Use atomics and spin waits to synchronize threads for tests
- Improves test stability on CI
2022-03-08 12:17:57 -06:00
Joel Linn
49efbeaca8 [Base] Add spin wait helper to threading test 2022-03-08 12:17:57 -06:00
Radosław Gliński
6b45cf8447 [Base] Match exactly when no pattern in wildcard 2022-02-17 17:38:04 -06:00
Triang3l
ba28ef9717 [Win32] Declare Windows 7-11 support in the manifest 2022-02-17 20:38:52 +03:00
Triang3l
74c109273c [UI] Add PerMonitor fallback to Windows dpiAwareness 2022-02-14 12:35:08 +03:00
Triang3l
e57db52285 [UI] Enable Windows PMv2 DPI awareness accidentally kept disabled after testing 2022-02-13 23:10:19 +03:00
Gliniak
7977d7ab98 [Base] Changed entry point to wmain for Windows
This prevents subapps from crashing when executing wmain specific functions
2022-02-01 15:50:48 -06:00
Triang3l
c6fc8f706a [Base] GetAndroidThreadJniEnv capitals, move JNI usage tips there 2022-02-01 21:33:20 +03:00
Triang3l
009f709ad4 [Base] Remove Android jfieldIDs used only once from the file scope 2022-01-31 13:00:28 +03:00
Triang3l
d998c13ee8 [Base] Explain why no Android activity in xenia-base [ci skip] 2022-01-31 12:12:57 +03:00
Triang3l
3f817fb241 [Base] Android JNIEnv attachment and LaunchWebBrowser 2022-01-30 23:35:40 +03:00
Triang3l
d2ef8d3300 [Base] Android error reporting via SIGABRT/RuntimeException 2022-01-30 18:36:11 +03:00
Triang3l
fe3f0f26e4 [UI] Image post-processing and full presentation/window rework
[GPU] Add FXAA post-processing
[UI] Add FidelityFX FSR and CAS post-processing
[UI] Add blue noise dithering from 10bpc to 8bpc
[GPU] Apply the DC PWL gamma ramp closer to the spec, supporting fully white color
[UI] Allow the GPU CP thread to present on the host directly, bypassing the UI thread OS paint event
[UI] Allow variable refresh rate (or tearing)
[UI] Present the newest frame (restart) on DXGI
[UI] Replace GraphicsContext with a far more advanced Presenter with more coherent surface connection and UI overlay state management
[UI] Connect presentation to windows via the Surface class, not native window handles
[Vulkan] Switch to simpler Vulkan setup with no instance/device separation due to interdependencies and to pass fewer objects around
[Vulkan] Lower the minimum required Vulkan version to 1.0
[UI/GPU] Various cleanup, mainly ComPtr usage
[UI] Support per-monitor DPI awareness v2 on Windows
[UI] DPI-scale Dear ImGui
[UI] Replace the remaining non-detachable window delegates with unified window event and input listeners
[UI] Allow listeners to safely destroy or close the window, and to register/unregister listeners without use-after-free and the ABA problem
[UI] Explicit Z ordering of input listeners and UI overlays, top-down for input, bottom-up for drawing
[UI] Add explicit window lifecycle phases
[UI] Replace Window virtual functions with explicit desired state, its application, actual state, its feedback
[UI] GTK: Apply the initial size to the drawing area
[UI] Limit internal UI frame rate to that of the monitor
[UI] Hide the cursor using a timer instead of polling due to no repeated UI thread paints with GPU CP thread presentation, and only within the window
2022-01-29 13:22:03 +03:00
Joel Linn
dbbf401205 [Base] Align test memory 2022-01-25 12:55:10 -06:00
Joel Linn
e4ae1d8b2f [Base] Fix copy_and_swap_16_in_32_aligned 2022-01-22 16:18:54 +03:00
Joel Linn
0316d1a054 [Base] Tests for copy_and_swap_16_in_32_aligned 2022-01-22 16:18:54 +03:00
Joel Linn
4a288dc6bd [Base, aarch64] Add copy_and_swap NEON impls 2022-01-22 16:18:54 +03:00
Joel Linn
bfaad055a2 [Base] Add easier to debug copy_and_swap tests 2022-01-22 16:18:54 +03:00
gibbed
5384e0e174 [Base] Fix MICROPROFILE_PRINTF. 2022-01-11 06:09:26 -06:00
Wunkolo
13a48e13bd [Base] Add operator<< string conversion for vec128_t
This allows `catch` to print out the contents of a particular vector when diagnosing how a `REQUIRE` expression has failed.
2022-01-02 15:14:58 -06:00
Wunkolo
f645c3ba31 [Base] Fix to_hex_string out-of-indexing for vec128_t type
Trying to print five `{:08X}` when vec128_t only has four values. 🥴
2022-01-02 15:14:58 -06:00
Wunkolo
1a8068b151 [Base] Add user-literals for several memory sizes
Rather than using `n * 1024 * 1024`, this adds a convenient `_MiB`/`_KiB` user-literal to the new `literals.h` header to concisely describe units of memory in a much more readable way. Any other useful literals can be added to this header. These literals exist in the `xe::literals` namespace so they are opt-in, similar to `std::chrono` literals, and require a `using namespace xe::literals` statement to utilize it within the current scope.

I've done a pass through the codebase to replace trivial instances of `1024 * 1024 * ...` expressions being used but avoided anything that added additional casting complexity from `size_t` to `uint32_t` and such to keep this commit concise.
2022-01-02 11:51:31 -06:00
Triang3l
701300e8e9 [Linux] Use sched_yield instead of the deprecated pthread_yield 2021-12-18 19:43:17 +03:00
Conrad Kramer
2962a266b5 Fix xenia-core build on macOS 2021-10-25 00:48:53 +03:00
Joel Linn
247cb91ac5 [Base] Replace GCC workaround (loop opt bug)
Previous workaround was dangerous, this one is more sane.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100801#c3
2021-09-27 13:43:57 +03:00
Triang3l
f91b895c9a [Base] Don't use raw clock where unsupported 2021-09-13 23:13:02 +03:00
Triang3l
7aeac37eb6 [Base/UI] Android globals initialization + WindowedAppContext parts 2021-09-13 23:09:28 +03:00
Triang3l
acbd22840d [Base] Android log sink + sink cleanup 2021-09-13 22:53:19 +03:00
Triang3l
6986d6c7e8 [Config] Use locale-neutral fmt instead of to_string 2021-08-28 18:26:18 -05:00