GS/HW: ROV support for feedback draws.#13754
Conversation
Thanks for the test and catching that. There was a bug in tracking ROV feedback history, which is hopefully resolved in the last push. I also changed the heuristic to only vote for ROVs if barriers are already configured. It was unnecessarily using barriers for blends that could be done in HW. Haven't yet looked into the issue with the minimum blend. |
|
GTA San Andreas maximum blending just 120 barriers with dx12 and huge speed improvement Unfortunately the improvement is not always this big Master
Added the second scenario dump |
|
GTA: LCS (NTSC U) GS Dump Nice improvement on NVIDIA but a regression on Intel |
|
I will test on linux once it gets Vulkan support. Great work bringing ROV back :). |
Thanks all for the tests. Looks like these scenes have spiky barrier usage so ROVs were not being activated enough. I think we may need to change the heuristic again and have it account for how many barriers can be saved on each pass. Also, instead of hardcoding constants into the heuristic it might be useful to expose these via the INI for tuning. Will try to get to this soon.
Thanks, it's in the works, hopefully not too long. |
|
The last push adds some INI config settings to try and tweak how aggressively ROVs are used and how frequently to switch between ROV/non-ROV usage (described in detail in the OP). If anyone is so inclined, please try tweaking them to see if certain games benefit differently from different parameters. The code is a bit volatile at the moment as Vulkan ROV is partially implemented and is not functional. Some bugs might have creeped into the other APIs also so be warned. |
Thanks for spotting that. I haven't stepped through the dump carefully, but I think that might be due to Z inaccuracy, since the heuristics are still being tweaked and Z conversions can happen at different times. In some cases it appears to fix things but it's likely by chance. Vulkan should hopefully be functional on the last push and some small bug fixes. |
|
GTA San Andreas looks good now and it still has the big speed improvement with Vulkan, Shadow of the Colossus though still has some issues
this is how it looks on master with the same settings using Vulkan dump |
b4565fd to
16a031a
Compare
Should hopefully be fixed now. It might have been an issue with depth not being enabled correctly. |
That might be due to a mistake I made somewhere while rebasing. However, I wasn't able to reproduce on my end with basic/maximum blend and tweaking the ROV settings a bit. Could you please attach the INI you used to test? On a side note, I changed the INI settings again, so any ROV related settings can be deleted from the INI so that the defaults are used. I'll try to make some presets so that it is easier to test in the future. |
i am going to delete the ini settings for the specific game and see if i can reproduce the issue with the newest commit. If i can i will post the ini like you asked |
|
It still crashes for me and this is the general pcsx2 ini |
|
@bigol83 @mrrguest We’re planning to submit a bug report to Mesa, as we’ve reproduced the flickering issue on two Linux/Wayland systems with AMD GPUs. If I recall correctly, both of your systems also showed the flickering with VK when the extra barriers weren’t enabled. Could you share a few details about your setup: OS, whether you're using Wayland (if on Linux), and your GPU model? (I believe @mrrguest's is RDNA3.) Thanks in advance if you’re able to help |
|
RDNA3 AMD 780M IGPU, Wayland, CachyOS. I didn't notice any flickering just graphics issue with Burnout Revenge which was fixed with HWROVUseBarriersVK = 2. EDIT: I just tried the Black single and multi frame gs dumps @AmandaRoseChaqueta posted: #13754 (comment) I didn't notice any flickering with the following setings: |
Got it, thanks for the information. This appears to confirm that Linux/Wayland/RDNA2 is the only setup that's affected so far. |
43f1aa3 to
1cdb6ac
Compare
5372760 to
ba107ef
Compare
|
Rebased with fairly significant conflicts |
|
Last push rebases with several large conflicts. Current build should compile/run but is broken and will require some fixing. And example broken dump is attached. Need for Speed - Most Wanted [Black Edition]_SLES-53857_20260104230853.gs.xz.zip Note: GSDevice::PSSelector went from 12 to 16 bytes on the last pushes. |
34f61ed to
d50d1ca
Compare
|
Last few pushes do the following:
Performance note: for simplicity the current PR adds the unordered access (DX12) / storage image (VK) specifier to all RTs even when ROV is disabled, so we should make sure this doesn't cause any performance regressions. Other note: the current system for ROV depth creates a color clone of depth (since depth textures can't be used as UAVs). This overlaps a bit with the depth as RT functionality in depth feedback, so it's possible that they could be merged in the future. |
|
The following dumps runs were done on both DX12 and VK:
The main differences between PR and master in the latter two dump runs appear to be due to inaccuracies with line blending (described in OP), although the differences are usually not visually obvious or affect only individual pixels. I'm unable to fully validate DX12 as my system continues to have severe Z fighting and other issues. |
|
Last push removes the ROV preset setting and hard codes it to former 'aggressive' preset, as it appears to perform the best. Thanks to all who contributed tests to determine this. The ROV checkbox no longer causes a GS reset when changed. However, the OSD target vram usage may now be slightly inaccurate (it will underestimate true amount when depth ROVs are used). The may need to be addressed in a future PR. |
|
Last push adds ROV options to FSUI and fixes other ROV UI elements. Authored by @SternXD. |
TellowKrinkle
left a comment
There was a problem hiding this comment.
Haven't looked over everything yet, but I figured I'd leave these to for you to look at for now.
| float RcpScaleFactor; | ||
| float pad0; | ||
| float pad1; | ||
| uint4 ColorMask; |
There was a problem hiding this comment.
Is there a benefit to using this over FbMask?
There was a problem hiding this comment.
Likely not, we should probably use FbMask here.
I may have used this initially to avoid unexpected interactions with the current pipeline.
| State m_state = State::Dirty; | ||
|
|
||
| // ROV state tracking | ||
| std::unique_ptr<GSTexture> m_depth_color; // For depth texture points to the parallel color texture. |
There was a problem hiding this comment.
What's the benefit of pairing these instead of creating a texture of the opposite type, doing a StretchRect, and recycling the old one?
There was a problem hiding this comment.
I initially thought there would be greater coupling because we might do e.g. partial copies. However, it turns out that just doing a full copy and use depth ROV for as long as possible appear to be more performant.
It does require a bit more code to keep them separate, since we'd have to modify the texture cache or add new convert pipelines. However, having done that for integer depth, it's definitely a possibility.
On a side note, you can ignore the float m_avg_barriers_rov = 1.0f; field since we removed the different ROV heuristics and made it just keep ROV active for as long as possible once it's activated. That field and related heuristics code in GSRendererHW::DetermineROVUsage() should probably be removed also.
Co-authored-by: TheLastRar
Co-authored-by: SternXD
|
Last push adds the ports to DX11/GL. Changed to draft until revisions are completed. |

















