-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reinterpret between 32 and 16 bit texture formats #15907
Conversation
Needed for an upcoming change (since this lets us use the Draw2D uniform mechanism in depal shaders).
d82d824
to
6aecbef
Compare
I've tested this on mobile now, and it works just fine on Adreno, except that other than Spongebob, the games render a bit dark, for whatever reason. I'm gonna leave that to later fixes. Also dark on Mali, so likely not a driver bug, rather some configuration thing or extension check.. This now also fixes the God of War shadow regression. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like I'm missing something that makes the depth swap safe - what if a game were using that configuration of parameters but actually intended to draw color? Maybe left from a previous draw.
Also feel like we should probably just add those cmds to the depth dirty, or else we'll find little bugs...
-[Unknown]
As for adding the blend stuff to depth dirty, yes, technically it's needed. Still I'm reluctant because that is common enough state that it might have some impact, and setting stencil to KEEP/KEEP/ZERO like this is quite unusual so unlikely to be leftover state from some previous draw... But I might end up eating those words, heh. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
State tracking bugs are always annoying, though you're right it should be pretty rare with these checks.
-[Unknown]
… See #15907 Not ideal to not check the verts :(
Fixes #15898 (Rendering issues in Tantalus games), more details in that issue.
Fixes #9850
Fixes #9604
Fixes #9018
Fixes the God of War shadow regression reported in comments to #15888.
Hopefully this also gets us closer to universally enabling reinterpret.
Not too afraid of merging this despite its size, can't find any regressions but if there are, they should be easy to fix, easier than before due to many things being handled in ways that are easier to reason about.
Spongebob now renders near perfectly, the other games have minor issues at 2x+ resolution, and apparently some subtle off by 1. Good enough for a first merge.
So far, Spongebob is rendering better but still broken due to two issues:Something is wrong with the depth texture depal, seems the shift is wrong, or somehow the input to it, something, as it causes an annoying repeating gradientEDIT: Turns out that the game uses a stencil/alpha trick to clear alpha, making this not apply where it's out of range.CLUT mode is set to CLUT16, mask 0xFF, shift 2. Depth data is 16-bit, so that just takes bits 2-10. The high bits 11-16 are unused in the lookup, causing a repeated gradient, which is weird and looks bad.
Other things to do: