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

Condemned 2:Bloodshot is flickering #5495

Open
Realmantik opened this issue Jan 3, 2019 · 37 comments
Open

Condemned 2:Bloodshot is flickering #5495

Realmantik opened this issue Jan 3, 2019 · 37 comments
Assignees
Labels

Comments

@Realmantik
Copy link

RPCS3 v0.0.5-7645-a4f67ccb Alpha
CPU: AMD FX-6300 Six-Core Processor | 6 Threads | 7.96 GiB RAM | AVXx
GPU: AMD Radeon R7 265 running on driver 1.5.0

Game: Condemned 2:Bloodshot.
Graphics is flickering and audio is stuttering. Fps 20-40.

BLUS30115_20190103153538_capture.rrc.gz

RPCS3.log.gz

@legend800
Copy link

Put the name of the game in titles please.

@Xcedf
Copy link

Xcedf commented Jan 3, 2019

I can confirm this issue have the same Condemned 2 with the same id, always had this bug, but for some reason, now on current builds it flickering a lot less, previously it was kinda fine on PPU interperter fast and flickering as hell on LLVM, now LLVM kinda fine too but still happens rare.

@Realmantik Realmantik changed the title BLUS30115 is flickering Condemned 2:Bloodshot is flickering Jan 5, 2019
@NotEvenFlinched
Copy link

I think it is worthy to check this game on newest build, it could be fixed accidentally.

@AccountZeroName
Copy link

Yes, I hope they fix it.

@NotEvenFlinched
Copy link

NotEvenFlinched commented Mar 18, 2019

I never used rpcs3 before, but I will test Condemned 2 on latest version this weekend, because I have some interest to this game, original Condemned was very good btw.

@Realmantik
Copy link
Author

Still the same, audio is not properly playing because of my CPU.

@kd-11
Copy link
Contributor

kd-11 commented Jul 4, 2019

Is graphics flickering still an issue?

@Realmantik
Copy link
Author

Still an issue, but now main hero of the game has semi-transparent hands. Cpu blit or WCB does not help, it happens on Vulkan and OpenGL. Video(without semi-transparent hands): https://drive.google.com/open?id=1rmfr81GhNNU_9obyB2cjUdI87RNdnhFs

@Realmantik
Copy link
Author

