PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
GNU General Public License v3.0
11.85k stars 1.63k forks source link

Battlefield 2 - Modern combat 2 - 2e Flickering bug (v1.7.3998) #8870

Closed IamLupo closed 1 year ago

IamLupo commented 1 year ago

Describe the Bug

The bug consist of heavy flickering graphics issues that happends for Battlefield 2 Modern Combat in multiplayer mode. This starts to happen for any hardware as renderer. Software renderer does work correctly without flickering! Our discord community all confirms they experience the same issue thats why i jumped in for investigation and a solution.

The flickering issues I manage to track down by testing version 1.7.3997 that has not the flickering issue. The version v1.7.3998 has the flickering issue. By checking the version v1.7.3998 we can find the following pull https://github.com/PCSX2/pcsx2/pull/7990.

My investigation started to reverse the code changes line by line , until i stumbled to the code that started to cause to the problem. (GSRendererHW.cpp line 224-226). You see that the code:

m_tc->IncAge();

Got switched to the top before GSRenderer::VSync got executed. I basically switch it back to the bottom and this caused that the game didn't have the heavy flickering anymore.

I messaged on the pull and @refractionpcsx2 responded that this is better be solved by GSDump then a reverse of this code change.

Reproduction Steps

Once you joined the game the flickering starts happening.

Expected Behavior

No response

PCSX2 Revision

v1.7.3998

Operating System

Windows 10 (64bit)

If Linux - Specify Distro

No response

CPU

AMD Ryzen 9 5900X

GPU

RTX 3080

GS Settings

SLUS-21026:
  name: "Battlefield 2 - Modern Combat"
  region: "NTSC-U"
  compat: 5
  gsHWFixes:
    autoFlush: 1 # Post-processing.
    halfPixelOffset: 2 # Offset post-processing.
    texturePreloading: 1 # Spikes all over the place otherwise.
    textureInsideRT: 1 # Fixes light shinging through objects.
    cpuCLUTRender: 1 # Fixes light shining through objects.
    getSkipCount: "GSC_Battlefield2" # Depth clear.
    beforeDraw: "OI_Battlefield2" # Framebuffer copy, fixes rendering for bottom part of screen.

Keep in mind the 1e Flickering bug i fixed already with the "bool GSHwHack::OI_Battlefield2MP" patch.

Emulation Settings

settings

GS Window Screenshots

InGame You cant see the flickering in the screenshot. On the top he has drawn the correct way it should be. Its basically drawing not the full screen. Because of this The skybox is heavily glitching and is not even full rendered. Until half the screen. If i look into the direction of the sun it is even really heavily flickering.

Logs & Dumps

Battlefield 2 - Modern Combat_SLUS-21026_20230517133523

GSdump: Battlefield 2 - Modern Combat_SLUS-21026_20230517133523.gs.zst

refractionpcsx2 commented 1 year ago

can you keep it to one issue please? thanks #8869

IamLupo commented 1 year ago

can you keep it to one issue please? thanks #8869

Its two seprated issues in different versions ;) I provided a lot of details about the case. The first Flicker case i practicly already solved,.. i hope you guys gonna implement it. This 2e flicker case i am not sure because you advices me to provide a GSDump.

refractionpcsx2 commented 1 year ago

Its two seprated issues in different versions ;)

They are both the US version. What do you mean different versions?

IamLupo commented 1 year ago

Its two seprated issues in different versions ;)

They are both the US version. What do you mean different versions?

I practicly show you the code where the issue lies,... please read it before judging...

refractionpcsx2 commented 1 year ago

I don't think it really matters if it's from different areas of the code, it's still a flickering bug in multiplayer. But uh, whatever, if it makes you feel better, I'll reopen it.

stenzek commented 1 year ago

Duplicate of #8869.