-
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
[Vulkan] Weird shader bug (Z-fighting?) #11583
Comments
Can you try creating GE frame dumps for any of these scenes? I'd guess something with render-to-texture or depal. -[Unknown] |
For some reason, the debugger keeps saying "waiting for a game to start...", even though, according to the page title, the game is recognized (ULUSxxxx....) . Any idea what's wrong? (Android, firewall disabled, website access on) |
Hm... if it detects the game id, are you in the pause menu? Try pausing and resuming perhaps? -[Unknown] |
Doesn't help. Already done that. |
Wait. I got it! The game shouldn't be paused. Derp. |
Looks somewhat like Z fighting.. on the PSP, doing both base texture and environment map requires two passes. If the GPU somehow optimized the two shaders differently this kind of thing could happen... Usually I think drivers take special care to compute accurate vertex coords though. Dunno... |
@hrydgard @unknownbrackets |
Does using software transform (not software rendering, just unchecked hardware transform) help? Does software skinning affect it? This seems to use weights + environment mapping + an unusual -[Unknown] |
No. Neither software transform nor software skinning affect any of those games (in terms of this issue of course) |
Could it be a driver bug? If so maybe I could test on PC to be sure. |
It doesn't look funny when I run the dump. If you run that dump on your phone (just open as a game), does it look funny still? -[Unknown] |
Yes. Does it mean it's a driver bug? |
Funny thing: When I use upscaling, the game looks fine for like a second then gets weird again! LoL |
@unknownbrackets I just updated my Vulkan API to the latest version available for my OS (1.0.66) but the issue still persists. |
Yes, seems like a driver bug. -[Unknown] |
Oh, damn. :( |
@Leopard20 I don't have the issue with the lines in the therapy session room like you do: But, I do have a similar issue: In Silent Hill: Shattered Memories there are lines that appear to be cast shadows from the flashlight being rendered incorrectly. Since it scrolls like the shadows, and their shape seems off, I don't think it is z-fighting in that instance at least. I can't speak for the other games. Here's how it looks on a PSP (from a Youtube video I found, as I have no means of capturing from a PSP directly, so apologies for the quick and dirty picture quality): Here's how it looks in PPSSPP: Since I'm not sure if my issue is the same as the one @Leopard20 is experiencing, should I open a new issue for it? The other issues I've searched for seem to be a bit different as well. |
@Metalwario64 That one looks different. But again this game has always had lots of graphical glitches. Perhaps you should take a look at the old issues, see if there's any similar ones. @unknownbrackets I bisected the issue. And it's very interesting. Once again it's caused by this: 06340bf
Which one looks "correct"? The one with those lines?! Trust me when I tell you there's no discard bug! Perhaps there was a bug on old drivers but not anymore (I'm using the latest driver, at least for my OS) Can you please revert that commit? Or at least find a better "workaround"? |
@Metalwario64 This game is using some extremely advanced tricks to implement real depth shadow mapping on the PSP's hardware, which doesn't really support it. If you take a few GE dumps it will make it more convenient to figure out what's going wrong - can you do that (https://github.com/hrydgard/ppsspp/wiki/How-to-create-a-frame-dump)? I think we had some issue already, but if you don't find a good one please create a new one. |
@unknownbrackets The issue doesn't seem to have been fixed completely. In Ace Combat, everything looks fine in the menu: There are no issues in Silent Hill or NFS though. |
So....what about this one? Don't you guys want to reopen? |
Just don't use Vulkan, the driver is broken either way. I'm not going to play a game of "break this game, fix this game" and I'm not going to create an intricate list of thousands of game ids with a "maybe preferrable version of the Adreno driver bugs." Use GLES for now and wait for Adreno to release a better driver. -[Unknown] |
@unknownbrackets Jeez. Simmer down dude. |
It's still a bug, so we should keep it open. But like I said: it's probably only fixable by Adreno. -[Unknown] |
@unknownbrackets So far the impact seems to be positive! The issue is gone! I'll check more thoroughly later! |
All games I tested (including Project Diva) work fine. I think it's safe to say it's fixed completely. |
Naruto still have this issue. adreno 530, vulkan 1.0.61. ppsspp 1.7.5-332. |
adreno driver really do evil things. naruto work fine on android 7.0. after update to android 8.0, opengl 3.2 v@269, this game get stuck on opengl backend, and get display issue on vulkan backend. |
@weihuoya got a frame dump with the problem? https://github.com/hrydgard/ppsspp/wiki/How-to-create-a-frame-dump |
ok, wait a few days, I don't have a pc to dump. |
There is now a way to get frame dumps even on Android, as described in my link. Though maybe tricky to upload the dump to GitHub... |
awesome job. it works. |
Can we call this issue fixed now? -[Unknown] |
@unknownbrackets No. The problem still exists in Naruto: |
If you add Naruto Shippuden to PixelDepthRounding compat.ini does it help? |
Just for context on the bug: Naruto is drawing the dirt over the grass using a So that's the scenario of the driver bug - it might incorrectly write stencil otherwise. A bit unclear if that'd be worse, it seems to stencil out the sky for some reason (everything but the sky has stencil set.) Might just miss some sunflare effects, but might also be used for special attacks. If this is happening on newer Adreno devices or drivers (i.e. not with this workaround), then I'd guess it could be an issue with exactness, but the gaps seem too wide for that. -[Unknown] |
PixelDepthRounding fixes this but the performance penalty is huge. |
VertexDepthRounding doesn't do the trick I guess? |
Doesn't help |
Maybe create like AdrenoDepthStencilBugWorkaround just like in Mali GPU? |
None of my Mali phones (S8, S20) reproduce this running the .ppdmp, but there's one more thing I want to try before we force PixelDepthRounding - position invariance, see https://www.khronos.org/opengl/wiki/Type_Qualifier_(GLSL)#Invariance_qualifiers . I'll commit a quick attempt soon. |
The code that computes shader outputs declared as invariant gets certain optimizations disabled that could change the value - it makes it more likely that different ways to do the same calculations end up with the same value. This can help some types of Z fighting problems and similar. Generally not a big deal for performance, plus, we're rarely vshader-bottlenecked...
Don't really have high hopes that it will help, won't be surprised if we end up enabling pixeldepthrounding. We should indeed probably make a Mali-specific version of that in that case. |
e56e594 doesn't help. |
#16043 doesn't help for vulkan. |
That's interesting! Wonder what might have fixed it? |
This issue is safe to close now. |
Maybe also the equal checks using draws instead of clears helped normalize some differences? Or a benefit of using I'll close this then as worked around (for drivers we can) and fixed where we can. Good if it's not happening on Adreno 5xx. Definitely possible Adreno fixed it. -[Unknown] |
In certain games, you can see a bunch of weird lines on some surfaces (particularly those that have some sort of "reflection" or "shining" effect)
Here are some examples:
Ace Combat Joint Assault -> Aircraft and missiles
NFS Underground -> Windows
Silent Hill Shattered Memories -> Walls
OGL works fine in all above games.
Device: Mi 5s Plus, Snapdragon 821
OS: Android 8.0
The text was updated successfully, but these errors were encountered: