Skip to content

Skip PromoteFormatToDepth in the case of a dummy image #2818

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

Closed

Conversation

kalaposfos13
Copy link
Member

@kalaposfos13 kalaposfos13 commented Apr 20, 2025

Attempts to solve some cases of the PromoteFormatToDepth unreachable, by not calling the function if the image is a dummy 1x1 image, and in those cases, the format is also set to be eD32Sfloat, so it is a valid depth image.
Also adds more debug info in case of a failure

@Graubek
Copy link

Graubek commented Apr 20, 2025

InFamous Second Son goes a little further but crashes on

[Debug] <Critical> ir_emitter.cpp:878 Unpack2x16: Unreachable code!
Unsupported 2x16 number format: SnormNz

shad_log.txt

@GHU7924
Copy link

GHU7924 commented Apr 20, 2025

I'll add a bit to Graubek's comment. inFAMOUS™ Second Son has errors:

Main

[Debug] liverpool_to_vk.h:109 PromoteFormatToDepth: Unreachable code!
Unexpected depth format R8G8B8A8Unorm

PR

[Debug] ir_emitter.cpp:878 Unpack2x16: Unreachable code!
Unsupported 2x16 number format: SnormNz

inFAMOUS™ First Light the same error in Main (I mean the error that appears in this PR).

@RainKikyou
Copy link

DOA6 CUSA12153
image

@squidbus
Copy link
Collaborator

I don’t think this approach as is will pass validation for what it’s worth, since by skipping the promote you are still using a shader with instruction that requires a depth image with a non-depth image. So you may see issues depending on what driver is being used.

@AboMedoz
Copy link
Contributor

AboMedoz commented May 1, 2025

InFAMOUS goes ingame now here
@Graubek @GHU7924

@Graubek
Copy link

Graubek commented May 1, 2025

Second Son is in ingame
obraz
obraz

@GHU7924
Copy link

GHU7924 commented May 1, 2025

@kalaposfos13 @AboMedoz

Build - ca287e4

Unfortunately, these games still don't work for me. I've launched them several times.
There is progress, this PR does remove the PromoteFormatToDepth error, but I always get an error that is apparently not related to this PR.

Basically the error is this (inFAMOUS™ First Light):

[Debug] vk_presenter.cpp:628 operator(): Assertion Failed!
Device lost during waiting for a frame

CUSA00897.log

There was a similar error, but it seems to have only occurred once:

[Debug] vk_scheduler.cpp:158 operator(): Assertion Failed!
Device lost during submit

CUSA00897 (2).log

A menu appeared where they suggested pressing "X" to continue, but almost immediately the emulator closed with the above-mentioned first error.

inFAMOUS™ Second Son has the same error, but I don't get to the menu and everything breaks after the splash screen.

CUSA00004.log

P.S. Since the error has changed, it means the PR is working correctly.

@kalaposfos13 kalaposfos13 force-pushed the dont-promote-format-to-depth branch from b6ce027 to 8ccd1cc Compare May 2, 2025 08:32
@GHU7924
Copy link

GHU7924 commented May 2, 2025

Build - 8842c59

inFAMOUS™ First Light & inFAMOUS™ Second Son now have another error:

[Debug] vk_presenter.cpp:646 operator(): Assertion Failed!
Device lost during waiting for a frame

If I remember correctly, error Device lost during waiting for a frame occurs only on video cards from Nvidia.

@GHU7924
Copy link

GHU7924 commented May 3, 2025

Today I tested inFAMOUS™ First Light on build 8842c59 (Linux-Qt) on Steam Deck.

The game didn't start the first time. After the splash screen, as soon as the menu appeared, the screen turned off, then turned on, then Steam Deck froze. I tried quickly pressing the X button on the third launch to get into the game, but it didn't work. On the fourth launch, I got into the menu, watched the first gameplay video, but I wasn't allowed into the game.

20250503152217_1
20250503152259_1
20250503152454_1

After "getting into the game", the emulator closed.
Also, an error was displayed in the log:

[Debug] <Critical> liverpool.h:113 SearchBinaryInfo: Unreachable code! Shader binary info not found.

I want to say that in Linux with this PR we are going further than before.

@AboMedoz
Copy link
Contributor

AboMedoz commented May 3, 2025

Build - 8842c59

inFAMOUS™ First Light & inFAMOUS™ Second Son now have another error:

[Debug] vk_presenter.cpp:646 operator(): Assertion Failed!
Device lost during waiting for a frame

If I remember correctly, error Device lost during waiting for a frame occurs only on video cards from Nvidia.

i really don't think so i myself have 2 Nvidia Cards which both work on it may be your gpu specifically what do you have ?

@GHU7924
Copy link

GHU7924 commented May 3, 2025

i really don't think so i myself have 2 Nvidia Cards which both work on it may be your gpu specifically what do you have ?

Computer specifications: Intel i5-8600k (Stock) - 32 Gb RAM - RTX 3070 8Gb

000897

Then maybe it's because the processor is Intel?
We have issue 1594 (related to Bloodborne ) which Missake212 reported as likely CPU related, so could it be something similar here? Say CPU not processing data correctly or something, but I can't say for sure as I don't know.

@AboMedoz
Copy link
Contributor

AboMedoz commented May 3, 2025

i really don't think so i myself have 2 Nvidia Cards which both work on it may be your gpu specifically what do you have ?

Computer specifications: Intel i5-8600k (Stock) - 32 Gb RAM - RTX 3070 8Gb

000897

Then maybe it's because the processor is Intel? We have issue 1594 (related to Bloodborne ) which Missake212 reported as likely CPU related, so could it be something similar here? Say CPU not processing data correctly or something, but I can't say for sure as I don't know.

intel can do some problems in InFAMOUS but only if Second Son is 1.00 it will throw invalid PM4 Type 2 but in general yeah having AMD is pretty much the safe side

@GHU7924
Copy link

GHU7924 commented May 6, 2025

@AboMedoz It's all about the video card.

I decided to continue testing.
Today I updated the drivers for the video card. I installed the latest ones at the moment (ver. 576.28 - Apr 30, 2025). I also enabled MSI Afterburner monitoring.

inFAMOUS™ First Light

The situation is such that in the menu, when you are asked to press "X", the GPU load increases sharply and reaches 100%.
Sometimes it happens that the menu does not load, although there are sounds, but the image is completely black, instead of a picture.

If I run the emulator and quickly press "X", then, like on Steam Deck, I can go through the menu and "get into the game", I can see the first video, the GPU load is normalized at this point and everything is going well.

Снимок экрана 2025-05-06 172148

Снимок экрана 2025-05-06 202133

Then the second video should start, which lasts about 1 minute and 30 seconds, then the gameplay should start, but all I see on the screen instead of this video is an incomprehensible ripple, although the beginning of the video is there, but everything stops working after the phrase about Seattle, there are no further phrases, but I know that the video should have continued.

Снимок экрана 2025-05-06 175132

Снимок экрана 2025-05-06 202524

Apparently the second video is related to the PM4 error that occurs in the game version 1.00 that you mentioned, but I could be wrong.

inFAMOUS™ Second Son

After the splash screen, loading begins (on which an error used to appear), but now there is no error, but during loading the video card is loaded at 100%, FPS drops to 1, but after some time we get to the menu, launch the game and the video starts, the game really gets to the gameplay.

Снимок экрана 2025-05-06 182613

These are the results I got from my latest testing. In general, I don't know why such a sharp load on the video card occurs in both cases.

P.S. So I think that inFAMOUS™ First Light should also reach the gameplay, but apparently something breaks during the video playback.

@AboMedoz
Copy link
Contributor

AboMedoz commented May 6, 2025

@AboMedoz It's all about the video card.

I decided to continue testing.
Today I updated the drivers for the video card. I installed the latest ones at the moment (ver. 576.28 - Apr 30, 2025). I also enabled MSI Afterburner monitoring.

inFAMOUS™ First Light

