206 Commits

Author SHA1 Message Date
Stenzek
3ea26cc910
GPU: Rewrite automatic resolution scaling
Make it play nice with rewind/runahead.
2025-02-21 23:58:05 +10:00
Stenzek
64d3716cfd
GPU: Further simplify draw rect calculation
Remove "Stretch Vertically" option, it was very confusing to users.

Integer scale will prefer whichever direction gets a larger draw
rectangle/preserves as much detail.
2025-02-02 17:02:58 +10:00
Stenzek
a5940b2e21
GPU: Use constants for display overscan range 2025-02-02 15:39:20 +10:00
Stenzek
37e5e64ddc
System: Move state display updates to call sites
Fixes black frames when changing settings with runahead/rewind enabled.
2025-01-01 23:05:08 +10:00
Stenzek
4d4523dc04
GPU: Use same early culling rules for lines as polygons 2024-12-30 18:11:52 +10:00
Stenzek
c99625e4c3
GPU: Move vertex culling to GPU thread
i.e. push all primitives through unless they are oversized, which the
GPU will definitely skip.

Needed because of coordinate truncation in Final Fantasy VIII, these
scenes will now render correctly with the software renderer again.
2024-12-28 20:24:09 +10:00
Stenzek
0b4e302c22
GPU: Implement PGXP for lines 2024-12-22 16:48:45 +10:00
Stenzek
080d30bf0c
GPU: Slightly adjust PAL active range
Gets the PAR closer to the expected value of 59/94 with a divider of 4.
2024-12-21 23:05:30 +10:00
Stenzek
26db661a05
GPU: Remove global indirection 2024-12-21 14:35:12 +10:00
Stenzek
2d659fc3eb
GPU: Move backend work off CPU thread 2024-12-19 23:32:15 +10:00
Stenzek
831c982f3b
System: Rewrite memory save state handling
Makes it more friendly to GPU thread.
2024-12-19 22:42:28 +10:00
Stenzek
0befbf8021
GPU: Add Uncorrected Borders crop mode
Should behave the same as the old "All Borders" mode.
The pixel aspect ratio WILL BE WRONG.

Also fixes the size of screenshots in internal resolution mode.
2024-11-26 18:00:19 +10:00
Stenzek
5fd79254bd
GPU: Fix crash when toggling software renderer 2024-11-26 12:58:12 +10:00
Stenzek
b180b26728
GPU: Rework "All Borders" cropping to be aspect correct
The "All Borders" crop mode was previously creating an aspect ratio that
was completely incorrect when using modes outside of Auto/4:3. We now
scale the aspect ratio relative to the PAL/NTSC aspect ratio to account
for this, regardless of how much of a border the game configures.

Overscan cropping also produced an incorrect aspect ratio outside of 4:3
mode, resulting in minor horizontal stretching. It is now correct,
however, this results in black borders being added in 16:9 for most
games.

To remove these borders, you have two options:

 - Use the "Stretch to Fill" aspect ratio. This will scale the GTE
   aspect ratio to fill the screen.

 - Use the "Only Overscan Area (Aspect Uncorrected)" crop mode. This
   mode retains the "old" behaviour, resulting in a stretched image.
2024-11-25 16:26:16 +10:00
Stenzek
24dfd30839
Image: Refactor to a more generic class 2024-11-24 23:29:29 +10:00
Stenzek
5c03e1d940
Misc: Fix alignment errors on ARM32 2024-11-23 18:52:45 +10:00
Stenzek
bfadd608fb
System: Add 'Task Threads'
Used for saving screenshots/GPU dumps.
2024-10-30 15:19:10 +10:00
Stenzek
1ae2dcf192
GPU: Propagate initialization error to caller
Avoids double error popup.
2024-10-26 01:41:29 +10:00
Stenzek
4ab22921c4
GPUDump: Add GPU dump recording and playback
Implements the specification from:

https://github.com/ps1dev/standards/blob/main/GPUDUMP.md
2024-10-20 22:02:24 +10:00
Stenzek
86a28d5dc0
ImGuiOverlays: Move debug state to auxiliary windows 2024-10-18 20:48:30 +10:00
Stenzek
71bb953253
GPU/HW: Handle redundant texture window updates
Significantly reduces draw count in THPS2.

