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

Pursuit Force graphic issues #11216

Open
weihuoya opened this issue Jun 25, 2018 · 53 comments
Open

Pursuit Force graphic issues #11216

weihuoya opened this issue Jun 25, 2018 · 53 comments
Labels
Depth / Z Issue involves depth drawing parameters. Vulkan
Milestone

Comments

@weihuoya
Copy link
Contributor

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
Copy link
Collaborator

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
Copy link
Contributor Author

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
Copy link
Contributor

xebra commented Jun 25, 2018

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
Copy link
Collaborator

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
Copy link
Contributor

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
Copy link
Collaborator

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

-[Unknown]

@Leopard20
Copy link
Contributor

Right. It doesn't!

@weihuoya
Copy link
Contributor Author

weihuoya commented Jun 25, 2018

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
Copy link
Contributor

xebra commented Jun 25, 2018

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
Copy link
Contributor

Anuskuss commented Aug 7, 2018

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
Copy link
Collaborator

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
Copy link
Contributor

Anuskuss commented Aug 8, 2018

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
Copy link
Contributor

Anuskuss commented Aug 8, 2018

Before yellow roadblock (depth map)

OpenGL

before_ogl_depth

Vulkan

before_vk_depth

After

OpenGL

after_ogl_depth

Vulkan

after_vk_depth

@unknownbrackets
Copy link
Collaborator

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
Copy link
Contributor

Before

before

After

after

@unknownbrackets
Copy link
Collaborator

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
Copy link
Contributor

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
Copy link
Collaborator

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
Copy link
Contributor

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
Copy link
Collaborator

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]

@unknownbrackets unknownbrackets added the Depth / Z Issue involves depth drawing parameters. label Aug 13, 2018
@Anuskuss
Copy link
Contributor

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
Copy link
Collaborator

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
Copy link
Collaborator

How does this look with recent changes now?

-[Unknown]

@weihuoya
Copy link
Contributor Author

weihuoya commented Nov 7, 2018

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
Copy link
Contributor

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
Copy link
Owner

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

@hrydgard
Copy link
Owner

hrydgard commented Mar 2, 2019

Apparently not, reopening.

@hrydgard hrydgard modified the milestones: v1.10.0, Future Apr 26, 2020
@ghost
Copy link

ghost commented Apr 10, 2021

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
Copy link
Collaborator

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

-[Unknown]

@ghost
Copy link

ghost commented Sep 22, 2021

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
Copy link

ghost commented Oct 19, 2021

Can no longer reproduce my issue as I mentioned above maybe because of 16bf519?

@unknownbrackets
Copy link
Collaborator

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:

  • Some macOS / iOS devices
  • Phones with Mali GPUs (not an insignificant number of devices)
  • Probably Raspberry Pis, but not verified

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

-[Unknown]

@Saramagrean
Copy link
Contributor

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

PF-E0
PF-E1

GE Dump.
DUMP.zip

@unknownbrackets
Copy link
Collaborator

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

-[Unknown]

@Panderner
Copy link
Contributor

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
Copy link

jy95 commented Aug 6, 2022

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

@ghost
Copy link

ghost commented Aug 7, 2022

@weihuoya what about this now.

@flexxarnnn
Copy link

flexxarnnn commented Sep 5, 2022

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
Copy link

jy95 commented Sep 14, 2022

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

unknownbrackets added a commit to unknownbrackets/ppsspp that referenced this issue Sep 18, 2022
Helps situations like hrydgard#11216, where only one side should be clamped.
Keeps depth clamp (i.e. hrydgard#7932) working.  See hrydgard#11399.
@unknownbrackets
Copy link
Collaborator

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

-[Unknown]

@Panderner
Copy link
Contributor

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

@ghost
Copy link

ghost commented Sep 20, 2022

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

Can you upload your savestate in that area?

@Panderner
Copy link
Contributor

Panderner commented Sep 20, 2022

Can you upload your savestate in that area?

At the beginning of Pursuit Force: Extreme Justice.

@unknownbrackets
Copy link
Collaborator

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

-[Unknown]

@ghost
Copy link

ghost commented Sep 21, 2022

Confirm fixed via f8d29fd
Screenshot_2022-09-21-16-49-31-39

The performance is so slow...

@hrydgard
Copy link
Owner

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

@ghost
Copy link

ghost commented Sep 21, 2022

@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

@hrydgard
Copy link
Owner

Alright, that's good to know.

Yeah the game makes extremely heavy use of tessellation for the road surface, which is not fast in PPSSPP unfortunately.

Probably need to take another look at figuring out a way to make hardware tessellation work better and go fast. Using compute shaders instead of the wacky instancing trick we're currently using might help. Maybe some dynamic detail adjustment, too.

@ghost
Copy link

ghost commented Sep 21, 2022

hardware tessellation makes this game a little faster in Vulkan.
Screenshot_2022-09-21-17-21-05-53

But in opengl this game is super lag if hardware tessellation is on.
Screenshot_2022-09-21-17-18-53-57
UCUS98703.ppdmp.zip

@unknownbrackets
Copy link
Collaborator

Note for any Mali users looking at the above and confused why it's still happening for you: this is only fixed on devices that support a hardware feature called "clip distance", which some GPUs (i.e. Mali) don't.

-[Unknown]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Depth / Z Issue involves depth drawing parameters. Vulkan
Projects
None yet
Development

No branches or pull requests

10 participants