GS/HW: Improvements to HW moving (C<->Z), fix bug in target preloading causing misaligned base addresses. #12794
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Changes
Makes improvements to the hardware level moving between targets, namely between colour and depth targets.
Also added fixes for moving and invalidating/translating inside block offsets.
Improves texture shuffle detection heuristics to have less false positives.
Rationale behind Changes
While not always 100% correct, in most cases they copy with the respective formats so the swizzling is correct, so we can get away with it, and this fixes a bunch of behaviours.
Block offsets were also not working correctly which caused issues in some transfers/invalidation, which has also been fixed by this PR.
Gunbird Special was reading a C16 texture from memory and happened to have it's alignment position off by 8, which triggered the detection.
Suggested Testing Steps
Test the games listed below with screenshots, but also just check the following as they showed differences is numbers only, but be sure nothing broke:
Armored Core 2 & 3, Astro Boy, Baldurs Gate DA 1 & 2, Critical Velocity (watch out for seizures during videos), Dark Chronicle/Dark Cloud 2, Devil May Cry, Dog's Life, FIFA 2002, Flower Sun and Rain, Ghost in the Shell, Gradius V, Hokuto no Ken, Justice League Heroes, Kenran Butousai, Warship Gunner 2, Sakura Taisen/Wars games, Star Wars Racer (vs master, might be broken anyway), Street Fighter 3 3rd Strike, Thrilleville, Transformers The Game, True Crime NYC, Ultraman Fighting Evolution 2.
Also check the Baldur's Gate games and Total Immersion Racing for the block offset fix.
Test Gunbird Special (gsdump also in the linked issue) and I guess smoke test some games you know to have a bunch of post processing.
Did you use AI to help find, test, or implement this issue or feature?
No.
Fixes #3988 shadows for Kunoichi/Nightshade and removes the need for a CRC for the Sakura Wars games.
Fixes #12785 Star Trek Shattered Universe rendering.
Fixes #12791
Kunoichi:
Master:

PR:

Star Trek - Shattered Universe:
Master:

PR:

Bonus:
Kenran Butousai when upscaled: Ignore the speed, that's just because of how I was taking the screenshots, it'll be faster if anything.
Master:

PR:

Software for reference:

Baldur's Gate Dark Aliiance:


Master:
PR:
Fixes #12791
Gunbird Special:
Master:

PR:
