Commit Graph
25 Commits
Author SHA1 Message Date
Spooks 0bd63c5a74 Update native Vulkan backend interface 2026-07-15 18:34:06 -06:00
Spooks 25ea376d41 Fix Linux aligned mapping retention 2026-07-15 18:33:35 -06:00
Spooks 94463576f8 Make external Vulkan backend optional 2026-07-15 18:19:47 -06:00
Spooks c707f4d2ce Fix partial draw cleanup and window sizing 2026-07-15 18:19:47 -06:00
Spooks 0c750ffa61 Add FPS counter to native renderer title 2026-07-15 18:19:47 -06:00
Spooks cd27d3824b Enable Vulkan support in packaged SDL3 2026-07-15 18:19:47 -06:00
Spooks 74c18837f3 Use secure gamepad name copy on Windows 2026-07-15 18:19:47 -06:00
Spooks 6bb7cd5192 Preserve native Vulkan startup errors 2026-07-15 18:19:47 -06:00
Spooks 7d4b6c1187 Disable SDL entry point shim in native DLL 2026-07-15 18:19:47 -06:00
Spooks f90b5fa82c Initialize SDL host entry point on Windows 2026-07-15 18:19:47 -06:00
Spooks bd33ce464e Stage native GPU runtime after publish 2026-07-15 18:19:47 -06:00
Spooks 3ac4c7a0bb Install SDL3 Wayland and IBus dependencies 2026-07-15 18:19:47 -06:00
Spooks 3983c70475 Install libltdl for Linux native dependencies 2026-07-15 18:19:47 -06:00
Spooks d0e7adec3b Install vcpkg autotools prerequisites 2026-07-15 18:19:47 -06:00
Spooks 30d6e9eda6 Install native renderer dependencies in CI 2026-07-15 18:19:47 -06:00
Spooks 919b9d92bb Build native renderer before output staging 2026-07-15 18:19:47 -06:00
Spooks 8c0903f297 Add native backend license headers 2026-07-15 18:19:47 -06:00
Spooks 5594d89cbd Rewrite Vulkan backend with native renderer 2026-07-15 18:19:47 -06:00
Spooks 9d88542efd Fix virtual memory allocation and access (#193)
* Fix virtual memory allocation and access

* Update test dependency lock file
2026-07-14 21:50:54 -06:00
SpooksandSpooks4576 d8397b022e Performance Improvements and Optimization Tweaks (#156)
* Improve Gen5 rendering performance and compatibility

* Pin .NET SDK for locked restore

---------

Co-authored-by: Spooks4576 <Spooks4576@users.noreply.github.com>
2026-07-14 20:22:52 +03:00
SpooksandSpooks4576 787d3a1efb Fix Gen5 boot and restore stable AGC rendering (#139)
Co-authored-by: Spooks4576 <Spooks4576@users.noreply.github.com>
2026-07-14 16:13:42 +03:00
SpooksandSpooks4576 d43edc865a Agent/fix gen5 thread agc compat (#130)
* Fix Gen5 thread and AGC compatibility

* Trim compatibility comments

* Report selected Vulkan GPU

* Clean up CPU title label

* Improve emulator frame pacing and performance

* Regenerate package locks with pinned SDK

---------

Co-authored-by: Spooks4576 <Spooks4576@users.noreply.github.com>
2026-07-14 14:41:42 +03:00
Spooks 50f78f3713 [VideoOut] Drive vblank from a timer so UE render threads advance (#114) 2026-07-13 21:34:39 +03:00
Spooks 63b440efcd [HLE] Fix guest-thread sync and boot for Unreal Engine titles (#102)
* [HLE] Fix guest-thread sync and boot for Unreal Engine titles

Silent Hill: The Short Message (and other UE titles) now boot the full
engine thread graph instead of hanging early. Four related fixes:

- pthread cond/mutex semantics: retain a signal raised with no waiter as
  pending, and key block/wake on the state's identity rather than a
  resolved address that could differ between lock and unlock. This ends
  the ~1.5M-call cond_wait busy-spin.

- Warm HLE type initializers and force-JIT their methods on a host thread
  at Freeze(). A .cctor or first-time JIT running on a guest thread's
  hijacked stack fail-fasts the CLR as "Invalid Program: attempted to
  call a UnmanagedCallersOnly method from managed code".

- Guest thread scheduling: pump after a wake so a readied thread actually
  runs, add a dispatcher thread for when every guest thread is parked,
  and make the pump-depth guard an atomic CAS.

- Route mutex/rwlock lock/unlock off the non-blocking leaf-import fast
  path so a contended lock can deschedule its guest thread.

Ported from the unreal-boot-fixes branch.

* [HLE] Keep mutex/rwlock unlock on the leaf-import fast path

The previous change routed all mutex/rwlock lock and unlock NIDs off the
leaf fast path so a contended lock could deschedule its guest thread. But
unlock never blocks, and taking it off the fast path made it slow enough
that Demon's Souls' job workers livelocked in a guest spinlock (millions
of mutex_unlock calls, no import progress, main thread stuck in
sceKernelWaitEventFlag).

Only *lock* needs to leave the leaf path. Restore the four unlock NIDs
(mutex + rwlock) so guest spinlocks stay cheap, while lock/rd/wrlock
remain off it for the blocking case Silent Hill needs.

* [HLE] Gate pthread_mutex_lock guest-thread blocking (fixes Demon's Souls)

Re-enabling cooperative deschedule on a contended pthread_mutex_lock
regressed Demon's Souls: its job workers run on libSceFiber, and blocking
a guest thread mid-fiber left sceFiberSwitch returning ESRCH followed by
a null fiber-context deref (0xC0000005). Bisect confirmed the pthread
change as the cause; the game reaches the same point as before it once
the block is skipped.

Gate the block behind SHARPEMU_MUTEX_LOCK_BLOCKING (off by default) so
contended locks fall through to the synchronous host-thread wait. The
rest of the pthread fixes (cond_wait pending signals, identity wake keys)
are unaffected.
2026-07-13 18:59:38 +03:00
Spooks 298ef01809 [VideoOut] Prefer NVIDIA/discrete GPUs over integrated (#97)
SelectPhysicalDevice took the first device exposing a graphics+present
queue. On hybrid-graphics laptops that is the integrated GPU, so the
discrete card went unused - and AMD's integrated driver access-violates
inside vkCreateGraphicsPipelines while compiling some translated guest
shaders, killing the process. The CLR surfaced that native AV as
"Invalid Program: attempted to call a UnmanagedCallersOnly method from
managed code", which made it look like a CPU/threading fault.

Score the candidates instead: NVIDIA parts win, other discrete GPUs come
next, and an integrated GPU is only chosen when nothing else can present.
SHARPEMU_VK_DEVICE=<substring> pins a specific adapter, and the selected
device is logged.
2026-07-13 15:05:59 +03:00