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: Reimplement depth data handling to support depth_float data outside [0,1] range #8741

Merged
merged 5 commits into from Sep 8, 2020

Conversation

kd-11
Copy link
Contributor

@kd-11 kd-11 commented Aug 16, 2020

This is a large PR and still incomplete but it does many different things that cannot be supported individually without causing issues.
Changes include:

  • Separation of depth buffers into distinct formats for fixed point and floating point.
  • Removal of depth targets in blit engine. This massively simplifies the logistics of handling depth data in blit engine, but now everything is routed through compute which may be slower. Testing is needed.
  • Implement compute jobs to handle conversion to and from 24-bit floating point formats for depth.
  • Enables extended depth range rendering for both OGL and Vulkan. On PS3, depth range is unrestricted when rendering into a floating point depth buffer. Games are commonly running with Z values in the tens of thousands ranges.

Remaining:

  • Diagnose and fix all the vulkan regressions.
  • Black ops regression.
  • Image conversion routines for OpenGL. Due to routing depth data in blit engine through compute, accurate conversion routines are required. This does not work at the moment, making many games break when using OGL backend.
  • Hardware clip control in vulkan. A trivial improvement, but I need the fallback path confirmed to work on both backends before I finalize this. This will require shader cache invalidation, so I may delay this and submit as a separate PR. No functional improvement is expected from this, just cleaner code.

Fixes #8360
Probably fixes #6855

@kd-11
Copy link
Contributor Author

kd-11 commented Aug 16, 2020

If testing, only test with Vulkan until the first pending item is done. Keep an eye out for performance losses as well as any vulkan device lost crashes that may appear. Testing at different internal resolutions is encouraged.

@Josivan88
Copy link

Josivan88 commented Aug 16, 2020

Just to be clear, Nvidia users must test using OpenGL (when it is ready), and AMD users must test using Vulkan? or not?

@kd-11
Copy link
Contributor Author

kd-11 commented Aug 16, 2020

No, all users should test Vulkan for now. OpenGL support is incomplete right now.

@MarioSonic2987
Copy link
Contributor

Breaks skybox in One Piece: Pirate Warriors in the first level:

image

Master:
image

@MarioSonic2987
Copy link
Contributor

Breaks skybox and water in GTA IV:
image

Master:
image

@Andryshik345
Copy link
Contributor

Breaks HUD in Mass Effect

PR

изображение
изображение
изображение

Master

изображение
изображение
изображение

@Josivan88
Copy link

Josivan88 commented Aug 16, 2020

007 Reloaded in default resolution fixed! (this PR)
007 Reloaded default
RPCS3.log.gz
4K ok too (this PR)
007 Reloaded 4K
RPCS3.log.gz

@Josivan88
Copy link

Josivan88 commented Aug 16, 2020

call of duty black ops 3 suffering from severe slowdowns (Master is OK)
(this PR) RPCS3.log.gz

@Josivan88
Copy link

Josivan88 commented Aug 16, 2020

007 Legends solved (default resolution and 4K) (this PR)
007 Legends
RPCS3.log.gz
There are other problems, may or may not be related, like overbright even using WCB

@Andryshik345
Copy link
Contributor

Andryshik345 commented Aug 16, 2020

Breaks almost the whole graphics in GT6

Some screenshots

изображение
изображение
изображение

@ncuxonaT
Copy link

Prince of Persia 2008

PR - Sky is gone

screenshot-2020_08_16_21_40_27

Master - Sky is present but clouds have z-fighting

screenshot-2020_08_16_21_55_08

@Josivan88
Copy link

Josivan88 commented Aug 16, 2020

Unfortunately, it does not solve the Heavy rain flickering problem: (due to the flickering the frame problem was not so prominent in this picture)
Heavy rain

RPCS3.log.gz

@Kravickas
Copy link
Contributor

Not regression.
I just thought to drop it here since u are manipulating with depth and something with conversion.

Star Wars: The Force Unleashed II - Vulkan - same broken gfx and errors on master

·E 0:01:24.441170 {RSX [0x00e0d30]} RSX: Unsupported depth conversion (0x84)
·E 0:01:24.441182 {RSX [0x00e0d30]} RSX: Unsupported depth conversion (0x9C)

RPCS3.log.gz

Feel free to ignore it if not enought relevant or too difficult.

@Xcedf
Copy link

Xcedf commented Aug 16, 2020

Not fixes #6855 for both Heavy Rain and MGS4, unfortunately

@Satan86
Copy link

Satan86 commented Aug 16, 2020

GT5 also regressed with this PR
image
RPCS3.log.gz

@kd-11
Copy link
Contributor Author

kd-11 commented Aug 17, 2020

These all look like Z precision problems due to simulated clipping. Easily fixable with vulkan clip control, but I need to support the fallback because not all drivers are guaranteed to support it. If it proves impossible we can just disable control unless Z clip extension is present.

@kd-11
Copy link
Contributor Author

kd-11 commented Aug 17, 2020

Broken visuals in most games are caused by the fact that the near plane can be equal to the far plane causing a division by 0. Turns out fixing that bug then exposes several unexpected issue that break even more games requiring a redesign of sorts.

@gamrXerus
Copy link

gamrXerus commented Aug 18, 2020

I can confirm this pr fixes the flickering in Goldeneye Reloaded. However it introduces another issue. The screen becomes white, mostly when looking at the sky in the outdoor maps for splitscreen.
whitescreen
RPCS3.log.gz

In addition, Call of Duty Black Ops cannot reach the main menu with this pr, but it can on master.
RPCS3.log

In Call of Duty Modern Warfare 2 your hand and gun is not rendered with this pr, but it shows fine on master

mw2
RPCS3.log.gz

@jeremybris

This comment has been minimized.

@kd-11
Copy link
Contributor Author

kd-11 commented Aug 18, 2020

Fixed a ton of problems from the depth-clip emulation. Retest broken games.
Super bloom in 007 series is still there, not sure what is causing it, I'm investigating.

@gamrXerus
Copy link

Modern Warfare 2 is now fixed. Black Ops still wont load.

@Satan86
Copy link

Satan86 commented Aug 18, 2020

GT5 Fixed
image

@ncuxonaT
Copy link

Prince of Persia 2008 is now fixed. I don't see any depth related issues.

@gamrXerus
Copy link

Black ops still boots for me on master, but I cant get the start menu to come up with this pr on windows 10 or ubuntu 20.04

@Josivan88
Copy link

Josivan88 commented Aug 20, 2020

I can confirm what gamrXerus said COD BO still broken (probably COD BO3 too), more details:

Slowdown on intro videos (not in master)
Game is becoming slow until crash (Not in master)
Last PR version crashed my GPU and my screen become black until driver can recover itself (not in master)
RPCS3 crash and become irresponsible, can't even compress the log at the time. (Not in master)
All the thing is so serious that I can't even make an RSX capture
Log and screens, I tried to configure with all the settings equal to each other:

Master
BO Master
Log
RPCS3.log.gz

This PR
Black screen, in the best situation, almost reach the main menu
Log
RPCS3.log

@jeremybris

This comment has been minimized.

@kd-11
Copy link
Contributor Author

kd-11 commented Aug 20, 2020

Thanks, looks like there is incorrect detection between float and int depth buffer types. I'll look into it.

@Graubek
Copy link

Graubek commented Aug 22, 2020

This PR repaired sounds in InFamous 2

@Graubek
Copy link

Graubek commented Aug 22, 2020

Problem with launching InFamous 1
RPCS3.log
Bez tytułu

@kd-11
Copy link
Contributor Author

kd-11 commented Aug 22, 2020

A huge rewrite is required to proceed with the PR without breaking drivers, I'll try and split some of it into smaller PRs and submit those first instead of wrestling a super-PR.

@kd-11
Copy link
Contributor Author

kd-11 commented Aug 24, 2020

Base rewrite PR #8769
That PR does not handle the activision games issue (that will come in a later PR). Please test for crashes or other unexpected effects on that PR, including black ops problems.

- Software clipping emulation is used here as OpenGL does not have explicit clip control.
- Hardware clip control for vulkan to be enabled after this.
- Fix special case where n=f making (f-n) = 0
- Dynamically update depth range by setting dirty bits
- Fix depth bounds when n=f and bounds test is disabled
@kd-11
Copy link
Contributor Author

kd-11 commented Aug 27, 2020

Rebased on vulkan bringup work. There should be no more regressions on Vulkan backend, only improvements. If not, please make a detailed report so I can look into it.

@Crimsom13
Copy link

Black ops 1 some rendering improvements on models/hands looks to be going definitely in the right direction still some flickering though and broken in 4k green rendering issue.

@Josivan88
Copy link

Josivan88 commented Sep 4, 2020

Any news about that? #8360 is basically fixed on vulkan with this as it is.
And any idea when rsx: Depth float bringup [2 of 3] will come to life?

@kd-11
Copy link
Contributor Author

kd-11 commented Sep 5, 2020

Blocked by #8714 which I am working on at the moment. That is the part 2 of 3 and is the main remaining task. With this PR (and master as well) OpenGL is unusable.

@kd-11 kd-11 marked this pull request as ready for review September 7, 2020 15:43
@kd-11 kd-11 changed the title [VERY WIP][TESTERS REALLY NEEDED] rsx: Reimplement depth data handling rsx: Reimplement depth data handling to support depth_float data outside [0,1] range Sep 7, 2020
@kd-11
Copy link
Contributor Author

kd-11 commented Sep 7, 2020

OpenGL part is done, so now only bug checking for this remains to ensure nothing has broken.

@gamrXerus
Copy link

Tested a few games using the OpenGL backend with this PR. Goldeneye Reloaded wont boot using OpenGL on both Lubuntu 20.04 and Windows 10.
rpcs3
Linux log :
RPCS3.log
Windows log:
RPCS3.log

@kd-11
Copy link
Contributor Author

kd-11 commented Sep 7, 2020

The remaining GL bugs are mostly fixed in #8852

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.

Z-fighting on Nvidia Activision games have serious flickering problems