Commit Graph

372 Commits

Author SHA1 Message Date
Henrik Rydgård b636356f36 copy: Reverse the order of the y and seq heuristics 2023-12-01 20:40:12 +01:00
Henrik Rydgård cef17589d2 Move the oversize copy detection to a better location (less false positive) 2023-12-01 00:30:06 +01:00
Henrik Rydgård d9365a6df1 FramebufferCopy: New framebuffer candidate sorting, similar to block transfer detection.
The previous attempt was simply flawed.
2023-12-01 00:10:16 +01:00
Henrik Rydgård 7920e86098 Add heuristic, fixing video flicker in Naruto UNH 2 caused by copy to wrong target. 2023-11-30 22:19:52 +01:00
Henrik Rydgård dae758e5f4 Fix some bugs and mistakes found by Nemoumbra through static analysis 2023-11-26 13:43:11 +01:00
Henrik Rydgård 77825484a0 If available, use 16-bit texture formats for MakePixelTexture when appropriate.
Optimization for God of War on low-end platforms. Avoids calling a color
conversion function that's currently only SIMD-optimized on x86, so will
also benefit ARM a little bit.
2023-11-12 15:58:03 +01:00
Henrik Rydgård 49f5da370a Simplify the logic in MakePixelTexture a bit 2023-11-12 11:19:45 +01:00
Henrik Rydgård cc6f9a73ca Oops, fix for previous commit. And minor optimization. 2023-11-12 01:32:02 +01:00
Henrik Rydgård 632fa1c9d6 Cache and hash data for DrawPixels.
We already had a cache to reuse texture objects so just
opportunistically reuse them when easy to do so.
2023-11-11 19:58:12 +01:00
Henrik Rydgård 226d25721a Add a block transfer GPU stat, remove a redundant one 2023-10-03 13:15:55 +02:00
Henrik Rydgård 6600b7ab08 Improved logging 2023-09-12 17:15:26 +02:00
Henrik Rydgård 844f1de041 Revert "Merge pull request #18008 from hrydgard/naruto-video-flicker-heuristic"
This reverts commit 985af4b03d, reversing
changes made to 64d04782ea.
2023-09-12 12:19:37 +02:00
Henrik Rydgård 3e6788defe Merge pull request #18022 from hrydgard/screen-scaler-ingame-fix
Android: Fix changing display resolution scale in-game
2023-08-31 08:45:39 +02:00
Henrik Rydgård 4b89fab91c NativeInitGraphics: Update core parameter pixel width/height (since we lose resized flag) 2023-08-30 23:42:13 +02:00
Henrik Rydgård 131163bf4c Replace a too-simple heuristic with a compat flag.
Should fix the flicker in Castlevania.

Fixes #17517

The heuristic worked for Rainbow Six but broke Castlevania, so I'd rather
use a compat flag instead of breaking a different game until we can find a
more reliable heuristic for Rainbow Six.
2023-08-30 10:59:57 +02:00
Henrik Rydgård c563d4e57d NotifyFramebufferCopy: Pick the target framebuffer by scoring. 2023-08-29 12:53:18 +02:00
Henrik Rydgård e3bdf1a70b Add heuristic, fixing video flicker in Naruto UNH 2 caused by copy to wrong target. 2023-08-29 11:46:24 +02:00
Henrik Rydgård b4419a9146 Remove the old screen resolution popup thing 2023-07-16 17:05:26 +02:00
Henrik Rydgård eb21a2e6c9 Break out the OSD data holder from Common/System/System.h, into OSD.cpp/h 2023-06-30 17:15:49 +02:00
Henrik Rydgård 7cc8c6cea4 OSD: Add semantics, move the the OSD state to common (while keeping the renderer in the UI). 2023-06-20 14:40:46 +02:00
Henrik Rydgård e9e95d23ce VulkanDebug log fix, reduce log spam 2023-05-30 18:32:33 +02:00
Henrik Rydgård 49ecc01556 Fix image leak bug when pausing and we're just displaying a framebuffer in memory 2023-05-30 18:29:50 +02:00
Henrik Rydgård 7c4b9bac90 Cache textures created by MakePixelsTexture and reuse where appropriate. 2023-05-30 14:07:44 +02:00
Henrik Rydgård ea552bc573 Add a new GPU stat (DrawPixels), kinda heavy since creates textures. GoW does 20-ish per frame. 2023-05-30 10:15:34 +02:00
Henrik Rydgård 9512bc6174 Don't cache render target copies for shader blending, only cache copies for overlap
Fixes #17451, while also keeping the Dante performance fix from #17032.

Of course, it's possible that something else could slow down now... But
hopefully not. This could also fix other problems.
2023-05-11 12:04:29 +02:00
Unknown W. Brackets b4d55713cb GPU: Always update size when shrinking.
Previously, we only updated size when we didn't need to recreate.
This would sometimes cause it to recreate over and over, hurting perf.
2023-04-19 23:42:02 -07:00
Henrik Rydgård b1f8830bd8 Don't try to present from little temp framebuffers used by Godfather to draw text.
The framebuffer does contain the top of the video frame at the present
time though, so things have partially gone well. However the rest of the
frame lies after it in VRAM. What we probably technically should do when
we see this is to assemble an image from both the framebuffer we find
and VRAM contents exceeding the range of that image, but seems kinda
impractical.

