RPCS3 / rpcs3

PS3 emulator/debugger
https://rpcs3.net/
GNU General Public License v2.0
14.55k stars 1.85k forks source link

rsx: Surface cache improvements #5937

Closed kd-11 closed 5 years ago

kd-11 commented 5 years ago

Variable-sized framebuffers idea turned out to be a disaster, so I had to go back to the drawing board. Perform surface cache intersection resolve for surfaces to allow propagation of old data through most cases. Essentially guarantees that previous ROP writes to an arbitrary memory range are present if any render-target is created from the same range. Removes need for the memory hierachy invalidation hack needed for RDR to render accurate shadows.

kd-11 commented 5 years ago

NOTE: If testing and you get a vulkan "verification failed' error in vkTexture.cpp, lower your resolution scale to below 284%. This means you ran out of rpcs3's VRAM budget due to the high resolution scale. This situation will be patched with a hotfix before this PR is merged with a proper vulkan resource management PR to come later on.

Xcedf commented 5 years ago

Assassin's Creed VK Driver error returned F {RSX [0x0081cd8]} RSX: class std::runtime_error thrown: Assertion Failed! Vulkan API call failed with unrecoverable error: Device lost (Driver crashed with unspecified error or stopped responding and recovered) (VK_ERROR_DEVICE_LOST) (in file c:\users\zero\desktop\rpcs3\rpcs3\emu\rsx\vk\vkhelpers.h:970) RPCS3.log.gz

The Last Of Us same error before main menu F {SPU[0x2000004] Thread (highCellSpursKernel4) [0x0558c]} RSX: g_access_violation_handler(0x31b97e00, 0): Assertion Failed! Vulkan API call failed with unrecoverable error: Device lost (Driver crashed with unspecified error or stopped responding and recovered) (VK_ERROR_DEVICE_LOST) (in file c:\users\zero\desktop\rpcs3\rpcs3\emu\rsx\vk\vkhelpers.h:970) RPCS3.log.gz

Dante's Inferno segfault 48 RPCS3.log.gz

Killzone 2 major speed regression this PR 46 previous build 47

kd-11 commented 5 years ago

All without res scaling or with res scaling?

Xcedf commented 5 years ago

All at native res

newDevPL commented 5 years ago

RDR BLUS30418 crashes with the below just as you load the game. I saved the game in the middle of desert it makes a difference.

image RPCS3.log

Let me know if you need anything else.

kd-11 commented 5 years ago

Need ur save

newDevPL commented 5 years ago

Need ur save savedata.zip

Here you go

newDevPL commented 5 years ago

GT6 BCES01893 crashes at the point where it asks you for name, music still keeps playing, can't do anything, can't stop the game, i have to kill the process to exit.

image RPCS3.log

kd-11 commented 5 years ago

@ju2ef1986 This save? image

newDevPL commented 5 years ago

@kd-11 weird, yes, did it just work without any BS?

kd-11 commented 5 years ago

Pretty much yea. I'm trying to match your settings and see if it crashes.

newDevPL commented 5 years ago

@kd-11 Looks like the crash was caused by SPU block size being set to Mega. I changed it to Safe and works again. My bad :/ Anyway, let me know what needs testing, I am happy to help.

newDevPL commented 5 years ago

@kd-11 But this is only with combination of SPU LLVM, ASMJIT works fine with SPU Block size set to Mega.

stride21 commented 5 years ago

Heavenly Sword with Vulkan on this PR causes my PC to become frozen and show video artifacts on my main monitor while also shutting off my second monitor. Edit: After using the shaders from a previous test that had the same issue I posted about above I got a fatal error "{RSX [0x0011074]} RSX: class std::runtime_error thrown: Assertion Failed! Vulkan API call failed with unrecoverable error: Device lost (Driver crashed with unspecified error or stopped responding and recovered) (VK_ERROR_DEVICE_LOST) (in file c:\projects\rpcs3\rpcs3\emu\rsx\vk\vkhelpers.h:970)". new log: rpcs3 log.zip

ghost commented 5 years ago

I only tested 4 games, but they all seemed to work fine on RX580/RADV.

kd-11 commented 5 years ago

AC bug was unrelated to this PR but has been fixed nonetheless. It is still very unstable even when ingame, but that's a different issue altogether.

Xcedf commented 5 years ago

Even if AC unrelated many other games have VK driver fail now, pretty much a regression if you ask me

legend800 commented 5 years ago

Backbreaker Vengeance broken. Crash entering gameplay.

F {RSX [0x002c9a8]} RSX: class std::runtime_error thrown: Assertion Failed! Vulkan API call failed with unrecoverable error: Device lost (Driver crashed with unspecified error or stopped responding and recovered) (VK_ERROR_DEVICE_LOST) (in file c:\projects\rpcs3\rpcs3\emu\rsx\vk\vkhelpers.h:970)

RPCS3.zip

kd-11 commented 5 years ago

AMD cards are unaffected by the vulkan issue here. It is nvidia-specific. Debug layers aren't catching anything either, which means it has to be something very subtle.

arabek commented 5 years ago

Motorstorm (BCES00006) crashes with VK_ERROR_DEVICE_LOST on Coyote Rage (reproducible always, WCB ON, GPU Texture Scaling ON, High Precission Z-buff ON, Strict Rendering, Vulkan, Nvidia 1080, Linux, Kwin/KDE).

kd-11 commented 5 years ago

Turns out it was a simple typo causing all the crashes. Needs retesting across the board.

Xcedf commented 5 years ago

AC fixed and also this PR fixes flickering in main menu that was a regression for a long time In other games VK Driver fail messages gone but it segfaults now instead 6

stride21 commented 5 years ago

Heavenly Sword is fixed

JackTerok commented 5 years ago

Assassins Creed III Lady Liberty HD: Main Menu Framerate Dropped from 18 FPS on master to 9 FPS.

Log: RPCS3.log

Xcedf commented 5 years ago

Another regression: this PR broke SRM Resistance 2 master SRM ON 36 This PR SRM ON 37

arabek commented 5 years ago

Motorstorm seems to be fixed.

kd-11 commented 5 years ago

@Xcedf Need RRC for that visual regression; this PR forcefully enables some parts of SRM to allow backwards compatibility.

Xcedf commented 5 years ago

@kd-11 yea, i've seen it this part of the code in VKGSrender.cpp that is always On now is about that msaa effect that uses SRM, anyway here's capture https://mega.nz/#!OdoVGSiS!vxDRQ5XKG_br2VZRrEKKOWCkod_XhyLpnhU2weJnv14

stride21 commented 5 years ago

Killzone 3 also has an issue with SRM not working correctly. Killzone 3 Master With SRM: master killzone 3 Killzone 3 PR With SRM: killzone pr 2 Killzone 3 RDC

Resistance 3 with OpenGL looks very similar to Vulkan now when using the auger with this PR Resistance 3 Master with OpenGL: Resistance 3 master Resistance 3 PR with OpenGL: Resistance 3 PR Resistance 3 PR with Vulkan: Resistance 3 mas

kd-11 commented 5 years ago

@Xcedf @stride21 Not having much luck with the renderdocs, provide RSX capture instead. Sorry for the inconvenience.

Xcedf commented 5 years ago

@kd-11 there you go https://mega.nz/#!fcoj0YYY!2r14WH_mO_SpCfzpTcI2fNY3NdohhaC8TBE2t1UPPvk

stride21 commented 5 years ago

@kd-11 Killzone 3 RSX

Parthorisian commented 5 years ago

[BLUS30443] freezes on load - RSX: class std::runtime_error thrown: Unexpected vkFormat 0x0 Streamable log DemonSoul_freeze.ZIP

stride21 commented 5 years ago

This PR regressed Ratchet and Clank Future: ACIT while also fixing the OpenGL issue where only certain details like the white crosshair or the hair on ratchet would only show up in the top left corner of the screen depending on where you look.

Ratchet and Clank Future: A Crack in Time PR with OpenGL: ratchet opengl pr Ratchet and Clank Future: A Crack in Time PR with Vulkan: ratchet and clank crack vulkan Ratchet and Clank Future: A Crack in Time Master with OpenGL: Opengl Ratchet master Ratchet and Clank Future: A Crack in Time Master with Vulkan: ratchet vulkan master Ratchet and Clank ACIT RSX

Xcedf commented 5 years ago

Found out that this PR fixes Prince of Persia old regression, first the image was blurry, than on recent master it just have blackscreen ingame on this PR it's fine 45

kd-11 commented 5 years ago

Checked a few regressions and a few have been fixed by the last commit unexpectedly. Could be worth checking if anything changed in regressed titles.

Xcedf commented 5 years ago

Retested my games none affected, nvidia driver segfaults still here unfortunately

kd-11 commented 5 years ago

Quite strange; I can't get any games to segfault. Which one segfaults the fastest for you?

Xcedf commented 5 years ago

Dante's Inferno, booting any save enough

MarioSonic2987 commented 5 years ago

Flashing effect in title screen (after pressing start) is broken in Resident Evil 6: image image

RSX Capture

kd-11 commented 5 years ago

Looks like a ton of use-after-free errors.

kd-11 commented 5 years ago

Last commit is still WIP and has some issues if you run a game long enough.

Xcedf commented 5 years ago

Last commit: Dante's Inferno works again, but other games like Killzone 2 demo and AC once more now have just crash no error message and no segfault 12

Xcedf commented 5 years ago

Latest push: the segfaults or crashes or whatever that was is fixed

kd-11 commented 5 years ago

Killzone 2 graphics broke, but in the meantime I figured out why these games have such terrible performance.

uaqlover commented 5 years ago

RPCS3 v0.0.6-3cbb0fea Alpha | fbo_fixes | Firmware version: 4.83

fix's https://github.com/RPCS3/rpcs3/issues/4452

fix

NASCAR The Game: Inside Line [BLUS30932] NASCAR '14 [BLUS31378] NASCAR '15 [BLUS31560]

master

NASCAR The Game: Inside Line https://drive.google.com/file/d/1avafMc-SJtyUTkTeXHocN3kFzqyZ0h-s/view?usp=sharing NASCAR '14 [BLUS31378] https://drive.google.com/file/d/1uQ0CcLm-0K3-hoDtrz_qXjq9S4kFBXX2/view?usp=sharing

this pr

NASCAR The Game: Inside Line https://drive.google.com/file/d/1UNkfiDqM3nnLqPBKAenHj3qDoOeda51G/view?usp=sharing NASCAR '14 [BLUS31378] https://drive.google.com/file/d/1L9DYs-ddhX6Kr-aYnXPZkms2gMxN67iz/view?usp=sharing


NASCAR The Game: Inside Line [BLUS30932] ingame > playable NASCAR '14 [BLUS31378] ingame > playable NASCAR '15 [BLUS31560] ingame > playable

uaqlover commented 5 years ago

this pr fix's also

https://github.com/RPCS3/rpcs3/issues/5869

F1 Race Stars™ [NPEB01124]

master on Vulkan

FPS_ 60 10 _ Vulkan _ 0 0 6-8086 _ F1 Race Stars™  NPEB01124  10_05_2019 6_18_02 PM

pr on Vulkan

FPS_ 60 21 _ Vulkan _ 0 0 6-3cbb0fea-fbo_fixes _ F1 Race Stars™  NPEB01124  10_05_2019 6_16_32 PM

@nitrohigito can you confirm this fix with AMD card

kd-11 commented 5 years ago

Fixed an address-self-intersection glitch, likely fixes a lot of the more strange regressions caused by this.

MarioSonic2987 commented 5 years ago

RE6 regression is still there: image

RSX Capture

kd-11 commented 5 years ago

@MarioSonic2987 Comparison RDC would maybe work better for this one since the capture has the glitch even with master. Just capture renderdoc master vs renderdoc with this PR.