RPCS3 / rpcs3

PlayStation 3 emulator and debugger
https://rpcs3.net/
GNU General Public License v2.0
15.34k stars 1.91k forks source link

[Task] Implement surface pitch transformation to enable proper data inheritance. #10208

Open kd-11 opened 3 years ago

kd-11 commented 3 years ago

Relates to https://github.com/RPCS3/rpcs3/issues/9133 This causes data leaks which then become a serious problem when WCB/WDB interaction comes into play.

Flow: Surface A, pitch X modifies memory. Surface B, pitch Y also modifies the memory. Modifications at A should be present at B but due to pitch mismatch, they are lost with the current setup. Surface B, which does not contain the correct data inherited from A, is written to CELL. Surface A fails memory test later and is reconstructed using memory from CELL which now has holes in the render.

This is what causes games to render incorrectly when RCB/RDB is enabled. Pitch translation is critical for getting buffer recreation to load from memory instead of clearing to 0.

Workplan (new implementation)

NOTE: Sub-tasks restructured to remove aggressive changes that would have broken resolution scaling.

Augusto7743 commented 3 years ago

Thanks very much kd-11 :-)

kd-11 commented 3 years ago

Implemented locally, but I need some other code to first get upstream before this can be introduced to the core product. I also have some minor performance concerns about this, but optimization is possible before submission.

Linear524 commented 2 years ago

I waited loooooong for this changes :) WCB/WDB function broken in many games (GT6, Beyond Good&Evil, FC3, etc) Hope those issues will be fixed too :) Thank you KD-11 !

Linear524 commented 2 years ago

@KD-11 Sorry for the dumb question, but - will you implement next goal "Implement surface cache read from the bo list. Read color buffers should integrate with this." in this year 2022 ? I just hope to see missing screen dirt effects in TLoU and working MLAA in this title and Uncharted 3...

kd-11 commented 2 years ago

Yea, it is mostly done, I just had some problems with it and took a break to work on other things first. It should be completed this quarter nonetheless.

Triticum0 commented 1 year ago

Ultra Dimension NeptuneV WCB function is broken.

Linear524 commented 1 year ago

Hi KD-11 ! :) Is there any plans for RSX emulation improvements and fixes this year ?) There is no news about new implementation (#10208 workplan) so we're a bit worried...

kd-11 commented 1 year ago

Hi KD-11 ! :) Is there any plans for RSX emulation improvements and fixes this year ?) There is no news about new implementation (#10208 workplan) so we're a bit worried...

The workplan is still ongoing. I only paused briefly to work on other things for a while to avoid burnout. There are a couple of things I'm working on right now, I'll resume once that is done.

Linear524 commented 1 year ago

Thank you ! (__/) (='.'=)

kd-11 commented 9 months ago

Move blit target resources to the surface cache. This will merge all GPU-resident data in one structure.

This has become increasingly more important as it is the only fix for the CPU-blit vs GPU-blit differences that we still have. It is an insane amount of work though so I won't rush it. I'll likely start working on it towards the middle of the year.

Augusto7743 commented 9 months ago

Sincerely ... RPCS3 current version run all my PS3 disc games .. only few issues in some games not breaking the gameplay. I need say thanks very much for you kd-11. In Linux even if Nvidia video cards run with better performance than in windows the nvidia drivers not allow use system memory being video memory ... In Linux nvidia GPU memory is only in own video card ... windows is in video card and in system memory. Why you say it ? Simply you have done amazing optimizations so using less video ram for same work.

Your more recent work in WCB+RCB and others settings has done an boost in performance. Some games are having issues. After I post in correct topic WCB+RDB topic about it. However not demanding an fix in your direction, but I wish good luck in your path and want an "company" seeing your work =)

and even if you not had done recent optimizations I wish goo luck for you ... You have done much work and need return in you path.