Skip to content

rsx: Fix nv0039 image (de)interleaving functionality - #19190

Merged
kd-11 merged 7 commits into
RPCS3:masterfrom
kallsyms:fix/nv0039-destiny-gather
Aug 11, 2026
Merged

kd-11 merged 7 commits into
RPCS3:masterfrom
kallsyms:fix/nv0039-destiny-gather

Conversation

@kallsyms

@kallsyms kallsyms commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

block2d_copy_with_stride took a width which should really have been an element_count. When stride > 1, this means the copy was only partial leading to apparent corruption. This PR fixes the copy logic, and also updates the corresponding barrier/sync range logic.

Before:
rpcs3-pr-before

After:
rpcs3-pr-after

Disclosure: this bug was originally identified + fixed with AI tools, however it was manually reviewed and verified (see above images).

Relates to #19198

kallsyms and others added 3 commits August 7, 2026 11:48
NV0039_LINE_LENGTH_IN specifies the number of elements, while the input and output formats specify the byte stride between elements. Copy every element instead of treating the element count as a byte span.
Scale the final row by the input and output byte strides so cache invalidation, barriers, reservations, and MM flushing cover the complete strided transfer.
Comment thread rpcs3/Emu/RSX/NV47/HW/nv0039.cpp Outdated
Comment thread rpcs3/Emu/RSX/NV47/HW/nv0039.cpp Outdated
Comment thread rpcs3/Emu/RSX/NV47/HW/nv0039.cpp Outdated
@kd-11
kd-11 marked this pull request as draft August 11, 2026 07:58
@kd-11 kd-11 added the HWTEST Ticket needs a hardware test to confirm behavior label Aug 11, 2026
@kd-11

kd-11 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Hardware claim - needs accompanying PS3 hardware tests.
I have an existing test case for this feature somewhere, and from what I remember, it did not function intuitively which heightens my suspicion that the fix may be incorrect.

@kallsyms

kallsyms commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor Author

Hardware claim - needs accompanying PS3 hardware tests. I have an existing test case for this feature somewhere, and from what I remember, it did not function intuitively which heightens my suspicion that the fix may be incorrect.

I've got hardware so can test things tomorrow - lmk what you want from me in that regard (and if you've got a framework or something you use to write these quick tests, didn't see anything from a cursory search).

@digant73

digant73 commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

there was another issue on that function fixed in #18519 (negative pitch allowed) after confirmation with HWTEST

Comment thread rpcs3/Emu/RSX/NV47/HW/nv0039.cpp Outdated
@kallsyms

Copy link
Copy Markdown
Contributor Author

@kd-11 Here's a small test suite which shows behavior on hardware.

ps3-nv0039-stride-test.zip

The run results within that match the new behavior of strided copy.

@kd-11

kd-11 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@kd-11 Here's a small test suite which shows behavior on hardware.

ps3-nv0039-stride-test.zip

The run results within that match the new behavior of strided copy.

Thanks. I already have a interleave/deinterleave test written, I'll approve if results match what I expect.

@kd-11

kd-11 commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

HWTEST: interleave2d.zip

PS3:

image

RPCS3 (master):

image

RPCS3 (PR):

image

@kd-11 kd-11 changed the title fix: strided copy & locking rsx: Fix nv0039 image (de)interleaving functionality Aug 11, 2026
@kd-11
kd-11 marked this pull request as ready for review August 11, 2026 19:00

@kd-11 kd-11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matches hw result.

@kd-11
kd-11 enabled auto-merge (squash) August 11, 2026 19:01
@kd-11
kd-11 merged commit f7cfdc6 into RPCS3:master Aug 11, 2026
10 checks passed
@kd-11 kd-11 mentioned this pull request Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugfix HWTEST Ticket needs a hardware test to confirm behavior RSX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants