Commit Graph

1055 Commits

Author SHA1 Message Date
Shokunin 12fed869fe Dynres: hold through a savestate load; opt-in DXGI flip presentation (experimental)
- A savestate load is not a heavy scene: hold the dynamic-resolution
  level for the whole 2 s request and do not arm fast descent, which
  dropped 18x -> 11x within a second of every load and climbed back
  slowly.
- gl_dxgi_present.c: present the present thread's frames through a DXGI
  FLIP_DISCARD swapchain via WGL_NV_DX_interop2 (Present(1,0), one frame
  per refresh). Opt-in (PSX_GL_DXGI_PRESENT=1): sharing the HWND with the
  GL window surface froze the screen in the first test; needs a child
  window before it can be default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 12:42:34 -07:00
Shokunin c2cf5ffd03 Render-pass worker: run concurrently with emulation
The worker only ran inside the emulation thread's pacing idle window, so
heavy scenes (short windows) lost their in-between frames. It now runs
as soon as a job is queued, on its own core, bounded by the job's own
presentation period.

Shared state that made concurrent runs crash or race, now per thread:
- render_pass_mmio_read_allowed could longjmp to the emulation thread's
  synchronous-pass jump buffer from the worker (instant crash). The
  abort state (s_abort_jmp, s_abort_armed, s_pass_cpu,
  s_device_read_fault, s_attempt) is thread-local, and a private
  execution aborts its own job through g_psx_execution_abort.
- The VRAM dirty mask: marks from the worker's private snapshot are
  dropped (gpu_vram_dirty_set_private_thread).
Plan changes already quiesce (join) the worker before the hook table is
rebuilt.

R4 release, RTX 4080 8K, driven lap, DXGI on-screen count: 4/4 runs
stable (was 1 crash in 2); 50-60 distinct/s on straights.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 12:18:31 -07:00
Shokunin 956262a934 Present thread: never drop a guest frame on an unsignaled fence
pt_cb_present tested the composing context's readiness fence with a zero
timeout and dropped any slot whose commands had not finished, guest
frames included. Nothing was swapped, so the screen held the previous
image while emulation ran on: seconds of 1-10 fps on an 8K display while
every counter reported 60. The presenter now makes its GPU queue wait on
a guest frame's fence (glWaitSync; the CPU does not block). Only optional
temporal frames may still be dropped when unready or late.

