hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.36k stars 2.18k forks source link

libretro core graphical glitches with OpenGL driver #15056

Closed ner00 closed 2 years ago

ner00 commented 3 years ago

Game or games this happens in

ULUS-10277 - Castlevania - The Dracula X Chronicles ULES-00910 - SEGA Rally ULUS-10246 - Virtua Tennis 3

What area of the game / PPSSPP

Just in-game, generally, when using gl or glcore drivers - D3D11 works fine.

A few screenshots demonstrating the issue:

ULES-00910 - SEGA Rally

ULUS-10246 - Virtua Tennis 3

ULUS-10277 - Castlevania - The Dracula X Chronicles

ULUS-10277 - Castlevania - The Dracula X Chronicles

ULUS-10277 - Castlevania - The Dracula X Chronicles

What should happen

Not have graphical glitches or crash.

Logs

No response

Platform

libretro / Retroarch

Mobile phone model or graphics card

Intel UHD Graphics 630

PPSSPP version affected

v1.13.3-80-g59f3d4b

Last working version

74f08be

Graphics backend (3D API)

OpenGL / GLES

Checklist

BParks21 commented 3 years ago

The same thing happens in the standalone ppsspp with opengl. Just tested it. Not exclusive to libretro. Happens with Vulkan as well in standalone. D3D11 is fine.

unknownbrackets commented 3 years ago

A bunch of games being broken in almost all backends since April (74f08be) and including in the latest stable release (v1.12.3) seems a bit surprising, especially because I haven't seen such widespread issues. Is the a more recent working commit?

Could you try exporting a GE frame dump? These help a lot. Just make sure to export it when you see the issue - it's almost like a screenshot. If you make it while the issue isn't happening, it won't help.

See here for instructions - it's not hard and works on Android too: https://github.com/hrydgard/ppsspp/wiki/How-to-create-a-frame-dump

You can zip that and then drag and drop it into a reply here.

-[Unknown]

BParks21 commented 3 years ago

Here ya go. Hope I did it correctly. In the process of doing this I discovered that these graphical bugs are only occurring when I go Fullscreen. They go away when I enter windowed mode. Edit: Ok actually the graphical bugs are reduced not eliminated in windowed mode. recording.zip .

unknownbrackets commented 3 years ago

Alright, so I can reproduce at least this Castlevania issue, but only in OpenGL.

Here's a PSP rendering: #15056_ULUS10277_castlevania_glitches

Here's our software rendering, pretty close but it's calculating something brighter and there's a black line at the bottom: #15056_ULUS10277_castlevania_glitches_software

Here's Vulkan on an Intel UHD Graphics 630 (no black space on right because this is a screenshot): #15056_ULUS10277_castlevania_glitches_vk_intel

However, GLES indeed looks wrong: #15056_ULUS10277_castlevania_glitches_gles

That said, this problem at least is not since April or anything, but is only since #14833. There was some expectation that there might be issues after that merge, although we'll need to check more. I've personally see some issues that seem like NVIDIA driver glitches in one other game, but need to update my driver one step.

I think it's unlikely that culling would cause the issue in the Virtua Tennis screenshot, so that needs its own GE frame dump.

-[Unknown]

BParks21 commented 3 years ago

Well this is definitely effecting opengl and vulkan for me. The graphical glitches look identical with both. I'm using an Nvidia 1080ti. They also look like the screenshots the original poster provided.

unknownbrackets commented 3 years ago

Here's another frame dump from a game I'm seeing an NVIDIA driver glitch with: https://cdn.discordapp.com/attachments/478294170662862852/900898289443033158/14833_ULUS10144_loh5_guardband.ppdmp

Other people on discord with the latest NVIDIA driver reported not seeing any issues with the dump (for me, it's very obvious, there are black missing triangles in the sky.)

This issue seems to be behaving the same way. Just stepping through the frame is enough to prevent the issue and it depends how far into the frame I step (no matter whether things are flushing to the GPU or not), which may imply it's fixed by having the GE debugger preview GL instance state.

Do you see the same glitch in that frame dump? You just have to open the file in PPSSPP, as if it were a game.

-[Unknown]

BParks21 commented 3 years ago

It looks exactly the same when I open the frame dump. If I take a screenshot with Windows key and Prtsc key it looks normal. This is what I'm seeing, except it's flickering. Took this one with f12 ULUS10277_00000

unknownbrackets commented 3 years ago

Sorry I meant the other frame dump I linked to, which is from Legend of Heroes: Cagesong of the Ocean.

https://cdn.discordapp.com/attachments/478294170662862852/900898289443033158/14833_ULUS10144_loh5_guardband.ppdmp

Interesting also that your missing things are different from my missing things on NVIDIA GL.

-[Unknown]

BParks21 commented 3 years ago

ULUS10144_00004 ULUS10144_00005

The first one is with vulkan the second is with opengl.

BParks21 commented 3 years ago

They look normal in windowed mode.

ner00 commented 3 years ago

That said, this problem at least is not since April or anything, but is only since #14833.

The previous working version of PPSSPP that I had was from April, I had no other backup in-between, and I was under the assumption that this was an exclusive libretro issue, otherwise I would have downloaded an older version from the site.

On that last note, I was unable to get any kind of graphical glitch with any of the 3 games mentioned when running standalone PPSSPP v1.12.3, under Win10 x64, Intel UHD 630 - not even with OpenGL so I'm very confused at this point why I'm not experiencing the issue with the standalone as you are.

unknownbrackets commented 3 years ago

I think it's a driver glitch, so the specifics of when you do and don't experience it aren't so simple. For example, I found if I increase the render resolution to 8x AND fast forward, I can reproduce on Vulkan. It's very strange.

Not everyone is experiencing this on NVIDIA, apparently, which is stranger still.

-[Unknown]

BParks21 commented 3 years ago

I'm like 1 or 2 drivers behind on the Nvidia side. I haven't updated because the Yuzu team reported that the latest driver is causing graphics issues for them. So I can't win if I hop onto the latest lol.

hrydgard commented 3 years ago

15058 might have fixed this, uninitialized values could end up in cull distance.

hrydgard commented 3 years ago

Turns out #15058 indeed fixed this problem on Vulkan but on Discord there was an OpenGL crash reported still existing on Intel Xe:

image

 stuken: xbrz texture scaling is breaking it
 stuken: thinking that its not the cull changes, but the texture one just before
 stuken: yup happening on build 97
unknownbrackets commented 3 years ago

Is that specific to libretro or is that proper PPSSPP?

-[Unknown]

hrydgard commented 3 years ago

Sounded libretro-specific, not sure why. Haven't tested myself yet

BParks21 commented 3 years ago

Seems fixed in standalone and libretro for me. Not sure about crashes.

unknownbrackets commented 2 years ago

15109 improved texture scaling on Mali, is it possible it fixed this issue too?

It seems like there haven't been many reports of issues like this recently.

-[Unknown]

unknownbrackets commented 2 years ago

There haven't been any new reports of the OpenGL crash or any comments since my last comment, so I'm going to close this. The primary issue was definitely fixed.

If you have more information or can confirm it still happens in the latest git builds, please reply to this issue and it'll be reopened. If you have a new issue with the same game, just create a new issue instead.

-[Unknown]