sharpemu/src/SharpEmu.HLE
Berk 0163750e7e
Page fixes (#1023)
* [DeS] Fixes for page faults and stack bounds issues in the emulator and audio fixes

* [ShaderPrewarm] Hold the game until the prewarm finishes and resume interrupted runs

The prewarm compiled thousands of compute pipelines on background threads
while the now faster boot ran beside it, so logos, Bink movies and the first
scenes raced the compile and dropped frames.

- Hold the guest at its first splash hide, GPU submission or CPU flip until
  the prewarm is decided and done; the render thread keeps presenting the
  splash. SHARPEMU_SHADER_PREWARM_WAIT=0 opts out.
- Stamp only the shader translators, the compiler type and the driver, so a
  Libs-only build no longer triggers a full prewarm.
- Record finished pipelines in shader-prewarm.progress so an interrupted
  prewarm resumes with the remaining ones.

* [AudioOut2] Block a blocking push only until a queue slot frees

A blocking sceAudioOut2ContextPush waited only when the host stream hit its
128 KiB cap, so a title rendering faster than real time kept about 680 ms
queued and every sound played that far behind (GTA V: queue=2 context,
queued_ms avg=678). The push now waits until the device holds the cushion
plus QueueDepth-1 grains, the level GetQueueLevel already reports as full;
the host cap stays as the limit for non-blocking bursts. GTA V now holds
about 41 ms with no underruns.

* [GPU] Run bounded modulo copies of plain words on the host

Demon's Souls copies its per-frame constant and descriptor tables with a
compute kernel (dst[i] = src[i % N] for i < count). Run on the GPU, the
destinations stay GPU-dirty, and every draw whose resource tables read them
waits for a readback: about 19% of the render thread in the title scene,
for values that never changed.

The kernel is now recognized by its instruction sequence. When both
descriptors are plain 32-bit words of the same format and neither range is
GPU-dirty or GPU image memory, the copy is written to guest memory through
the host DMA path and the dispatch is skipped; anything else still runs on
the GPU. SHARPEMU_HOST_BOUNDED_COPY=0 turns it off.

Title scene with profiling: 7.4-8.6 -> 11.8-15.9 fps.

* [Diagnostics] Summarize synchronized table reads and trace several writer addresses

SHARPEMU_TRACE_GPU_READS=1 now also reports, every five seconds, the guest
words resource planning read through a GPU synchronization: read count, how
often the value changed, and the first and last value. SHARPEMU_TRACE_WRITER_ADDRESS
accepts a comma-separated list.
2026-10-04 19:07:37 +03:00
..
Aerolib [SourceGenerators] Compile-time SysAbi export registry, analyzers, and build-generated aerolib.bin (#204) 2026-07-16 00:00:32 +03:00
GpuMemory Page fixes (#1023) 2026-10-04 19:07:37 +03:00
GuestMemory Perf computed shaders (#1013) 2026-10-03 04:49:43 +03:00
Host Perf computed shaders (#1013) 2026-10-03 04:49:43 +03:00
CpuContext.cs Alpha rebuild part2 (#893) 2026-09-21 00:29:16 +03:00
CpuRegister.cs initial commit 2026-03-11 15:48:28 +03:00
ExportedFunction.cs feat(hle): prefer loaded guest exports for selected registrations (#844) 2026-08-25 22:32:57 +02:00
Generation.cs initial commit 2026-03-11 15:48:28 +03:00
GuestCStringAttribute.cs [SourceGenerators] Compile-time SysAbi export registry, analyzers, and build-generated aerolib.bin (#204) 2026-07-16 00:00:32 +03:00
GuestFastPath.cs Perf computed shaders (#1013) 2026-10-03 04:49:43 +03:00
GuestImageWriteTracker.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
GuestMemoryLayout.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
GuestPageProtection.cs Host platform abstraction layer for the execution engine (#181) 2026-07-15 03:15:36 +03:00
GuestThreadExecution.cs Perf computed shaders (#1013) 2026-10-03 04:49:43 +03:00
GuestTlsTemplate.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
GuestWriteWatch.cs Prevent invalid SaveData writes from damaging guest memory (#444) 2026-07-19 20:27:17 +03:00
HleDataSymbols.cs [AGC/Vulkan] Extend PS5 runtime and rendering compatibility (#216) 2026-07-16 02:02:34 +03:00
HostMainThread.cs Sdl backend (#670) 2026-07-28 03:33:26 +03:00
HostMemory.cs [CPU] Cache readable stack ranges per thread for import arguments on POSIX (#911) 2026-09-26 14:19:48 +03:00
HostSessionControl.cs Sdl backend (#670) 2026-07-28 03:33:26 +03:00
ICpuMemory.cs Astrobot / Demon's soul performance improvement (#955) 2026-09-30 18:14:21 +03:00
ICpuMemoryWrapper.cs Host platform abstraction layer for the execution engine (#181) 2026-07-15 03:15:36 +03:00
IGuestAddressSpace.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
IGuestBackedSpace.cs Perf computed shaders (#1013) 2026-10-03 04:49:43 +03:00
IGuestMemoryAllocator.cs Fix virtual memory allocation and access (#193) 2026-07-14 21:50:54 -06:00
IModuleManager.cs [SourceGenerators] Compile-time SysAbi export registry, analyzers, and build-generated aerolib.bin (#204) 2026-07-16 00:00:32 +03:00
ISymbolCatalog.cs initial commit 2026-03-11 15:48:28 +03:00
ModuleManager.cs [SourceGenerators] Compile-time SysAbi export registry, analyzers, and build-generated aerolib.bin (#204) 2026-07-16 00:00:32 +03:00
OrbisGen2Result.cs [kernel] Wake blocked waiters on semaphore signal, cancel, and delete (#67) 2026-07-11 22:17:24 +03:00
SharpEmu.HLE.csproj Sdl backend (#670) 2026-07-28 03:33:26 +03:00
SysAbiExportAttribute.cs feat(hle): prefer loaded guest exports for selected registrations (#844) 2026-08-25 22:32:57 +02:00
SysAbiFunction.cs initial commit 2026-03-11 15:48:28 +03:00
SysAbiSymbol.cs initial commit 2026-03-11 15:48:28 +03:00