This works, but there seems to be some other issue with how the text is
rendered or copied. Could be a color precision issue confusing the game
I suppose.
2023-04-17 12:24:31 +02:00
Henrik Rydgård ee6234ecb6 I18N: Switch to getting categories by index instead of by string lookup
Also gets rid of the shared_ptr usage, and generally makes things nicer.

Needed for later config refactorings, good to get in early.
2023-04-07 10:35:01 +02:00
Henrik Rydgård 8f96ec371e Rename iBufFilter -> iDisplayFilter 2023-04-05 09:34:18 +02:00
Henrik Rydgård d223d3c316 Rename CenterDisplayOutputRect to CalculateDisplayOutputRect 2023-04-02 22:29:08 +02:00
Henrik Rydgård f3076294b2 Merge pull request #17192 from unknownbrackets/saveicon-download
GPU: Add xfer flag to ignore create vfb flags
2023-03-26 08:51:27 +02:00
Unknown W. Brackets 2d13b40123 GPU: Rename match flags to avoid confusion. 2023-03-25 23:25:42 -07:00
Unknown W. Brackets 05c225655d GPU: Add xfer flag to ignore create vfb flags.
Save icons need CPU reads to work.
2023-03-25 23:19:21 -07:00
Unknown W. Brackets 5aeaeb83de GPU: Fix intra-block transfers in ToP CE.
Used in Olive Village.
2023-03-25 23:06:44 -07:00
Henrik Rydgård d586ec0d5e Don't create Host objects except in headless/unittest 2023-03-25 10:47:01 +01:00
Henrik Rydgård 9e125eeba7 Remove NotifyUserMessage from Host 2023-03-25 10:32:09 +01:00
Unknown W. Brackets 92a18eed01 GPU: Discard framebuffer copy when clearing.
This avoids retaining the framebuffer copy any longer than the current
framebuffer target.
2023-03-01 22:11:20 -08:00
Henrik Rydgård 4d0fbdb96f Add a safety check - don't cache partial copies. 2023-03-01 22:51:23 +01:00
Henrik Rydgård 7a7117f2f7 Cache framebuffer copies (for self-texturing) until the next TexFlush instruction.
Fixes #17030 , or at least improves on it - for optimal performance that
big framebuffer used for bloom should be split like in Killzone, but it's not trivial.

The regression in 1.14 is fixed with this, at least.

I tried it with a few other games with no issues - it seems games are
using TexFlush when needed. But let's see if it really is safe to rely
on that...

There might also be other places we should call DiscardFramebufferCopy
in.
2023-03-01 22:42:22 +01:00
Henrik Rydgård 970f7993df Android: Make font rendering work even absent support for R4G4B4A4 textures.
This shouldn't normally happen as conforming drivers are required to
support that texture format, but the software driver that we
accidentally choose on Poco C40 (see issue #16391) doesn't.

That we choose that driver will be fixed separately. This fix on its own
at least lets the user comfortably navigate to settings and switch to
OpenGL.
2023-02-28 00:01:29 +01:00
Henrik Rydgård 8b431b39ba Wrap the display globals in a struct (#16998)
* Wrap the display globals in a struct

Makes it easier to search/replace these, for future refactorings.

* Some renaming

* Qt buildfix, also fix the Qt build on Mac (got broken with battery changes)

* Attempt at buildfixing ios

* UWP buildfix
2023-02-25 13:09:44 +01:00
Henrik Rydgård 49e5460c9c Remove count parameter from SetViewports. No use foreseen. 2023-02-25 07:12:53 +01:00
Henrik Rydgård adda49d05d Add a heuristic avoiding joining framebuffers horizontally
...when texturing from the other one.

Greatly improves GPU performance in Rainbow Six: Vegas.

Fixes #9324.
2023-02-15 15:35:28 +01:00
Henrik Rydgård ae9291f3b5 More work on depth copies. Seems to be enough for Iron Man. 2023-02-15 07:35:07 +01:00
Henrik Rydgård 62a6f351d5 Initial work on depth copies 2023-02-15 07:35:07 +01:00
Henrik Rydgård 27a03de826 CreateRAMFramebuffer: Don't create a depth buffer by default 2023-02-15 07:35:07 +01:00
Henrik Rydgård 6b902a7d6b Minor code cleanup, one very minor stride bugfix 2023-02-15 07:35:07 +01:00
Henrik Rydgård 1938fa44d4 Split the depth copy shader into depth copy and depth encode, dynamic depth scale in Draw2D 2023-02-11 18:24:07 +01:00
Henrik Rydgård a083a65f77 Depal: Get depth scale factors dynamically 2023-02-11 16:12:58 +01:00
Henrik Rydgård d65dae7185 Depth scale functions: Clean up the naming, add a failing test 2023-02-10 14:57:45 +01:00