present_loop counted a dropped image as a present; it now counts swaps
in presents and drops in a new dropped field (debug JSON
present_thread.dropped).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 01:28:42 -07:00
Shokunin 502072f943 Schedule optional guest replay within source pacing idle budgets 2026-10-21 22:36:01 -07:00
Shokunin e1662e49a2 Prepare replay snapshot storage on the optional worker 2026-10-21 21:44:24 -07:00
Shokunin 41f3f647d6 Target measured worker RAM publication and remove general clock experiments 2026-10-21 21:28:03 -07:00
Shokunin 25f7180937 Keep scaled charges compact and preserve event callback ordering 2026-10-21 21:08:45 -07:00
Shokunin a0730198d9 Share hot clock charging while folding register dependencies 2026-10-21 20:57:59 -07:00
Shokunin b1636f975d Avoid unused PGXP operand copies and excessive load expansion 2026-10-21 20:40:33 -07:00
Shokunin 45a54ec409 Share cycle fast charge with timed loads and fold load operands 2026-10-21 20:21:49 -07:00
Shokunin 8114565a3c Avoid read-side snapshot churn and inline common cycle steps 2026-10-21 19:53:23 -07:00
Shokunin fb28d7c00d Retain private publication images and honor extra-frame deadlines 2026-10-21 18:55:43 -07:00
Shokunin 87270c7e9b Hand off worker draws at present and export production identity receipts 2026-10-21 18:31:02 -07:00
Shokunin 6ae7f39094 Run extra guest draw work in private double-buffered contexts 2026-10-21 18:02:07 -07:00
Shokunin efe800c9a4 Add private dispatch metadata and bounded worker command capture 2026-10-21 17:33:39 -07:00
Shokunin 2bedbe9a97 Isolate replay GPU regions, GTE precision and frozen clocks 2026-10-21 17:09:25 -07:00
Shokunin a54b9f00c6 Add private memory backing and paged PGXP execution snapshots 2026-10-21 16:41:56 -07:00
Shokunin 58f1741011 Settle overlay charges before rebinding execution context 2026-10-21 16:30:22 -07:00
Shokunin 8d73618f79 Isolate compiled overlay bindings per execution thread 2026-10-21 16:27:49 -07:00
Shokunin f4b6809138 WIP: checkpoint render-thread temporal presentation work 2026-10-21 16:16:30 -07:00
Shokunin af942084ea WIP: queue temporal deadlines and release refused render plans 2026-10-21 14:57:04 -07:00
Shokunin a3a3599432 Allow unchanged presents when the deadline pacer caps guest timing 2026-10-21 14:11:21 -07:00
Shokunin 8f3b3373f3 Preserve full positive depth for exact far PGXP projection 2026-10-21 14:11:21 -07:00
Shokunin 0ed97f340d Preserve far-world projection through validated intact GTE words 2026-10-21 14:11:21 -07:00
Shokunin eb7b893395 Apply the display ceiling after supersampling and monitor selection 2026-10-21 14:11:20 -07:00
Shokunin d7e5b6536d Keep presenter pacing out of dynamic-resolution overload signals 2026-10-21 14:11:20 -07:00
Shokunin f534f71b8b Exclude host waits from render-thread GPU timing brackets 2026-10-21 14:11:20 -07:00
Shokunin 7a015840db Limit supersampling on high-resolution displays by opt-in policy 2026-10-21 14:11:20 -07:00
Shokunin d99581b5d3 Replay recorded routes and export production frame costs 2026-10-21 14:11:20 -07:00
Matt Stanley 916da6f80d Integrate shared disc tray with the maintained menu provider (#652) 2026-10-19 18:13:38 -07:00
Matthew Stanley ee9e464fd0 Preserve stock-frame VSync on faster displays 2026-10-19 18:02:47 -07:00
Matt Stanley 13b7f81d29 Add guarded instruction variants fixed during offline mod activation
Keep selector zero stock and seal all choices until the next session restart. Refuse nonzero online activation, scope non-stock save states by frozen choices, and preserve original instruction guards when combined with effective-address adapters. Use overlay ABI34 on current master without the old menu dependency stack.
2026-10-19 16:37:32 -07:00
Matt Stanley c0ffd6d4c5 Support guarded mod address adapters and atomic extended memory cards
Extract the audited adapters and card transport onto master without the held selector/menu stack. Keep adapters and codecs tied to mod activation, use overlay ABI 33, retain rejected-load protection on codec registration, and refuse extended-card codecs in netplay before frame zero. Preserve default atomic save publication and guest-visible write failures.
2026-10-19 16:00:11 -07:00
Matt Stanley bc574c5700 Isolate runtime publication and wall-time diagnostics from held mod selector stack 2026-10-19 14:07:22 -07:00
Matt Stanley da9029a73a Merge current master and qualified review fixes into PR #408 2026-10-19 13:09:25 -07:00
Matt Stanley cda860fe74 Merge current master and qualified review fixes into PR #670 2026-10-19 13:09:14 -07:00
Matt Stanley 82062711b3 Merge pull request #669 from RetroPortingToolKit/work/windows-file-identity-fallback
Use full verification for unqualified Windows file identities
2026-10-19 13:06:47 -07:00
Zap0xfce2 1b778616b7 feat(widescreen): continue framebuffer-feedback sprites into native-wide bands (#692)
* feat(widescreen): continue framebuffer-feedback sprites into native-wide bands

Titles tag a 15-bit sprite that copies a framebuffer 1:1 (gpu_ws_tag_feedback_rect / psx_mod_tag_feedback_rect). Where it touches the draw area's edge, gpu.c emits band spans and the new optional backend op wide_feedback_rect (GL incl. render thread, software) samples the source buffer's wide surface. Band texels count as bit 15 set, as the centre does once the trail blends.

The software rasterizer now writes the texel's bit 15 into the framebuffer, and wide_full can dump the surface alpha ("alpha":1).

* fix(widescreen): quantise band feedback like packed VRAM

The centre samples 5-bit packed VRAM each frame; the band copy read the 8-bit wide surface and modulated with /128, so the bands drifted ~3 grey levels brighter and left a step at the 4:3 edge. Truncate like PACK_FS and modulate like TEX_FS.

* Reject fully clipped sprites before extending feedback margins

* Complete isolated resident and PGXP fixture collaborators

* Preserve existing line endings in the review fixes

---------

Co-authored-by: Matthew Stanley <1379tech@gmail.com>
2026-10-19 11:44:13 -07:00
Matt Stanley ac71aec441 Merge pull request #685 from boburning/fix/portable-generated-texture-defaults
Keep runtime-generated texture-pack defaults portable across installs
2026-10-19 11:44:00 -07:00
Matt Stanley a5db252c3f Merge pull request #676 from zap0xfce2/feat/ws-screen-x-sltu-band
feat(widescreen): screen_x_sites band form for sltu with the width in a register
2026-10-19 11:43:40 -07:00
Matthew Stanley a848b2281e Retain complete radial masks across buffered packet layouts 2026-10-18 21:54:58 -07:00
Matthew Stanley 96fbf0391c Merge remote-tracking branch 'origin/master' into fix/playtest-renderer-coverage-20261018 2026-10-18 21:08:46 -07:00
Matthew Stanley db596520ab Record real renderer activity and explicit playtest verification coverage 2026-10-18 20:55:22 -07:00
boburning 572558394b Keep runtime-generated texture-pack defaults portable across installs 2026-10-18 13:09:07 -04:00
Matthew Stanley 40892ebb2c Fix transition capture and enforce title-disabled mod packages 2026-10-17 13:15:40 -07:00
Matthew Stanley 4a7a8d54ac Keep diagnostic display independent and stage setup replay helper 2026-10-17 13:13:02 -07:00
Matthew Stanley 09221b8263 Share bounded playtest diagnostics and isolated verified replay 2026-10-17 13:04:46 -07:00
Matthew Stanley cf9bf1f9fd Allow developer pad injections to exercise serial hotplug 2026-10-17 09:40:22 -07:00
Matthew Stanley fedb5319d2 Support scoped modern controls and replay controller presence
Keep temporary keyboard profiles separate from saved bindings. Add optional persistent mouse capture with ordered release/focus/reset handling, and let offline sources represent an unplugged port without falling back to physical input. Existing capture and source defaults remain intact. Beads: beads-9wg8 and beads-eio.19.18.
2026-10-17 09:19:31 -07:00
Zap0xfce2 339007ecf1 feat(widescreen): screen_x_sites band form for sltu with the width in a register
Renderers that test a 16-bit screen X with an unsigned compare against a width kept in a register (often a loaded clip bound) reject every negative X, so widening the bound only reveals the right band. A screen_x site on sltu now routes through psx_ws_cull_sltu_band: -4m <= (int16)SX < W while widened, identity at 4:3. Four margins keep large near polygons whose corners all lie past one margin; an unbounded left side overflowed a renderer's fixed primitive lists. Covered by ws_cull_screen_x_hi_codegen_test; documented in WIDESCREEN.md.
2026-10-16 11:27:59 +02:00