Commit Graph
137 Commits
Author SHA1 Message Date
Henrik Rydgård 8d8ff5886b Fix issue where nothing had started a render pass when we wanted to clear the screen. 2023-12-11 13:06:15 +01:00
Henrik Rydgård 26a51191b3 Cleaner solution to previous commit 2023-12-06 09:54:03 +01:00
Henrik Rydgård 8588b11a6a Rename MayIntersectFramebuffer to MayInteresectFramebufferColor 2023-12-06 09:42:44 +01:00
Henrik Rydgård 6d977b4a12 Remove unnecessary struct FramebufferInfo 2023-12-02 13:56:18 +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 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 b4419a9146 Remove the old screen resolution popup thing 2023-07-16 17:05:26 +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 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 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 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 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 d426ce5118 Clear depth buffers after changing depth rounding mode.
And thus change of depth buffer scale/offset.

Previously, old depth buffers with values that now are out of range
could stick around, causing #16941. This clears them to the expected 0
value, which helps Outrun. Ideally we should convert depth buffers to
the new format, but if we can get away without that, that's also nice.

This is enough for #16941.
2023-02-10 10:03:14 +01:00
Henrik Rydgård 937975000b Add a ReadbackMode parameter to more functions in the FramebufferManager 2023-02-05 13:57:45 +01:00
Henrik Rydgård 236611ac16 Initial implementation of depth readback for Syphon Filter. Fixes the lens flares. 2023-02-04 13:54:57 +01:00
Henrik Rydgård 62484f01ed Make ReadbackFramebufferSync able to use the stretch ability of ReadbackDepthbufferSync 2023-02-04 12:05:50 +01:00
Henrik Rydgård c7234aa3b5 Handle scaling internally in ReadFramebufferSync 2023-02-04 11:36:48 +01:00
Henrik Rydgård 23c8a79473 Make depth readback through the "color path" work on all backends except D3D9 2023-02-03 20:59:58 +01:00
Henrik Rydgård f2a6c744bc Add built-in stretch functionality to depth readback shader path 2023-02-03 19:06:40 +01:00
Unknown W. Brackets e5d67119a8 GPU: Avoid bloom hack on buffers used for depth.
If a buffer even has depth transferred to it, let's avoid lowering its
resolution.
2023-01-05 18:00:43 -08:00
Henrik Rydgård 11366a2ded Don't refer directly to g_Config.iMultiSampleLevel, it can contain unsupported modes. 2022-12-14 16:43:37 +01:00
Henrik Rydgård 8a3e92aa38 Not pretty, but with this, you can switch MSAA level at runtime. 2022-12-01 23:41:31 +01:00
Henrik Rydgård e3679df6cf Fix switching between MSAA levels 2022-12-01 22:49:00 +01:00
Henrik Rydgård 6d9bb1b29e Move post-processing settings to DisplayLayoutScreen 2022-11-22 23:29:50 +01:00
Henrik Rydgård eff4118769 One more refactoring step 2022-11-21 14:54:48 +01:00
Henrik Rydgård 7596713059 Refactor: Split up updating the display and render size. 2022-11-21 14:35:12 +01:00
Henrik Rydgård 0de12f5ca9 Some refactoring of framebuffer views, layer issues, more work. 2022-10-27 11:05:58 +02:00
Henrik Rydgård fb250c4b29 More multiview work 2022-10-27 11:05:58 +02:00
Henrik Rydgård cafce7365b Vulkan: Fix frame ordering issue with postprocessing shaders
Requested an init command buffer outside the frame, which is dangerous
and caused validation problems with command pool resets.

Would like to assert on insideFrame in GetInitCmd, but we use it from
some init code where it does work correctly. Might clean that up at some
point.
2022-10-21 12:52:21 +02:00
Unknown W. Brackets fc68cd9457 GLES: Add debug readback of stencil data.
This allows the existing gpu.buffer.renderStencil to snapshot the state.
2022-10-10 17:09:14 -07:00
Unknown W. Brackets 59cc7a8000 GPU: Rename stencil write pipeline. 2022-10-10 16:54:29 -07:00
Unknown W. Brackets 1dc35b3ac4 GLES: Simplify, enable debug depth readback. 2022-10-10 01:04:57 -07:00
Unknown W. Brackets f8908c691b GLES: Use Draw for depth readback shader.
Was not working before, since the program was not being used by Draw2D.
2022-10-10 00:54:29 -07:00
Unknown W. Brackets 55d5dc3834 GPU: Rename readback and buffer write operations.
Avoid download/upload and pack, which don't have clear directions.
2022-10-09 13:49:41 -07:00
Unknown W. Brackets ad3220f857 GLES: Hook up depth download.
Currently, only used by one hook.
2022-10-09 01:08:04 -07:00
Unknown W. Brackets a1efed31b9 GPU: Use flags to fix triggered upload/download.
No longer using mirror hacks.
2022-10-03 20:17:25 -07:00
Unknown W. Brackets 58a4376998 GPU: Normalize framebuf addresses.
In VRAM, always store without mirror.  In RAM, always store without
cache/kernel bits.
2022-10-02 21:28:53 -07:00
Henrik Rydgård 94ae0fabfa CLUTs can be loaded from small rectangular textures. Need to linearize.
Fixes #8406, although technically, we should wrap by bufw, not the
texture width.
2022-09-21 18:33:15 +02:00
Unknown W. Brackets bf86f00df8 GPU: Correct display framebuffer reading.
The displayFramebuf_ might not be set yet, but that doesn't mean we want
an INVALID format and zero stride.  We might also be rendering to a
different target, but still want the display.
2022-09-20 14:01:36 -07:00
Henrik Rydgård 662126a0a1 Small simplification 2022-09-15 16:57:03 +02:00
Henrik Rydgård 9907957242 Start implementing ApplyTextureDepal 2022-09-14 22:18:35 +02:00
Henrik Rydgård a52e62a187 Enable depth uploads on render-to-clut-buffer. Esoteric but needed for #11100. Compat flag for now. 2022-09-14 22:18:34 +02:00
Henrik Rydgård 4803825f83 Buffer copy matching workaround 2022-09-14 22:18:34 +02:00
Henrik Rydgård 39890f7d6f Extract function GetReinterpretPipeline 2022-09-13 11:46:47 +02:00
Henrik Rydgård 4491c480a6 Texture/framebuffer matching: Do margin check in bytes. 2022-09-11 16:18:04 +02:00
Henrik Rydgård 3787b43b7a Fix "Lower resolution for effects" in Ratchet & Clank. Bad option for this game though. 2022-09-04 23:28:55 +02:00