-
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
Add support for binding the depth buffer as a color target. Fixes Kurohyo depth sorting #15772
Conversation
Hm, still has problems on Vulkan on Adreno, works on OpenGL though. |
It seems to work fine, I will write if there are problems. |
Ah interesting, think we might be mistakenly filtering the depth texture. I'll get a fix in soon. |
I believe that change should take care of it. |
(Not a perfect method, it could theoretically have been upscaled in a normal render pass...)
Okay, I guess not, but it kinda has to be that, or something very related... Can I have a GE dump or savestate file from that location? |
Also, does it look like that in all backends (Vulkan, D3D etc?) |
How make GE dump? |
Savestate https://drive.google.com/file/d/1-o47utQjASHd0EDx3EOaSkEfmXU_y5IU/view?usp=sharing |
thanks! |
Alright, I think I got it sorted now. Thanks so much for the test case. |
Fixes #9576
Kurohyo uses 2d backdrops with 3d characters rendered on top of them, and to fill in the Z buffer to make the characters sort against the background correctly, it writes a depth image directly to the Z buffer.
The PSP doesn't have any special mode for this, instead this game uses 565 color mode, binds the Z buffer as a color buffer, and writes the image as a color image.
I am not introducing a game specific compat flag, hoping for the best, heh (that it won't break something else).
Since such rebinding is entirely impossible on PC, but we can write explicitly to depth, we find the corresponding framebuffer that last touched that depth buffer, bind it normally for rendering, and we use a new rendering mode where:
Result - the characters should clip correctly!
WIP, only works in Vulkan in straight-through depth mode so far, but the other backends will be fixed too.