pcsx2 icon indicating copy to clipboard operation
pcsx2 copied to clipboard

GS/HW: When page aligned, dirty page rects instead of SO

Open stenzek opened this issue 1 year ago • 0 comments

Description of Changes

Onimusha 3 moves texture data to a previous render target location (e00), then copies it back with a 1-line offset, to "scroll" the texture upwards. Of course this is done with P8.

Surface offsets got the dirty rect wrong, and it ended up reading back garbage. So instead, when it's page aligned (the first one is in this case), figure out the rectangle for each page in the target's PSM/coordinate space, and dirty that instead. Better than surface offsets, which gets it wrong (of course..).

In addition, we can do the same for avoiding some readbacks - if all the pages we're invalidating are within the dirty area, we can skip reading back, since local memory is valid. I do have a slight concern with this - since it uses the union of the dirty area instead of iterating through them, but nothing seems to break.

We could extend this to other cases when the BP doesn't match, but it's better to be conservative when dealing with invalidation...

Rationale behind Changes

Fixes broken scrolling effects in Onimusha 3.

Closes #8983.

Suggested Testing Steps

Check Onimusha 3. It won't fix the broken dumps, but the scrolling should work.

afproblem showed up in the run, but that's garbage anyway. Radiata Stories fireplace showed up, it's more consistently broken? but still broken.

stenzek avatar Jun 25 '23 11:06 stenzek