The situation is such that in the menu, when you are asked to press "X", the GPU load increases sharply and reaches 100%.
Sometimes it happens that the menu does not load, although there are sounds, but the image is completely black, instead of a picture.

If I run the emulator and quickly press "X", then, like on Steam Deck, I can go through the menu and "get into the game", I can see the first video, the GPU load is normalized at this point and everything is going well.

Снимок экрана 2025-05-06 172148

Снимок экрана 2025-05-06 202133

Then the second video should start, which lasts about 1 minute and 30 seconds, then the gameplay should start, but all I see on the screen instead of this video is an incomprehensible ripple, although the beginning of the video is there, but everything stops working after the phrase about Seattle, there are no further phrases, but I know that the video should have continued.

Снимок экрана 2025-05-06 175132

Снимок экрана 2025-05-06 202524

Apparently the second video is related to the PM4 error that occurs in the game version 1.00 that you mentioned, but I could be wrong.

inFAMOUS™ Second Son

After the splash screen, loading begins (on which an error used to appear), but now there is no error, but during loading the video card is loaded at 100%, FPS drops to 1, but after some time we get to the menu, launch the game and the video starts, the game really gets to the gameplay.

Снимок экрана 2025-05-06 182613

These are the results I got from my latest testing. In general, I don't know why such a sharp load on the video card occurs in both cases.

P.S. So I think that inFAMOUS™ First Light should also reach the gameplay, but apparently something breaks during the video playback.

First Light does go to gameplay try importing a save file then try again

@GHU7924
Copy link

GHU7924 commented May 6, 2025

First Light does go to gameplay try importing a save file then try again

I'm more interested in the progress of the emulator itself as is, rather than finding ways to make this or that game work, so i won't try other saves. I trust you that the game works, but in my case it works exactly like this, if you start a new game. I only showed the result that I got when testing this PR. I indicated the moment when it stopped working correctly for me.

Usually for testing I start a new game anyway to see if any regressions have occurred. In any case, progress is visible, but there is still a lot of work to do to reach the functionality that Bloodborne has.

@AboMedoz
Copy link
Contributor

AboMedoz commented May 6, 2025

First Light does go to gameplay try importing a save file then try again

I'm more interested in the progress of the emulator itself as is, rather than finding ways to make this or that game work, so i won't try other saves. I trust you that the game works, but in my case it works exactly like this, if you start a new game. I only showed the result that I got when testing this PR. I indicated the moment when it stopped working correctly for me.

Usually for testing I start a new game anyway to see if any regressions have occurred. In any case, progress is visible, but there is still a lot of work to do to reach the functionality that Bloodborne has.

valid and respectable, i respect your values i will test without save soon and try to find the error, but later

@AboMedoz
Copy link
Contributor

AboMedoz commented May 8, 2025

@Graubek test infamous now you should get a huge performance boost

@GHU7924
Copy link

GHU7924 commented May 8, 2025

It looks like the error below was caused by buggy Nvidia drivers. I wanted to quickly test the updated commit, but I couldn't do it, I was literally haunted by this error:

[Debug] <Critical> vk_presenter.cpp:646 operator(): Assertion Failed!
Device lost during waiting for a frame

I thought that either these were some new Windows 11 24H2 jokes, or it was worth trying to reinstall the video card drivers again. I chose the second option and did a radical rollback, chose version 566.36 (Dec 05, 2024) for installation, which was before the introduction of the 50 series of video cards. And it helped.

inFAMOUS™ First Light

There is a performance increase, you can even see it in the menu:

FL

I didn't take exact measurements, but after some time in the menu (to detect a device error, which wasn't there this time), the video card load started to reach 100% again, although before that it was about 30%. Here's a screenshot after about 7 minutes in the menu. I still haven't figured out what's causing this.

Снимок экрана 2025-05-08 230728

Everything in the game remains the same:

2025-05-08.21-10-18.mp4

I don't know why instead of gameplay I see strange ripples. Maybe the Intel + Nvidia bundle is to blame.

--

inFAMOUS™ Second Son

2025-05-08.22-06-18.mp4

