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.02k stars 2.15k forks source link

Pursuit Force graphic issues #11216

Open weihuoya opened 6 years ago

weihuoya commented 6 years ago

What happens?

car run under road in some place, test on android, PC seem doesn't has this issues. 1 screen1

another issue, graphic glitches vulkan backend only. opengl and direct3d work ok. screen2

What hardware, operating system, and PPSSPP version? On desktop, GPU matters for graphical issues.

PPSSPP version: ppsspp-v1.6.3-248-g098a7ffea-windows-amd64.7z ppsspp-v1.6.3-248-g098a7ffea-android.apk

this game use hundreds of bezier lines. like Acid 2 use hundreds of splines.

unknownbrackets commented 6 years ago

So there are two separate issues here - do they both happen only on Vulkan? Or does the mobile issue happen on OpenGL and Vulkan both, and the other issue happen only on Vulkan?

-[Unknown]

weihuoya commented 6 years ago

graphic glitches happen only on vulkan(PC and mobile).

car run under road test on mobile opengl backend, vulkan backend is not playable for graphic glitches.

xebra commented 6 years ago

We can avoid this bug(maybe second issue only) using the following fix.

StateMappingVulkan.cpp

key.depthClampEnable = gstate.isClippingEnabled() && gstate_c.Supports(GPU_SUPPORTS_DEPTH_CLAMP);

to

key.depthClampEnable = false;

Probably, the same issue as D3D11. D3D11: Specify DepthClipEnable = TRUE when creating rasterizer states… 480a05d

unknownbrackets commented 6 years ago

Hmm, but if the game specified that flag, it indicates to clamp depth to the [0, 65535] range. Maybe the flag is ignored when drawing beziers or something?

-[Unknown]

Leopard20 commented 6 years ago

Weird. I don't have this problem on my phone using Vulkan. Instead I get a weird "mirroring" effect when I enable "Hardware Tessellation". The game is not playable on Vulkan without this option. The opposite is true with OpenGL. If I enable this option the game becomes super slow! screenshot_2018-06-25-18-14-33-569_org ppsspp ppsspp

unknownbrackets commented 6 years ago

@leopard20 check the features tab in system information - your device may not even support depth clamping.

-[Unknown]

Leopard20 commented 6 years ago

Right. It doesn't!

weihuoya commented 6 years ago

unchecked simulate block transfer, the game is running smoother.

when use low spline/bezier curves quality, car run under road in some place. medium and high work fine.

xebra commented 6 years ago

Ah, low quality is not spline/bezier. It's just drawing control mesh(no curve tessellation/evaluation). So it's just specification(not bug). However I fixed it and I will commit later.

@unknownbrackets Vulkan depth clamp issue is related to Vulkan driver bug or unsupported feature maybe.

Anuskuss commented 6 years ago

