Skip to content
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] 魔法少女リリカルなのはA's Portable - Gears of Destiny: Graphical glitch #11980

Closed
Leopard20 opened this issue Apr 17, 2019 · 29 comments · Fixed by #16043
Closed

Comments

@Leopard20
Copy link
Contributor

Leopard20 commented Apr 17, 2019

The characters' pictures during dialogs is not displaying correctly.
Vulkan:
Screenshot_2019-04-17-14-54-41-305_org ppsspp ppsspp

OGL:
Screenshot_2019-04-17-14-53-57-732_org ppsspp ppsspp

recording.ppdmp.zip

Device: Mi 5s Plus, Android 8.0

@hrydgard
Copy link
Owner

Pretty likely to be the same old alpha test issue we've seen on Adreno 500 drivers...

@Leopard20
Copy link
Contributor Author

Ah...again?!

@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Apr 19, 2019

Draw 1281/1282, it draws a box that contains the face, using:

  • Stencil test ALWAYS REPLACE ff
  • Alpha test: a > 2 (means discard)
  • Depth test off, but depth write enabled.

This definitely activates the driver bug that the Adreno 5xx has. Our workaround doesn't activate because depth write is enabled (despite depth test being off.)

I suspect it would workaround it to add more to the check:

id.SetBit(FS_BIT_NO_DEPTH_CANNOT_DISCARD_STENCIL, !IsStencilTestOutputDisabled() && !gstate.isDepthWriteEnabled());

Replace with:

id.SetBit(FS_BIT_NO_DEPTH_CANNOT_DISCARD_STENCIL, !IsStencilTestOutputDisabled() && (!gstate.isDepthTestEnabled() || !gstate.isDepthWriteEnabled()));

Not sure if this would have negative impacts in other games.

-[Unknown]

@hrydgard
Copy link
Owner

Hm, that feels like it should be safe-ish because with the depth test disabled, depth write does nothing.

@Panderner
Copy link
Contributor

This issue does not occur for POCO M3, Android 10 in Vulkan:
Screenshot_2020-12-27-13-26-14-105_org ppsspp ppsspp

@ss8688
Copy link

ss8688 commented Feb 22, 2021

I have a same problem on a Mail-G52 GPU

@Panderner
Copy link
Contributor

It does not occur for my POCO M3 using Vulkan in latest build.
Screenshot_2021-02-22-13-45-47-777_org ppsspp ppsspp

@unknownbrackets
Copy link
Collaborator

Is this working now?

-[Unknown]

@unknownbrackets
Copy link
Collaborator

Noted as not working in #13599.

-[Unknown]

@ghost
Copy link

ghost commented May 2, 2021

I can't reproduce this issue on my Redmi Note 9 Mali GPU Vulkan
Screenshot_2021-05-02-20-59-59-116_org ppsspp ppsspp

@Panderner
Copy link
Contributor

I can't reproduce this issue on my Redmi Note 9 Mali GPU Vulkan
Screenshot_2021-05-02-20-59-59-116_org ppsspp ppsspp

Hmm @Gamemulatorer that screenshot lied.

@ss8688
Copy link

ss8688 commented May 2, 2021

@Gamemulatorer @Panderner It do appears on my honor 9x with mail g52 .Same as Leopard20's Mi 5s
But not on my redmi k40 with Snapdragon 870
You are using a different device,I think

@ss8688
Copy link

ss8688 commented May 2, 2021

It just reproduces on certain devices
I heard that it can be reproduced on HUAWEI mate 30. but don't kown if it is true.
Because I don't have one.

@unknownbrackets
Copy link
Collaborator

Right, this is a driver issue. I'm not sure specifically what devices are affected but I think it is only:

  • Adreno 5xx GPUs (not Adreno 6xx or newer), AND if they have an older driver (typically, lower than Android 10, but varies by device manufacturer.)
  • Mali devices (not sure which), probably also only older than certain drivers but not sure.

The devices mentioned:

  • Honor 9x: Mali-G52, Android 10 (affected)
  • Huawei Mate 30: Mali-G76, Android ver unknown but >= 10 (affected)
  • Redmi Note 9: Mali-G52, Android ver unknown but >= 10 (affected)
  • Mi 5s Plus: Adreno 530, Android 8 (affected)
  • Redmi K40: Adreno 650 (unaffected)
  • Poco M3: Adreno 610 (unaffected)

So on the Mali front, this probably affects all of Bifrost. It'd be interesting to know if any phone with the below SoC has the issue (these are all Valhall, like Adreno 5xx -> 6xx):

  • Mali-G57 (Kirin 820, Dimensity 8xx)
  • Mali-G68 (not sure)
  • Mali-G77 (Kirin 985, Dimensity 1000, Exynos 990)
  • Mali-G78 (Kirin 9000, Exynos 1080, Exynos 2100)

If we can narrow down the range we at least would know for sure what devices are and are not affected and might be able to get some info from Mali.

-[Unknown]

@ss8688
Copy link

ss8688 commented May 3, 2021

@unknownbrackets

I can't reproduce this issue on my Redmi Note 9 Mali GPU Vulkan
Screenshot_2021-05-02-20-59-59-116_org ppsspp ppsspp
As he says
Redmi note 9 is not affected

@unknownbrackets
Copy link
Collaborator

Well, yes, but it sounds like it might be a mistake or typo because the provided screenshot does show the issue as Panderner and Leopard20 noted.

If it's indeed not affected, that could mean a driver update fixed it which would be good and might mean a driver update would fix the others if available. In that case, Mali might know more about the details of the glitch and if a workaround is possible. But like I said, I suspect it was a mistake and that device is also affected.

-[Unknown]

@hrydgard hrydgard modified the milestones: v1.12.0, Future-Prio Aug 29, 2021
@ghost
Copy link

ghost commented Oct 13, 2021

@unknownbrackets

I can't reproduce this issue on my Redmi Note 9 Mali GPU Vulkan
Screenshot_2021-05-02-20-59-59-116_org ppsspp ppsspp

As he says
Redmi note 9 is not affected

Sorry I was wrong there 😅
But to fix this issue just added this game to PixelDepthRounding and the issue is solve at least for me :3

PROOF

Screenrecorder-2021-10-13-17-20-17-565.mp4

@ss8688 feedback please.

@hrydgard
Copy link
Owner

Probably means that the driver over-optimizes something, and PixelDepthRounding prevents it from doing so as a side effect - and would not be needed on other GPUs, and is supposed to have some performance cost.

At this point maybe we need to add a PixelDepthRoundingIfMali to avoid performance loss...

@ghost
Copy link

ghost commented Jul 12, 2022

This can be fixed now via c5a10a5 on MALI GPU only I don't know about Adreno.

@unknownbrackets unknownbrackets removed this from the Future-Prio milestone Jul 12, 2022
@unknownbrackets unknownbrackets added this to the v1.13.0 milestone Jul 12, 2022
@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Jul 12, 2022

I assume the latest change triggers this since depth test is off. So I'm going to close.

Please comment if it's not actually fixed on your device with more detail about your device and its GPU and driver version.

-[Unknown]

@ghost
Copy link

ghost commented Sep 15, 2022

This issue can still reproduce on adreno gpu in vulkan.

Record_2022-09-16-01-10-13.mp4

@ghost
Copy link

ghost commented Sep 15, 2022

PixelDepthRounding can fix this issue on adreno gpu in vulkan.

@hrydgard hrydgard reopened this Sep 15, 2022
@hrydgard hrydgard modified the milestones: v1.13.0, v1.14.0 Sep 15, 2022
@unknownbrackets
Copy link
Collaborator

I wonder if this just means there's something wrong with the workaround in recent versions. Was it working in older git builds (around when it was confirmed before)? If yes, it must've broken at some time.

PixelDepthRounding is a bit expensive and can reduce quality (like forcing 1x PSP render resolution), so it may not be the ideal fix.

-[Unknown]

@hrydgard
Copy link
Owner

hrydgard commented Sep 17, 2022

Hm, we only activate the workaround on certain driver versions on Adreno:

https://github.com/hrydgard/ppsspp/blob/master/Common/GPU/Vulkan/thin3d_vulkan.cpp#L807

Maybe the range is simply too narrow. Can you check your GPU and driver version in Settings/Tools/System Information?

@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Sep 17, 2022

It was definitely fixed on version 0x80180000 with an Adreno 530, but maybe driver versions are not so linear. And it was not seen on Adreno 620 or 630 devices.

-[Unknown]

@ghost
Copy link

ghost commented Sep 18, 2022

Hm, we only activate the workaround on certain driver versions on Adreno:

https://github.com/hrydgard/ppsspp/blob/master/Common/GPU/Vulkan/thin3d_vulkan.cpp#L807

Maybe the range is simply too narrow. Can you check your GPU and driver version in Settings/Tools/System Information?

Screenshot_2022-09-18-08-41-15-35

@hrydgard
Copy link
Owner

Seems on Adreno we were still using the old check, refined it for the Mali bug. Testing on the dump, only the Mali check catches it.

So decided to finally merge these two bug workarounds, and also remove the compat flag and just activate it universally when we detect stencil without depth.

Should work once #16043 is merged.

@hrydgard
Copy link
Owner

Please check if that fixed it.

@ghost
Copy link

ghost commented Sep 18, 2022

Yes, this was fix via 4045de8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants