sharpemu/tests/SharpEmu.Libs.Tests/Gpu/Scheduling
Berk 2838b25806
Render pipeline throughput (#1082)
* [GPU] Run the command stream on its own thread and speed up draw execution

ASTRO BOT crowd scene: ~25 FPS -> ~55-58 FPS.

- The PM4 command stream is interpreted on its own thread. Draws, dispatches,
  barriers, end-of-pipe writes and the interpreter's stores are handed to the
  render thread in stream order through a short queue (64 items); callbacks
  that return a result wait for the work before them.
- Graphics program resolution runs on a worker thread ahead of the draws, from
  copy-on-write register bank snapshots, and is validated against the GPU
  ownership state before use.
- The resource materialization cache rebases buffer base addresses instead of
  missing on every moved descriptor.
- DCC metadata fills that cannot be absorbed run on the host, so binding the
  surface no longer waits for a GPU readback.
- Cheaper per-draw work: cached pipeline lookups no longer wait on program
  preparation, redundant dynamic state is skipped, image bindings and target
  requests are memoized, fewer allocations.
- Guest thread stack/TLS slots are chosen and mapped under one lock, so two
  threads can no longer share a stack.
- Wave lowering split into native wave32, native wave64 and emulated wave64.

* [GPU] Record a frame's draws before its boundary returns to the guest

With the command stream on its own thread, a frame boundary only posted its
flush, so the guest resumed while up to 64 items of the frame were still
queued for the render thread. The guest then rewrote per-draw memory
(descriptor tables, rings) that those draws read when recorded, which showed
as black frames and flicker. The boundary now waits for the render thread to
run everything queued before it.

* [ShaderCompiler] Prove wave64 programs whose lanes never read each other

* [ShaderCompiler] Find vector writes that no later instruction observes

* [ShaderCompiler] Declare the SubgroupId built-in

* [ShaderCompiler] Let compile requests ask for 32-lane compute subgroups

* [ShaderCompiler] Run wave64 compute as paired lanes on 32-lane subgroups

* [ShaderCompiler] Run lane-local wave64 programs as independent half waves

* [GPU] Compile wave64 compute for 32-lane subgroups when the host lacks wave64

* [ShaderCompiler] Skip EXEC selects for vector writes no lane observes

* [Diagnostics] Count GPU barriers and rendering scopes

* [GPU] Merge consecutive memory barrier requests in a recording buffer

* [GPU] Request guest memory barriers through the recording buffer

* [GPU] Track GPU write ticks per buffer range

* [GPU] Publish read-back pieces that no later write covers

* [GPU] Stop reading ahead windows whose copies keep going stale

* [GPU] Skip the upload walk when no CPU-dirty page is in range

* [ShaderCompiler] Count the finest mip each pixel sample reaches

* [GPU] Pack LOD statistics reports from counter words

* [GPU] Report LOD statistics measured on the GPU

* [ShaderCompiler] Start pixel append programs without helper lanes

* [GPU] Advance a binding epoch when helper passes bind their own state

* [GPU] Skip native binds that repeat the bound state

* [GPU] Split the post-lookup work out of image lookups

* [GPU] Memoize texture lookups of DCC images

* [Core] Map guest thread priorities one band lower

* [HLE] Write single-view guest memory without the region lock

* [HLE] Answer GPU span coverage from a snapshot

* [HLE] Skip the region lock for writes to CPU-dirty pages

* [AGC] Emit packets with one write and read the buffer state at once

* [AGC] Emit dispatch, memory and marker packets with one write

* [AGC] Emit indirect buffer packets with one write

* [AGC] Emit draw packets with one write

* [AGC] Emit event and flip packets with one write

* [AGC] Emit register packets with one write

* [Tests] Cover wave64 subgroups, readbacks, barriers, LOD statistics and packet writes

* [Profile] Count resource cache refusal reasons

* [Profile] Classify what changed in stale resource cache entries

* [Profile] Attribute render thread GPU waits to their call sites

* [Profile] Count DCC metadata synchronizations and their outcome

* [Diagnostics] Report the GPU writers of synchronized DCC metadata

* [GPU] Fill metadata-shaped bounded fills on the host

* [Presenter] Merge overlapping concurrent resolve ownership answers

* [Tests] Cover concurrent resolve answers and release device slabs

* [GPU] Write the mip statistics report with its ready marker

* [GPU] Write the interpreter's LOD statistics through the shared report writer

* [Presenter] Write the bound mip statistics in stream order on the render thread

* [Presenter] Report bound mip statistics by default and measure on the GPU on request

* [Tests] Cover the written mip statistics report

* [GPU] Decode repeated FP16 and uint buffer fill words

* [GPU] Clear image buffer owners with format-correct fill values

* [Tests] Cover FP16 and uint buffer fills and raw fallback

---------

Co-authored-by: Astellou <mathieu.richardeau@gmail.com>
2026-10-13 05:21:41 +03:00
..
EndOfPipeTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
GpuWorkerRelayTests.cs Unity fixes 1016p1 (#1043) 2026-10-06 18:43:21 +03:00
MappingDrainTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
PresenterSubmissionTests.cs Revert "Ghost of Yōtei and Tsushima in game: rendering, GPU/CPU memory coherence, tessellation" 2026-10-13 03:38:40 +03:00
RecordingBufferBarrierTests.cs Render pipeline throughput (#1082) 2026-10-13 05:21:41 +03:00
SchedulingTestSupport.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
SubmissionSchedulerTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
TickTimelineTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
TickedBufferRingTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00