I have experienced the same graphical issues on my machine on Vulkan. First on Linux (hinted in #10477) and now on Windows too.

Vulkan:

OpenGL:

As of 1.6.3-323 I can't start any game with Vulkan at all. My computer becomes unresponsive and after a few seconds I get:

Lost the Vulkan device! Try to continue?

ppsspplog.txt

unknownbrackets commented 6 years ago

Is v1.6.3-323-g945eab6fe the first build that stopped working? What's the last build that works?

Also - which positioning of the yellow is "correct"?

Can you try that same exact scene in the software renderer? It might be that we need to clamp depth at the fragment level to be correct (which is unfortunate.) It will help to know if the software renderer has the same glitch.

-[Unknown]

Anuskuss commented 6 years ago

Last good: v1.6.3-220-g309036069 First bad: v1.6.3-221-g06340bfa9

The front part of the car is missing, maybe that's easier to find?

Anuskuss commented 6 years ago

Before yellow roadblock (depth map)

OpenGL

before_ogl_depth

Vulkan

before_vk_depth

After

OpenGL

after_ogl_depth

Vulkan

after_vk_depth

unknownbrackets commented 6 years ago

I wonder if that error is caused by KhronosGroup/glslang#1418, if it's happening on PC.

What does depth look like using the software renderer? In theory, that's the correct depth.

-[Unknown]

Anuskuss commented 6 years ago

Before

before

After

after

unknownbrackets commented 6 years ago

Okay, then probably OpenGL is correct. Since it seems like it renders mostly right in the software renderer, can you try making a GE debugger dump?

To do this, open the game and select Debug -> GE debugger..., then when it's displaying the scene, press Record in the top right. After a second or so, it'll finish and save a trace of the drawing activity.

After that, check the memstick/PSP/SYSTEM/DUMP folder and it'll have created a file named something like "ULES12345_0000.ppdmp". You can zip that and then drag and drop it into a reply here.

I can even try running this on a real PSP to compare (that's still experimental, though.) Then I could see what depth /should/ be for sure.

-[Unknown]

Anuskuss commented 6 years ago

So I have to switch to Software Renderer, click Step Tex in the GE Debugger until the texture appears in the preview window, then Record and then Resume? UCES00019_0001.zip

unknownbrackets commented 6 years ago

Ah - unfortunately, that didn't capture anything.

It's probably fine to make the GE debugger dump using any backend. But something failed if it creates a 2KB file - this is the second time I've seen that now, there must be a bug causing it. But if you click do Record/Resume again, it should work after a couple tries at worst.

-[Unknown]

Anuskuss commented 6 years ago

Backend: Vulkan Software Renderer: off

Again, I waited for the yellow roadblock to appear in the texture preview, Record -> Resume. This time theres actually stuff in the file.

UCES00019_0001.zip

unknownbrackets commented 6 years ago

Hmm, it seems to heavily use minz/maxz and viewport z params. Maybe something isn't dirtying properly, or else there's somewhere we're handling these depth params wrong.

Most of the drawing is done with the viewport centered on the first 50% of depth (0 - 16383), and with a maxz of 16383.

-[Unknown]

Anuskuss commented 6 years ago

Do note that this is working fine with earlier builds. Last good: v1.5.4-189-gc1a23658d First bad: v1.5.4-197-gea50561c8

unknownbrackets commented 6 years ago

Right, so that points to depth clamping - #10454. But the question is, why. The PSP definitely clamps depth, but maybe we need to do it in the fragment shader for it to be accurate.

I think right now, we're deforming polygons when it clamps, perhaps, which is only okay in flat or mostly-flat cases.

-[Unknown]

unknownbrackets commented 5 years ago

How does this look with recent changes now?

-[Unknown]

weihuoya commented 5 years ago

test latest dev build, vulkan still have graphic issues.

use low spline/bezier curves quality, car run under road in some place, but not worse than before.

Anuskuss commented 5 years ago

Everything is fine for me again. I couldn't test it since the Lost the Vulkan device! error but as of v1.6.3-482-g025e478d2 (last bad: v1.6.3-479-g637a17a66) it's all working again and the graphics are correct.

hrydgard commented 5 years ago

I believe this is fixed, closing. Please reopen if not.

hrydgard commented 5 years ago

Apparently not, reopening.

hrydgard commented 5 years ago

Apparently still an issue, from Dakile on Discord, with GTX 980m:

https://cdn.discordapp.com/attachments/480103153803460614/551370781482024961/unknown.png

In the meantime, a workaround is to play using D3D9, for example.

unknownbrackets commented 5 years ago

I assume this is caused by #11399, and doesn't fall into the simple case 9859827 handles.

See here for a possible workaround (might break other games, I think I ran across one it would, but still might break less): https://github.com/hrydgard/ppsspp/issues/11399#issuecomment-423394932

-[Unknown]

ghost commented 3 years ago

Yeah this is still a thing even on the current git versions and the latest stable version. Tried out Pursuit Force Extreme Justice and the graphics are messed up all over the place. Playing with DX9 will make the game super slow for some reason (its because its falling back to software renderer).

unknownbrackets commented 3 years ago

A GE frame dump of an issue currently happening would be helpful. The previous frame dump still seems to work fine.

-[Unknown]

ghost commented 2 years ago

Vertex cache + HW Tessellation make this game faster on my phone R9 Mali-G52 GPU Screenshot_2021-09-23-00-49-29-607_org ppsspp ppsspp

Vertex cache and HW Tessellation is off Screenshot_2021-09-23-00-49-55-479_org ppsspp ppsspp

I also notice some rendering issue the road sometimes is flickering? Pursuit Force.ppdmp.zip

ghost commented 2 years ago

Can no longer reproduce my issue as I mentioned above maybe because of https://github.com/hrydgard/ppsspp/commit/16bf5197e4accf36f4e198a2b099985c0bbb3929?

Anuskuss commented 2 years ago

There are multiple issues in this thread:

  1. https://github.com/hrydgard/ppsspp/issues/11216#issue-335271262 (top): Spline/bezier curve quality set to Low / not a bug
  2. https://github.com/hrydgard/ppsspp/issues/11216#issue-335271262 (bottom): Probably related to #11399 / fixed by #14833
  3. https://github.com/hrydgard/ppsspp/issues/11216#issuecomment-399958757: Missing hardware feature / not a bug
  4. https://github.com/hrydgard/ppsspp/issues/11216#issuecomment-410902422 (top): Fixed as of v1.6.3-482-g025e478d2
  5. https://github.com/hrydgard/ppsspp/issues/11216#issuecomment-410902422 (bottom): Fixed as of v1.6.3-482-g025e478d2
  6. https://github.com/hrydgard/ppsspp/issues/11399#issuecomment-539200059: Fixed by #14833
  7. https://github.com/hrydgard/ppsspp/issues/11216#issuecomment-468913595: Probably missing hardware feature / not a bug
  8. https://github.com/hrydgard/ppsspp/issues/11216#issuecomment-925107278: Related to #11399 / fixed by #14833
unknownbrackets commented 2 years ago

https://cdn.discordapp.com/attachments/480103153803460614/551370781482024961/unknown.png seems like it was probably also the guardband issue.

But please note that the guardband fixes are NOT currently implemented for:

I think it's a bit early to fly the flag of victory.

-[Unknown]

Saramagrean commented 2 years ago

v1.12.3-232-gb6e7fe1aa still happen (All backends).

PF-E0 PF-E1

GE Dump. DUMP.zip

unknownbrackets commented 2 years ago

Right, that's #11399. As noted there, clamping against the wrong boundary is still not worked around.

-[Unknown]

Panderner commented 2 years ago

Desktop OpenGL is broken: PPSSPP v1 12 3-990-gb631ace6d - UCUS98703 _ Pursuit Force™_ Extreme Justice 3_16_2022 1_57_43 PM

Mobile OpenGL is ok: Screenshot_2022-03-16-13-55-42-956_org ppsspp ppsspp

jy95 commented 2 years ago

For me, OpenGL / Vulan / Direct3D 9 / Direct3D 11 are both broken on 1.13.1

ghost commented 2 years ago

@weihuoya what about this now.

flexxarnnn commented 2 years ago

I looked through previous versions of ppsspp and for me atleast the newest version to work right was ppsspp v1.11.3 when using the OpenGL renderer. image

jy95 commented 1 year ago

Confirmed - I tried on several versions but it only works on v1.1.3 with OpenGL renderer

unknownbrackets commented 1 year ago

16049 will make this work on most devices other than those using Mali GPUs.

-[Unknown]

Panderner commented 1 year ago

Still has issue: https://streamable.com/60wkiq

ghost commented 1 year ago

Still has issue: https://streamable.com/60wkiq

Can you upload your savestate in that area?

Panderner commented 1 year ago

Can you upload your savestate in that area?

At the beginning of Pursuit Force: Extreme Justice.

unknownbrackets commented 1 year ago

Thanks, I think I fixed the issue in the latest git - if not #16069 should mean less precision issues.

-[Unknown]

ghost commented 1 year ago

Confirm fixed via https://github.com/hrydgard/ppsspp/pull/16069/commits/f8d29fdc1a8b4b703ee9466e1127b9b571e4c64a Screenshot_2022-09-21-16-49-31-39

The performance is so slow...

hrydgard commented 1 year ago

@Gamemulatorer Did the performance slow down with the fix, or was it already slow?

ghost commented 1 year ago

@Gamemulatorer Did the performance slow down with the fix, or was it already slow?

It was already slow :( Maybe Snapdragon 450 is not good enough for this game. Screenshot_2022-09-21-17-02-45-19