GS/DX12/VK: ROV support for feedback draws.#13754
GS/DX12/VK: ROV support for feedback draws.#13754TJnotJT wants to merge 1 commit intoPCSX2:masterfrom
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 |
Thanks, I just pushed a fix based on findings from TheLastRar that may help in VK without needing to use HWROVUseBarriersVK on RDNA2. Out of curiosity, what GPU model are you using (sorry if you already mentioned this earlier)? |
|
Just tried the last push but unfortunately it still happens, I'm using 780M IGPU RDNA3 on Linux . |
I see, thank you for checking it. Maybe that's just the behavior of VK FSI on RDNA2/3. |
|
@mrrguest We've been experimenting with different barrier settings to try and reduce the issues on VK/Linux/RDNA2/3. If you have the time, could you try the Burnout dump with |
No worries, of course, and thanks for checking it. There was a small bug with the recent barriers additions, though hopefully it's fixed on the last push. |
|
With the last push the issue is fixed, also tried other games no issue with all 3 presets and different blends. |
3471fb0 to
cd632cf
Compare
|
Cleaned up the code after a while, including documenting the RDNA2 feedback loop transition fix discovered by Air, and revising the new barrier setting for VK. |
|
Tested the new build no issues. |
|
Checked latest build with MGS3 and Shadow of the Colossus, with both renderers Vulkan and Dx12 with Accurate Alpha always enabled. All three settings stay fullspeed or above with both renderers in both games. No graphics issues. |
|
@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




















Intro/status
Description of changes
Adds ROV (rasterizer ordered view) support to DX12 for feedback draws (i.e., where writing the new color/depth value for each pixel requires reading the current color/depth value).
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
Tuning ROV usage
The INI setting HWROVPreset controls when ROVs are activated and can have the following values:
The setting HWROVUseBarriersVK has the following values and affects only Vulkan:
Some dumps are known to have flickers/missing effects when barriers are not used.
Results/shortcomings
Examples of Z inaccuracy
Edit: 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 that look like it fixes Z fighting but is likely by chance
Energy_Airforce_SLES-51646_20220814050022.gs.xz (see shadows)
Master DX12

PR DX12

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 described above and its implementation was obtained in part with AI, though the approach is likely well known. Additionally, AI was used to review parts of the code (in particular, helper classes used to track the feedback history in GSRendererHW.h).