Due to buggy drivers at this point I always got the error:

[Debug] <Critical> vk_presenter.cpp:646 operator(): Assertion Failed!
Device lost during waiting for a frame

After replacing the driver, the error went away. There is a load during loading, which sags the performance. But now when entering the game, the FPS has really increased significantly.

Снимок экрана 2025-05-08 223750

Снимок экрана 2025-05-08 223100

On my PC the result is this: it was 10 fps, now it’s 45-50.

Literally such progress in one day, it's really great)) A deep bow to those who identified the problems and who worked their magic on optimization.

@AboMedoz
Copy link
Contributor

AboMedoz commented May 8, 2025

It looks like the error below was caused by buggy Nvidia drivers. I wanted to quickly test the updated commit, but I couldn't do it, I was literally haunted by this error:

[Debug] <Critical> vk_presenter.cpp:646 operator(): Assertion Failed! Device lost during waiting for a frame

I thought that either these were some new Windows 11 24H2 jokes, or it was worth trying to reinstall the video card drivers again. I chose the second option and did a radical rollback, chose version 566.36 (Dec 05, 2024) for installation, which was before the introduction of the 50 series of video cards. And it helped.

inFAMOUS™ First Light

There is a performance increase, you can even see it in the menu:

FL

I didn't take exact measurements, but after some time in the menu (to detect a device error, which wasn't there this time), the video card load started to reach 100% again, although before that it was about 30%. Here's a screenshot after about 7 minutes in the menu. I still haven't figured out what's causing this.

Снимок экрана 2025-05-08 230728

Everything in the game remains the same:

2025-05-08.21-10-18.mp4
I don't know why instead of gameplay I see strange ripples. Maybe the Intel + Nvidia bundle is to blame.

--

inFAMOUS™ Second Son

2025-05-08.22-06-18.mp4
Due to buggy drivers at this point I always got the error:

[Debug] <Critical> vk_presenter.cpp:646 operator(): Assertion Failed! Device lost during waiting for a frame

After replacing the driver, the error went away. There is a load during loading, which sags the performance. But now when entering the game, the FPS has really increased significantly.

Снимок экрана 2025-05-08 223750

Снимок экрана 2025-05-08 223100

On my PC the result is this: it was 10 fps, now it’s 45-50.

Literally such progress in one day, it's really great)) A deep bow to those who identified the problems and who worked their magic on optimization.

yes i pinged to test because of performance pr got merged today

@GHU7924
Copy link

GHU7924 commented May 8, 2025

yes i pinged to test because of performance pr got merged today

Yes, I saw PR 2888.


I also tested the new commit on Steam Deck. (Build 1670fdd)

inFAMOUS™ First Light

Here is a similar behavior when I had an error Device lost during waiting for a frame on my PC.

If I don't press the "x" button several times quickly, a menu will appear from which, one might say, the emulator will immediately close. There were no errors in the log.

If I do a trick to quickly enter the game, after the first introductory video, the emulator also breaks. The error in the log is the same as when I first tested the game on Steam Deck:

[Debug] <Critical> liverpool.h:113 SearchBinaryInfo: Unreachable code!
Shader binary info not found.

Instead of gameplay, there is an incomprehensible ripple that I showed when testing the game on PC and Steam Deck last time.


inFAMOUS™ Second Son

This is my first time testing this game on Steam Deck. There is also similar behavior here where I got the error
Device lost while waiting for frame on my PC. During loading the emulator closes and there are no errors in the log.

I mean this moment (Loading):
Снимок экрана 2025-05-08 223750

P.S. If Steam Deck has the same behavior in both games as Error Device lost during waiting for a frame on my PC, then that error is most likely a reaction to something. Let me remind you that Steam Deck is a completely AMD device. I won't guess what exactly might be wrong, I hope someone will identify the problem or limitations, if they really exist.

@kalaposfos13
Copy link
Member Author

Superseded by #2892.

@kalaposfos13 kalaposfos13 deleted the dont-promote-format-to-depth branch May 29, 2025 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants