Skip to content

GS/HW: Add continuous and oneshot ROV heuristics. - #14607

Open
TJnotJT wants to merge 9 commits into
PCSX2:masterfrom
TJnotJT:gs-rov-oneshot
Open

GS/HW: Add continuous and oneshot ROV heuristics.#14607
TJnotJT wants to merge 9 commits into
PCSX2:masterfrom
TJnotJT:gs-rov-oneshot

Conversation

@TJnotJT

@TJnotJT TJnotJT commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Description of Changes

Adds heuristics to determine ROV usage:

  • Continuous: If average barrier/frame is above a threshold (default 5000) use ROV continuously.
  • Oneshot: If the number of barriers in a draw is above a thresold (default 50), use ROV for a single draw (if not alreayd using continuous mode).

Put render pass starting code in DX12/VK into a separate function.

Adds utility functions for doing coarse CPU rasterization of draws to cut down on copy overhead. Currently, only used for the ROV copies in oneshot mode.

Rationale behind Changes

Performance in some system/games are negatively impacted by using ROV continuously, so this attempts to provide less aggressive heuristics for such cases.

The coarse rasterization utilies could possibly be used for other copies such as in DX11 feedback. It might also be useful for reducing barriers with more accurate overlap detection.

Suggested Testing Steps

Use DX12/DX11/VK with ROV enabled in Settings>Graphics>Rendering. The default threshold can be edited in Settings>Graphics>Advanced>ROV Options. Performance testing would be helpful.

Currently, this has been tested with dump runs and performance tested on AMD (thanks @JordanTheToaster).

Did you use AI to help find, test, or implement this issue or feature?

Yes, to brainstorm some ideas for conservative ROV heuristics and reducing copy overhead.

@TJnotJT

TJnotJT commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Rebased. Dumps runs appears to be clear on VK, DX12, DX11, though it's hard to verify as many dumps have small differences.

@TJnotJT
TJnotJT marked this pull request as ready for review July 7, 2026 21:45
@TJnotJT

TJnotJT commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Drafting as there appear to be bugs after the rebase.

@TJnotJT
TJnotJT marked this pull request as draft July 8, 2026 13:24

@lightningterror lightningterror left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to bump shader cache.

@TJnotJT

TJnotJT commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

I fixed up the Metal implementation

Thanks for the help! I assume this would resolve the quesion about the render pass shape also?

@TJnotJT
TJnotJT force-pushed the gs-rov-oneshot branch 3 times, most recently from 79b67d6 to 8adba0c Compare July 13, 2026 23:25
@TJnotJT

TJnotJT commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Rebased and changed the draw config ROV flags to be more intuitive:

  • Has[Color|Depth]ROV(): Has either continuous OR oneshot ROV.
  • HasOneshot[Color|Depth]ROV(): Has oneshot ROV.
  • HasContinuous[Color|Depth]ROV(): Has continuous ROV.

Also added the flags to the draw config outside of the PS selector.

@TellowKrinkle TellowKrinkle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this would resolve the quesion about the render pass shape also?

Yes, that's the part where I switched it to render passes.

BTW I noticed something I missed in the Metal implementation so I fixed that

Comment thread pcsx2/GS/Renderers/Common/GSDevice.h Outdated
Comment thread pcsx2/GS/Renderers/Common/GSDevice.h Outdated
@TJnotJT

TJnotJT commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

@TellowKrinkle Apologies, I didn't see your last push and ended up force pushing over it. I applied my fixes and yours as two temporary commits at the end.

@TJnotJT

TJnotJT commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Tested by @kamfretoz to be working on Metal, so I squashed the temp commits into the Metal port commits.

Keeping as draft until at least one dump run is redone.

@TJnotJT

TJnotJT commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Dump run on VK appears to be clear.

@TJnotJT
TJnotJT marked this pull request as ready for review July 17, 2026 12:33
Separate code from RenderHW() into a separate function.
Use same procedure of unbinding as feedback loop layout (unbind texture if it's in the wrong layout). Avoids unnecessary unbinding.
Separate parts of SendHWDraw() into separate function. Closer to how DX12 handles feedback barriers.
Need to use these functions in other CPP files.
Co-authored-by: TellowKrinkle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants