libretro / flycast

Flycast is a multiplatform Sega Dreamcast emulator. NOTE: No longer actively developed, use upstream repo for libretro from now on - https://github.com/flyinghead/flycast
http://reicast.com
GNU General Public License v2.0
155 stars 77 forks source link

Weird graphics glitch of Metal Slug 6 #956

Closed raidenii closed 3 years ago

raidenii commented 3 years ago

Hi,

I encounter weird graphics glitches on Odroid Go Advance running Flycast aarch64 in RA 1.9.0. The git rev is e17df44. Here are the screenshots: mslug6-200925-094346 mslug6-200925-094402 mslug6-200925-094441 mslug6-200925-094453 It starts to happen on the end of mission 3 every time.

Configs: System type: AW Resolution: 640x480 Alpha sorting: Per-triangle Midmapping: On Volume modifier: On DIV Matching: Auto Enable RTT: On RTT Upscaling: 1x Threaded Rendering: On Synchronous Rendering: On

I wonder if it's because of dynarec on aarch64? In the makefile these options were used:

else ifeq ($(platform), goadvance)
       EXT ?= so
       TARGET := $(TARGET_NAME)_libretro.$(EXT)
       SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
       fpic = -fPIC
       LIBS += -lrt
       CC_AS = $(CC)
       FORCE_GLES = 1
       SINGLE_PREC_FLAGS = 1
       HAVE_LTCG = 0
       HAVE_OPENMP = 1
       CFLAGS += -march=armv8-a+crc+simd -mtune=cortex-a35 -mcpu=cortex-a35 -O3 -pipe -fno-plt -fdata-sections -ffunction-sections -Wl,--gc-sections -fno-stack-protector -fno-ident -fomit-frame-pointer -fmerge-all-constants -fno-math-errno -Wl,--gc-sections -falign-functions=1 -falign-jumps=1 -falign-loops=1 -fno-unwind-tables -fno-asynchronous-unwind-tables -funroll-all-loops -fmerge-all-constants -frename-registers -funsafe-math-optimizations -ftree-vectorize
       CFLAGS += -DHOST_CPU=0x20000006 -DTARGET_LINUX_ARMv8 -frename-registers -ftree-vectorize
       CXXFLAGS += $(CFLAGS)
       ASFLAGS += $(CFLAGS) -c
       PLATFORM_EXT := unix
       WITH_DYNAREC = arm64
       HAVE_GENERIC_JIT = 0
       CORE_DEFINES += -DLOW_END -DLOW_RES
raidenii commented 3 years ago

Seems the issue is introduced by c2f7358. rev 0e10e86 works fine (but slow).

inactive123 commented 3 years ago

@raidenii Can you confirm if that commit actually caused a speedup or not on your system? If so, whats your GPU and OS?

raidenii commented 3 years ago

It does. On OGA it makes the game to run at 28-29 fps for most of the scenes (especially improved performance at mission starts and ends). The GPU is Mali-G31 MP2 and OS is RRVL (Void Linux, kernel 4.4.189-3).

Also the commit c2f7358 increased performance on PC as well - previously on mslug6's Mission 1 robot parade scene, if hitting the robots the sound will shutter badly, but that issue is gone after this commit. And it works perfectly fine on PC the whole time (no graphics glitches at mission 3/4), the glitch just happens on OGA.

raidenii commented 3 years ago

Is there any way I can gain additional logs to help debugging this?

raidenii commented 3 years ago

This seems to be fixed as of aba25cd.

barbudreadmon commented 3 years ago

hmmmm, should be totally unrelated though ? that commit is about controllers

raidenii commented 3 years ago

@barbudreadmon I think it's maybe flyinghead@953200b fixes that. Didn't do bisect though

barbudreadmon commented 3 years ago

@raidenii i didn't backport that commit yet though, are you sure you aren't using standalone flycast ?

raidenii commented 3 years ago

@barbudreadmon did a quick bisect and found it's commit 3bc4830 fixed the issue. And no, I'm 100% sure I'm not using standalone.