Semi-transparent hands are gone and currently i am able to capture render data using RenderDoc. So couple of files that shows the problem in this game is here and here (i've bookmarked interesting drawcalls):

@Zangetsu38
Copy link
Contributor

lkast time tested not have see fdlickering , is fixed old time for me, but i remember i continue get smal flash white, like gow 3

@Realmantik
Copy link
Author

@Zangetsu38 , Do you have processor like i7-8700K, i9-9900K or similar intel?

@NEXAnomaly
Copy link

I want to confirm the graphics flickering is still happening. Changing PPU Decoder to interpreter (both Fast and Precise) fixes it but reduces FPS from full speed to around 15-20fps. I have an AMD Ryzen 7 1700 3.0Ghz and happy to test things out as I'd be psyched to play it properly.

@fgRuslan
Copy link

fgRuslan commented Nov 16, 2019

I want to confirm the graphics flickering is still happening. Changing PPU Decoder to interpreter (both Fast and Precise) fixes it but reduces FPS from full speed to around 15-20fps. I have an AMD Ryzen 7 1700 3.0Ghz and happy to test things out as I'd be psyched to play it properly.

Can you reply to me if you find a way to optimize the game so it is playable? Please! As I have FX-6300 CPU, an optimized game is really important to me.

@Asinin3
Copy link
Contributor

Asinin3 commented Nov 16, 2019

@fgRuslan Use our discord server for that, this is an issue tracker. https://discord.me/rpcs3 Your CPU doesn't meet recommended requirements though.. So you're going to have problems with anything intensive.

@digitaldude555
Copy link

Still an an issue.

@SmokeyMcGames
Copy link

SmokeyMcGames commented Feb 9, 2021

It seems the flickering keeps the shader cache building constantly like it's looping.
The hands are still an issue as well.

This game is frame locked to 40 by default with an autoexec config file in the game folder. Change this value to unlock the frame rate.

This is on .14-11725 Vulkan
https://streamable.com/m3vk07

@boomercore
Copy link

Ongoing issue.

@bujinkanrn
Copy link

Transparent hands and color-flickering graphics still an issue with latest build.

@Sh087
Copy link

Sh087 commented May 24, 2021

Still present on 0.0.16-12301

@sergeymild
Copy link

sergeymild commented Aug 12, 2021

still flickering on 0.0.17-12624. is there some possibility to fix it?. I really want to play(((

@fgRuslan
Copy link

still flickering on 0.0.17-12624. is there some possibility to fix it?. I really want to play(((

Me too :( I heard that Xenia (Xbox360 emulator) plays Condemned 2 normally, but I tried on Vulkan and it had problems with rendering. However, I heard that if you set the DirectX 12 mode in Xenia, everything will be fine

@kd-11 kd-11 self-assigned this Sep 8, 2021
@kd-11 kd-11 added In Progress This issue is actively being investigated at the moment. Bug RSX labels Sep 9, 2021
@kd-11
Copy link
Contributor

kd-11 commented Sep 10, 2021

This seems to be a problem with the game itself, its leaving some random texturing bits active which will generate different shaders each time. The best I can do is try to find a way to make it not flicker when using single threaded shader compilation (legacy)

@SolomonGrundyThanksForTheTurkey

Hopefully there’s a solution found soon.

I’ve been dying to play this game for years now. The first is an absolute classic.

@kd-11 kd-11 removed RSX In Progress This issue is actively being investigated at the moment. labels Sep 12, 2021
@kd-11 kd-11 added CPU and removed CPU labels Sep 12, 2021
@kd-11
Copy link
Contributor

kd-11 commented Sep 12, 2021

After looking at this for a while, I now understand why it is flickering. Unfortunately, RSX rendering has nothing to do with the underlying cause here.

There are 2 types of flicker I found:

  1. Motion blur filter incorrectly applied to surfaces.
  2. Red/green artifact flashing.

For the second type (the most distracting and easiest to catch with tracing tools) I found it happens because of a shader swap. The game has some other shader that is loaded sometimes instead of the correct one.
It is the same bad shader each time, even if you reboot the game, so this is not a case of memory being corrupt. It seems to be a valid shader just loaded to the wrong place.
I also isolated it to a situation where the right shader is used before and after the affected draw calls. This is also not a race condition - the bad shader is there even if you wait forever.
It is however related to performance, i.e the graphics are mostly stable when using PPU interpreter (though still not perfect) and worst with PPU LLVM. Of course performance is very poor using interpreters.
Other notes:

  1. The game definitely thinks the correct shader is loaded at the memory address. I can verify this by inspecting other changes around the binding to show it is expecting textures and also matches the shader structure (register allocations, etc) of the correct shader.
  2. The game does not have proper shader allocation. Each 'shader' is being allocated in a ring buffer with a page alignment. All the addresses of all shaders are 4096 bytes apart.
  3. The game does not have any sort of feedback with RSX, it does not sample the framebuffer, nor does it use ZCULL query data.
  4. It can be proven that the fragment shader is the wrong one, since the previous calls use the same vertex program as the bad draws, but their fragment stage interprets the shaders completely differently (wrongly in fact).
  5. The shader transfer is done purely in CELL code, RSX is not involved here. The ring buffer corrupts at specific offsets as well, which to me sounds like some broken math in the game itself. It is likely that rpcs3 returns addresses that are not exactly what was expected with PS3 and this fucks up the game's logic somehow.

With that, I'll have to stop there for now especially since I don't know which part of the system is having issues and it seems to be some broken game logic outside the rendering pipeline for now. I will revisit at a later date.

@SolomonGrundyThanksForTheTurkey
Copy link

SolomonGrundyThanksForTheTurkey commented Oct 10, 2021

Tested on most recent build (0.0.18-12878-479150b2 Alpha)

The game flickers (still, no surprise) but now it freezes and often causes RPCS3 to force close - and NOT create a log report.

The Freeze seems to be easily replicated when toggling the flashlight on for the first time.

this is the only information I can offer at this time, because a log will not generate:

S RSX: Program compiled successfully x130
E RSX: ERROR: 0:268: 'textureProj' : no matching overloaded function found
ERROR: 0:268: 'process_texel' : no matching overloaded function found
ERROR: 0:268: 'assign' : cannot convert from ' const float' to ' temp highp 4-component vector of float'
ERROR: 0:268: '' : compilation terminated
ERROR: 4 compilation errors. No code generated.

E RSX:
F SIG: Thread terminated due to fatal error: Failed to compile fragment shader
(in file D:\a\1\s\rpcs3\Emu\RSX\VK\VKProgramPipeline.cpp:29[:25], in function compile) (e=0x0000007e[126])

Attached is a screenshot of the game frozen - closing the condemned 2 window also forces RPCS3 to close without warning and does NOT create a log after closing.

Capture

@kd-11
Copy link
Contributor

kd-11 commented Oct 11, 2021

Provide a log.
EDIT: If you cannot get a log normally, set your log window to capture notice level and then paste the output in gist or some other external location. Otherwise that single line isn't much to go on.

@SolomonGrundyThanksForTheTurkey

Okay, I will provide a log using your method in a few minutes.

@kd-11
Copy link
Contributor

kd-11 commented Oct 11, 2021

This is a symptom of the previously discovered problem. Basically, we have a texture with the cubemap flag set that is used in a shader for a tex instruction that has the projective operation enabled. This is an impossible combination.
My thinking is that we're supposed to clear memory to 0s somewhere and we fail to do so, or the game is truly broken and works by pure chance.

@kd-11
Copy link
Contributor

kd-11 commented Oct 12, 2021

#10993 should allow the game to run with the broken shaders again. I'll have to run some tests on real hardware to determine what is supposed to happen when a game messes up texture modes like this. It may be a clue to what is causing the flickering.

@SolomonGrundyThanksForTheTurkey

Sorry, I wasn’t able to provide a log - I had to deal with some real world situations. But, I’m happy to see some progress!

As always, the work you guys all do kicks so much ass.

I have supreme faith that you will figure this out.

@kd-11
Copy link
Contributor

kd-11 commented Oct 6, 2022

This is fixed by #12762
There is some minor glitching while shaders are compiling but that is expected.
The previous investigation was correct, the wrong shaders were being used, but this is a bug in RSX afterall. The RSX shaders were picked correctly, but the backend shaders were wrong because previous shaders sometimes would get incorrectly loaded for a next draw due to a bug.
Fixing this also solves the crashes as the shader mismatch was causing all kinds of problems to show up.

@kd-11 kd-11 added the RSX label Oct 6, 2022
@Realmantik
Copy link
Author

Realmantik commented Oct 6, 2022

I tried version v0.0.24-55d1b466 Alpha | pull/12762, but the problems are still the same
RPCS3.log.zip

@kd-11
Copy link
Contributor

kd-11 commented Oct 6, 2022

Try using default settings + legacy compiler. You can toss in accurate rsx reservations + fifo atomic.
I am not able to reproduce the glitching any more. I can trigger it easily with crashes on master. If it's still not fixed I'm out of ideas and ways to repro/test.

@kd-11
Copy link
Contributor

kd-11 commented Oct 7, 2022

Removed from PR desc.

@kd-11 kd-11 removed the RSX label Oct 7, 2022
@boomercore
Copy link

Ongoing in 0.0.26-14637, Vulkan, defaults + legacy + atomic + accurate RSX. 3060, Win10, Nvidia 528.24.

@LeRutY
Copy link

LeRutY commented Jun 10, 2023

Still an issue. i7 7700K, GTX 1080, Windows 10 22H2

@kd-11
Copy link
Contributor

kd-11 commented Dec 23, 2023

Still happens. Another one for the software renderer bin.

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

No branches or pull requests