~150 draw calls per frame to ~70.
2024-10-05 13:06:45 +10:00
Stenzek
c46ec398dc
GPU: Move software fill/write/copy into rasterizer namespace 2024-09-26 18:30:46 +10:00
Stenzek
e1c876671a
Misc: More iNN => sNN 2024-09-22 21:06:05 +10:00
Stenzek
f169b892c1
GPU: Defer frame done if not running events
Prevents interruption/execution exiting if the frame was ticked over
by a MMIO access, e.g. reading GPUSTAT.
2024-09-22 21:06:05 +10:00
Stenzek
b5df06a54a
GPU/HW: Rewrite automatic internal resolution selection
Make it aspect ratio aware, as well as updating when/if the game changes
resolution. Also include the padding area in the OSD/status resolution.
2024-09-21 22:26:05 +10:00
Stenzek
4b0c1fdbf2
GPUDevice: Add recovery from lost device 2024-09-07 12:48:44 +10:00
Stenzek
f9a594058f
Settings: Force Frame Timings => Force Video Timing
Also drop from GameDB, an override doesn't make sense here anyway,
due to the low success rate with the enhancement.
2024-09-03 19:06:26 +10:00
spacepaw
63abdb7afd
Reworked the "Force NTSC Timings" feature to support both NTSC and PAL frame timings (#3287) 2024-09-03 10:50:45 +02:00
Stenzek
7f4e5d55db
Misc: Update copyright headers 2024-09-01 22:08:31 +10:00
Stenzek
8b3fd538ea
System: Fix HW/SW rendering swap 2024-08-23 15:59:31 +10:00
Stenzek
abbb21ffec
GPU: Approxiate texture cache reload time for P8/C16 sprites 2024-08-11 23:50:37 +10:00
Stenzek
af47eb6956
System: Add video capture feature 2024-08-11 21:06:58 +10:00
Stenzek
b2ca23e9da
GPU: Use full display rect for postfx calculations 2024-08-06 17:38:08 +10:00
Stenzek
6c0a0e6203
GPU: Fix incorrect lightgun line with force progressive 2024-08-04 17:54:19 +10:00
Stenzek
7a3a72ec3d
GPU: Add display rotation option 2024-07-26 23:09:33 +10:00
Stenzek
4f7ddfaae6
TimingEvents: Remove pointer indirection
Probably should move this to one big array for locality.
2024-07-19 22:56:41 +10:00
Stenzek
59a2309a83
GPU: Use half width vector types where appropriate 2024-07-14 21:25:48 +10:00
Stenzek
ed5a99066f
GPU: Cull off-screen sprites/lines
And further optimizations to culling in general.
2024-07-06 22:13:46 +10:00
Stenzek
9ef7e8c5d0
GPU/HW: Use GSVector instead of Rectangle 2024-07-03 15:44:12 +10:00
Stenzek
aabe39d0f8
GPU: Allow DMAs in Mode 1
Exact behaviour is still unknown, but it works on console (Nicolas
Noble's torus demo).
2024-07-02 16:56:11 +10:00
Stenzek
34d5cdec96
GPU/HW: Expose depth buffer to internal postprocessing 2024-06-29 14:25:36 +10:00
Stenzek
80d1056ddf
GPU: Add virtual call when buffers are swapped 2024-06-28 21:15:47 +10:00
Stenzek
810ce1ce57
GPU: Remove duplicate display params fields
And enable postfx when the DAC is turned off.
2024-06-28 20:17:15 +10:00
Stenzek
10df7ba319
GPU/HW: Ensure CLUT cache is synced when using SW-for-readbacks 2024-05-23 14:30:18 +10:00
Stenzek
1185f8f6aa
GPU: Implement CLUT cache (SW renderer only)
Fixes copyright screen in Shadow Master.
Fixes title splash in Castrol Honda Superbike Racing.
2024-05-02 01:03:58 +10:00
Stenzek
d1483d8077
GPU: Rework pre-draw clipping 2024-05-02 01:03:58 +10:00
Stenzek
fec210b1e1
GPU: Ensure coordinates are masked/clamped 2024-05-01 20:58:21 +10:00
Stenzek
25f725c263
GPU: Fix mask for drawing area coordinates 2024-04-28 15:44:41 +10:00
Stenzek
3be02c53c1
GPU: Improve CRTC hblank accuracy
And implement Timer0 gating, it was missing previously.
2024-04-28 15:25:24 +10:00
Stenzek
417bf0c3bc
DMA: Better enforce CPU runtime during linked list
and get rid of the hack for Newman Haas.
2024-04-10 20:11:23 +10:00