Intro/status
The PR #7655 by Stenzek was consulted to get implementation ideas and heuristics.
This is committed on top on #14386 for easier dump run testing.
Description of changes
Adds ROV (rasterizer ordered view) support to DX12/VK/GL/DX11 for feedback draws (i.e., where writing the new color/depth value for each pixel requires reading the current color/depth value).
Thanks @TheLastRar for identifying and fixing the Windows RDNA2 feedback transition issue.
Thanks @SternXD for providing FSUI ROV options and other UI fixes.
Rationale behind Changes
Can help improve performance and accuracy in feedback draws with overlapping geometry by reducing draw call count and barriers.
Suggested testing steps
Vulkan ROV barrier setting
The Advanced setting for ROV barriers in Vulkan has the following values:
Some dumps are known to have flickers/missing effects when barriers are not used.
Results/shortcomings
Examples of Z inaccuracy
This seems to not affect all systems.
Conspiracy - Weapons of Mass Destruction_SLES-53098_20250214222606.gs.xz
Master DX12

PR DX12

Haunting Ground_SLES-52877_20230724220957.gs.xz (see mirror)
Master DX12

PR DX12

Example of line blending inaccuracy
ZOE_Copy_Effect.gs.xz (see blueish elliptical lines)
Master VK

PR VK

TODO
Give DX12 textures a state enum instead of manipulating D3D12_RESOURCE_STATE* directly (similarly to how Vulkan does layouts) and replace the current UAV state tracking.Allow tweaking the ROV usage heuristic to see if it might benefit games differently.Combine the DX12 descriptor tables for RT, depth, and UAVs into a single descriptor table to reduce root parameters and number of updates, since at least one table must be updated anyway each time an RT changes.AI usage
AI was used as a reference for graphics API usage and to brainstorm ideas for correctness/efficiency of UAV usage. The heuristic to activate/deactivate ROV was obtained in part with AI, though the approach is likely well known. Additionally, AI was used to review parts of the code for correctness.