Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rsx: tiny zcull optimizations #5117

Merged
merged 2 commits into from
Sep 13, 2018
Merged

rsx: tiny zcull optimizations #5117

merged 2 commits into from
Sep 13, 2018

Conversation

scribam
Copy link
Contributor

@scribam scribam commented Sep 12, 2018

Should boost the performance on heavy zcull games.

@vietnam13231
Copy link

vietnam13231 commented Sep 12, 2018

Infamous still needs to have "Disable ZCull Occlusion Queries" enabled for those to not overflow. So nothing here.

rpcs3/Emu/RSX/RSXThread.cpp Outdated Show resolved Hide resolved
@Xcedf
Copy link

Xcedf commented Sep 12, 2018

None of my zcull needing games react on this PR

@MSuih
Copy link
Member

MSuih commented Sep 12, 2018

Burnout: Paradise has too agressive culling, which results in models popping in or appearing gray. Hard to show on picture, so here's a video: https://streamable.com/sr66x

Master and PS3 do not have any noticeable pop-in.

Edit: I'm getting same issues on Skate 3 as well, although not as extreme. I'm using RX 480, so perhaps this is an AMD-specific issue?

@kd-11
Copy link
Contributor

kd-11 commented Sep 12, 2018

Thank you @MSuih, I have also confirmed your findings. That helped figure out why there were performance gains; it was because zcull testing was illegally disabled.
@scribam
WRT the changes in check_zcull_status.
Picture the following:

  1. The game changes the current depth buffer to some memory that is linked to the ZCULL unit. Zcull statistics are not enabled so no testing is expected. Your optimization aborts early and no ZCULL usage takes place.
  2. The game enables Zcull testing. There is no framebuffer swapped however, so the set_active call now fails since zcull_surface_active was never updated and remains forever false.

EDIT: It is common for a game to enable and disable occlusion reports several times while rendering to the same framebuffer, even when it is bound to ZCULL ram. In fact, the framebuffer_swap path is very rarely taken in the context of a frame; usually about a dozen times at most for the highest end AAA games. Some rare cases can go above that but not by much since changing ROP target is quite expensive on GPU hardware (it messes with their memory controller caches)

Copy link
Contributor

@kd-11 kd-11 left a comment

Choose a reason for hiding this comment

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

This breaks Zcull testing for reasons explained in comment.

@scribam
Copy link
Contributor Author

scribam commented Sep 12, 2018

Changes related to the Burnout regression reverted

@scribam scribam changed the title rsx: zcull optimizations rsx: tiny zcull optimizations Sep 12, 2018
@Nekotekina Nekotekina merged commit 4cb9801 into RPCS3:master Sep 13, 2018
@scribam scribam deleted the rsx-zcull-optimizations branch September 13, 2018 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants