RPCS3 / rpcs3

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

[Task] RSX tiled memory - remaining work #14682

Open kd-11 opened 11 months ago

kd-11 commented 11 months ago

General

CPU-Blit

legend800 commented 11 months ago

As someone mentioned in the original PR, Split Second doesn't render explosions/smoke (big part of the game). I just found out that they render ONLY if you use a higher res. But if you do that, then you have mega pixelation issues like this:

2023-09-27 09_25_51-FPS_ 29 99 _ Vulkan _ 0 0 29-15655 _ Split_Second  NPUB30450

So... native res=missing effects higher res=effects render but large pixels (similar to when tiled memory is off)

Settings:

2x - RPCS3.log.gz

Ordinary205 commented 11 months ago

The Need for Speed Most Wanted/Hot Pursuit car reflections is fixed by enabling WCB+RSX tiled memory, but the reflections appears inverted. Real PS3: NFS Hot Pursuit PS3

RPCS3: NFS Hot Pursuit (2) RPCS3.log.gz

kd-11 commented 11 months ago

I reproduced the split second issue. It is likely a codepath issue, since using any scaling including 99% or 101% makes the smoke appear again. I'll debug the real cause later in the week.

Linear524 commented 11 months ago

Some bugs to solve for fully working MLAA in Uncharted 3 and TLoU : 1001 1002

Those buggy horizontal lines consist of garbled mask pixels from overall scene - if you move camera a little during those scenes - pixel objects inside those horizontal lines will move as well... Looks like a bit wrong memory sections to read or write MLAA data.

kd-11 commented 11 months ago

The stripes should be fixed in the next PR. Actually I probably should just submit that work. I was hoping to knock down a few regressions at once but no need making everything too complicated.

kd-11 commented 11 months ago

Test with https://github.com/RPCS3/rpcs3/pull/14706

Linear524 commented 11 months ago

@KD-11 TLoU and Uncharted 3 stripes still not fixed with #14706

kd-11 commented 11 months ago

Any errors in the log?

Linear524 commented 11 months ago

Will try to collect logs today :)

Linear524 commented 11 months ago

@KD-11 Nope - nothing in the logs, just standard PPU trampoline spam messages...

Ordinary205 commented 11 months ago

Enabling Handle RSX tiling memory partially fixes the other lighting for Army of TWO: The Devil's Cartel, but this causes more rainbow graphics to appear on the left side. WCB+RCB: Army of TWO WCB+RCB

WCB+RCB+RSX tiling memory (disabling the MLAA is required to remove yellow graphics): Army of TWO WCB+RCB+RSX tiling memory RPCS3.log.gz Testing the PR named "rsx: Detiler improvements" doesn't show any differences.

Ordinary205 commented 11 months ago

This PR no longer fixes NFS The Run, and Battlefield 3 now looks like this. Battlefield 3 RPCS3.log.gz

I think I accidently tested the wrong build which was 15683 instead of 15684, but I'm unable to confirm if this reduces the regression on frostbite games because the windows build is unavailable.

Ordinary205 commented 11 months ago

Thanks to illusion for messaging me on discord to get the latest build, I can now confirm that NFS The Run and Battlefield 3 hasn't reverted. 15684 15684 battlefield 3 RPCS3.log.gz

Ordinary205 commented 10 months ago

Enabling RSX tiled memory causes NFS Most Wanted to have more square artifacts to appear on top of the left/right side from the screen. Before: (WCB) NFS Most Wanted RPCS3.log.gz

After: (WCB+RSX tiled memory) NFS Most Wanted RSX tiled memory RSX tiled memory.gz This issue doesn't happen on NFS hot pursuit.

kd-11 commented 10 months ago

This one is a race condition between SPU post-fx pipe and RSX post-fx pipe. The only solution is to speed up SPU code drastically while WCB is active which isn't really feasible without some low-level changes. Something can definitely be done for AMD cards which support device-coherent memory, but for the rest, only faster CPUs will save us. You can also give "Accurate RSX reservations" toggle a try and see if it helps stabilize the issue. This problem already exists in other games such as GT6 as well.

Ordinary205 commented 10 months ago

I was testing this game when having Accurate RSX reservations enabled, but sadly it doesn't fix the flickering artifacts with or without that option. Need for Speed most wanted RPCS3.log.gz

Ordinary205 commented 10 months ago

Enabling RSX tiled memory causes a regression on NFS Hot Pursuit when having read color buffers and asynchronous texture streaming enabled. Before: WCB+RCB+ATS NFS Hot Pursuit before

After: WCB+RCB+ATS+RSX tiled memory NFS Hot Pursuit after

But if I disable the read color buffers or asynchronous texture streaming, the regression is gone. NFS Hot Pursuit without RPCS3.log.gz

kd-11 commented 8 months ago

CPU blit is now feature complete as of https://github.com/RPCS3/rpcs3/pull/14934 There are a lot of corner cases when GPU blit is active, I'll try and get those sorted in coming weeks but the limitation is well known (surface and texture cache are separate and don't communicate). I think a lot of corner cases can be handled by replacing the RCB load with a texture cache load+copy (basically a fullscreen quad draw with texture cache as the source). Doing that is easier said than done however.

Ordinary205 commented 8 months ago

NFS Most Wanted has stability issues when enabling RCB or RSX Tiled memory before going ingame If I enable RCB with WCB+RSX Tiled memory, the game crashes with this error: WCB+RCB+RSX Tiled memory: Need for Speed Most Wanted doesnt Need for Speed Most Wanted error

However if I try disabling RCB or RSX Tiled memory, the game works fine and enters ingame successfully. WCB+RSX Tiled memory: Need for Speed Most wanted working

WCB+RCB+RSX Tiled memory: RPCS3.log.gz

kd-11 commented 8 months ago

NFS Most Wanted has stability issues when enabling RCB or RSX Tiled memory before going ingame If I enable RCB with WCB+RSX Tiled memory, the game crashes with this error: WCB+RCB+RSX Tiled memory: Need for Speed Most Wanted doesnt Need for Speed Most Wanted error

However if I try disabling RCB or RSX Tiled memory, the game works fine and enters ingame successfully. WCB+RSX Tiled memory: Need for Speed Most wanted working

WCB+RCB+RSX Tiled memory: RPCS3.log.gz

This should be a separate ticket.

Ordinary205 commented 8 months ago

NFS Most Wanted has stability issues when enabling RCB or RSX Tiled memory before going ingame If I enable RCB with WCB+RSX Tiled memory, the game crashes with this error: WCB+RCB+RSX Tiled memory: Need for Speed Most Wanted doesnt Need for Speed Most Wanted error However if I try disabling RCB or RSX Tiled memory, the game works fine and enters ingame successfully. WCB+RSX Tiled memory: Need for Speed Most wanted working WCB+RCB+RSX Tiled memory: RPCS3.log.gz

This should be a separate ticket.

Well I thought it would be a good idea to report this issue on this ticket, since its an RSX tiled memory bug, but I'll make a report anyways.

kd-11 commented 8 months ago

I create the tickets for specific work items but these are usually theoretical (i.e no logs). This error is unexpected hence the assert rather than just broken graphics.

kd-11 commented 8 months ago

With https://github.com/RPCS3/rpcs3/pull/14985, frostbite now renders semi-correctly. The only issue left to resolve is the texture tiling (repeating) which is a known blit-engine issue that I was never able to observe directly. image

kd-11 commented 8 months ago

https://github.com/RPCS3/rpcs3/pull/14985 also fixes split/second issue with missing effects. That was being tracked by https://github.com/RPCS3/rpcs3/issues/14984

legend800 commented 8 months ago

Gfx broken on Split Second with this PR (100%):

2023-12-31 15_05_13-FPS_ 23 31 _ Vulkan _ 0 0 29-705e17ae Alpha _ maint0 _ Split_Second  NPUB30450 2023-12-31 15_12_46-FPS_ 29 99 _ Vulkan _ 0 0 29-705e17ae Alpha _ maint0 _ Split_Second  NPUB30450

Settings: Strict(fix red lines), WCB + RCB + RSX tiled memory(skybox smearing and env lighting), 100% res(pixelation)

Split Second [NPUB30450].log.gz

kd-11 commented 8 months ago

That was always inconsistent for me even before the PR. Likely some timing thing. In my case I use all the buffer options and tiled mem option. It could be related to the mirrors effect bug but that's something else.

legend800 commented 8 months ago

R/W depth buffers aren't needed. Results are 100% consistent, so I don't think there's a race condition here. Gfx broken on PR (https://github.com/RPCS3/rpcs3/pull/14985) and fine on the latest Master build (aside from what's noted here https://github.com/RPCS3/rpcs3/issues/14984):

Master:

2024-01-01 09_15_17- 2024-01-01 09_14_36-FPS_ 30 01 _ Vulkan _ 0 0 29-15898 _ Split_Second  NPUB30450

Split Second [NPUB30450].log.gz

legend800 commented 7 months ago

@kd-11 Did you see this comment here: https://github.com/RPCS3/rpcs3/issues/14984#issuecomment-1873414256?

Game was not improved and that PR only regressed it. This is not accurate:

image

Asinin3 commented 7 months ago

Why tag someone three times about the same thing.

legend800 commented 7 months ago

Because I'm trying to get attention on it. I pinged him twice and it was not acknowledged and I've seen no follow-up. It's just broken now.

Asinin3 commented 7 months ago

@legend800 Once is enough, don't spam.

kd-11 commented 7 months ago

Vertical repeats and flickering at the bottom of the screen (star wars) are caused by tile encoding into partial 2D regions. This is not allowed because the spatial distribution is not coherent. A linear 2D region scatters the pixels all around in X and Y with the exception that Y regions seem to behave. Either way, some changes are needed to ensure the whole tile is available to the encoder:

With halfplemented variants of the above the mirror/repeat bug disappears from NFS:Rivals and Split/Second.

kd-11 commented 7 months ago

I've implemented the requirements above in https://github.com/RPCS3/rpcs3/pull/15160 However, there is now a strange bug where partial writes cause flicking in the top and bottom parts of the frame. Loading the entire tile from offset 0 hides the bug so I don't know what is actually causing it.