hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.11k stars 2.16k forks source link

Kurohyou series clip loosen after certain circumstances (now: graphical errors after fights) #15956

Open lim2222 opened 2 years ago

lim2222 commented 2 years ago

Game or games this happens in

NPJH-50333,NPJH-50562

What area of the game

After mini game,cutscenes.

What happens

https://user-images.githubusercontent.com/35925370/188294398-46c01c00-6942-4cba-a5a6-ba6468890d1e.mp4

What should happen

https://user-images.githubusercontent.com/35925370/188294415-db61e99e-25c7-40fc-84ed-6d0a460822a1.mp4

GE frame capture

No response

Platform

Android

Mobile phone model or graphics card

Mi10t pro android 10

PPSSPP version affected

ppsspp-v1.13.1-475-g853a2df06-android.apk

Last working version

ppsspp-v1.13.1-471-g67c911d13-android.apk

Graphics backend (3D API)

Vulkan

Checklist

unknownbrackets commented 2 years ago

Thanks for narrowing it down - that points at #15892.

I suspect this is some subtle case in format/stride matching...

-[Unknown]

lim2222 commented 2 years ago

v1.13.2-1293-g7a4830ed4 fixed the after mini game and cutscenes flickering issue, however when screen recording flickering still there.

hrydgard commented 2 years ago

How are things now? And what method of screen recording?

lim2222 commented 2 years ago

With MIUI 12 internal screen recorder,that not a big deal only flickering during screen record,ingame play will not happen:⁠-⁠D. There is new issue of NPJH-50333 that with vulkan renderer winning a fight will crash.

lim2222 commented 2 years ago

Crash as video shown https://youtu.be/yYC47kPN1r4

hrydgard commented 1 year ago

Still crashes in the latest builds?

lim2222 commented 1 year ago

Yes,crash during the last punch/kick.

hrydgard commented 1 year ago

Ok, thanks for testing..

hrydgard commented 1 year ago

Could you test some old versions to try to figure out about at which version number it started crashing?

Or get some ADB logs?

lim2222 commented 1 year ago

v1.13.2-1214-ge6db0bef2 start crashing. Sorry that my pc broken at the moment can't do adb log,this is the crash log generated by my phone may be useful


Build fingerprint: 'Xiaomi/apollopro_global/apollo:10/QKQ1.200419.002/V12.0.11.0.QJDMIXM:user/release-keys' Revision: '0' ABI: 'arm64' Timestamp: 2022-11-24 10:36:49+0800 pid: 5185, tid: 5406, name: RenderMan >>> org.ppsspp.ppsspp <<< uid: 10673 signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xec Cause: null pointer dereference x0 00000071e8d49178 x1 0000000000000000 x2 0000000000000002 x3 00000000ffffffb5 x4 0000000000000001 x5 0000000000000000 x6 0000000000000000 x7 0000000000000001 x8 0000000000000001 x9 000000716668b318 x10 0000000000000002 x11 00000000fffffe24 x12 0000000000000001 x13 0000000000000002 x14 0000000000200000 x15 0000000000000000 x16 00000072782158f8 x17 0000007278206c60 x18 000000716af2a000 x19 000000716668b310 x20 00000071e922fd50 x21 0000000000000001 x22 0000000000000001 x23 000000718e0d0084 x24 0000000000000000 x25 00000071e922fd50 x26 0000000000000000 x27 0000000000000048 x28 00000071e9217698 x29 000000716b81e750 sp 000000716b81e530 lr 00000071e9293080 pc 00000071798d00ac

backtrace:

00 pc 000000000017f0ac /vendor/lib64/hw/vulkan.kona.so (qglinternal::vkCreateFramebuffer(VkDevice_T, VkFramebufferCreateInfo const, VkAllocationCallbacks const*, VkFramebuffer_T**)+1676) (BuildId: d9ae83e3b2710252b7e131577d625059)

  #01 pc 00000000007324f0  /data/app/org.ppsspp.ppsspp-0Qy6kFFIWmJ8xS16afEyMw==/lib/arm64/libppsspp_jni.so (VKRFramebuffer::Get(VKRRenderPass*, RenderPassType)+200) (BuildId: 535721a90eaff3e84768f7d414cf26620116d509)
  #02 pc 000000000073dffc  /data/app/org.ppsspp.ppsspp-0Qy6kFFIWmJ8xS16afEyMw==/lib/arm64/libppsspp_jni.so (VulkanQueueRunner::PerformBindFramebufferAsRenderTarget(VKRStep const&, VkCommandBuffer_T*)+176) (BuildId: 535721a90eaff3e84768f7d414cf26620116d509)
  #03 pc 000000000073b5c4  /data/app/org.ppsspp.ppsspp-0Qy6kFFIWmJ8xS16afEyMw==/lib/arm64/libppsspp_jni.so (VulkanQueueRunner::PerformRenderPass(VKRStep const&, VkCommandBuffer_T*)+524) (BuildId: 535721a90eaff3e84768f7d414cf26620116d509)
  #04 pc 000000000073b0e0  /data/app/org.ppsspp.ppsspp-0Qy6kFFIWmJ8xS16afEyMw==/lib/arm64/libppsspp_jni.so (VulkanQueueRunner::RunSteps(std::__ndk1::vector<VKRStep*, std::__ndk1::allocator<VKRStep*>>&, FrameData&, FrameDataShared&, bool)+432) (BuildId: 535721a90eaff3e84768f7d414cf26620116d509)
  #05 pc 0000000000734240  /data/app/org.ppsspp.ppsspp-0Qy6kFFIWmJ8xS16afEyMw==/lib/arm64/libppsspp_jni.so (VulkanRenderManager::Run(VKRRenderThreadTask&)+412) (BuildId: 535721a90eaff3e84768f7d414cf26620116d509)
  #06 pc 0000000000733318  /data/app/org.ppsspp.ppsspp-0Qy6kFFIWmJ8xS16afEyMw==/lib/arm64/libppsspp_jni.so (VulkanRenderManager::ThreadFunc()+320) (BuildId: 535721a90eaff3e84768f7d414cf26620116d509)
  #07 pc 000000000073756c  /data/app/org.ppsspp.ppsspp-0Qy6kFFIWmJ8xS16afEyMw==/lib/arm64/libppsspp_jni.so (_ZNSt6__ndk114__thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEM19VulkanRenderManagerFvvEPS7_EEEEEPvSC_+64) (BuildId: 535721a90eaff3e84768f7d414cf26620116d509)
  #08 pc 00000000000e7480  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: 6dc18c350dc6bdab66bd0af0dcfd6e4c)
  #09 pc 000000000008522c  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 6dc18c350dc6bdab66bd0af0dcfd6e4c)
lim2222 commented 1 year ago

By doing couple of tests i also noticed that some weird graphics behaviour happen compare with v1.13.1-347-g6cc8ca517 which is the best version i have test for these two games.

v1.13.1-347-g6cc8ca517 there is green colour background effect Screenshot_2022-11-24-11-42-24-508_org ppsspp ppsspy

v1.13.2-1214-ge6db0bef2 missing green colour background Screenshot_2022-11-24-11-45-16-711_org ppsspp ppsspe

v1.13.2-1214-ge6db0bef2 foot shadow present gap in NPJH-50333 Screenshot_2022-11-24-11-45-44-238_org ppsspp ppsspe

v1.13.1-347-g6cc8ca517 foot shadow Screenshot_2022-11-24-11-46-20-320_org ppsspp ppsspy

v1.13.2-1214-ge6db0bef2 shoe in NPJH-50562 Screenshot_2022-11-24-11-48-42-744_org ppsspp ppsspp

v1.13.1-347-g6cc8ca517 shoe Screenshot_2022-11-24-11-49-25-451_org ppsspp ppsspy

v1.13.2-1214-ge6db0bef2 flashing negative colour before start fighting Screenshot_2022-11-24-11-43-54-194_org ppsspp ppsspe

v1.13.2-1214-ge6db0bef2 flashing red colour before start fighting in NPJH-50562 Screenshot_2022-11-24-11-48-00-941_org ppsspp ppsspp

hrydgard commented 1 year ago

Thank you, great stuff. I think I know what's going on with the crash now.

I wonder if the inversion/red color aren't actually intended? Hard to say with none of the youtube gameplay being from real hardware, sigh...

unknownbrackets commented 1 year ago

As I recall from #16101, it's not supposed to be flashing, but it's definitely not supposed to be grey. Pretty sure I compared it with the PSP via frame dump so I think the software renderer is doing what's intended.

-[Unknown]

hrydgard commented 1 year ago

This should likely be better now after #16426.

lim2222 commented 1 year ago

v1.13.2-2030-gcb7329cd1 fixed vulkan fighting crash

hrydgard commented 1 year ago

Great, it should have fixed some of the visual problems too, do any remain?

lim2222 commented 1 year ago

still flashing grey

hrydgard commented 1 year ago

OK, well, progress at least!

lim2222 commented 1 year ago

v1.13.2-981-gca2962bea start flashing grey

hrydgard commented 1 year ago

cool, so that's #16014 , which first implemented loading CLUTs (palettes) from framebuffers (images rendered to). Not too surprising but good to confirm.

So I guess the question is in what way it goes wrong... There's one unhandled case which we might fall into I guess, where we should use a CLUT loaded from a framebuffer to texture from another framebuffer...

lim2222 commented 1 year ago

IMG_20221124_234817 Confirmed that there is green colour background effect from original hardware.

hrydgard commented 1 year ago

Is the green color effect still broken in the latest build?

lim2222 commented 1 year ago

still missing in v1.13.2-2041-g21cc6b85e

unknownbrackets commented 1 year ago

16454 should take care of the color before entering a fight. It should not be red or grayscale, but more of a cyan. Didn't look into the other issues, but decent chance this helps the green background as well.

-[Unknown]

hrydgard commented 1 year ago

@lim2222 Please test again - these effects should hopefully all work now.

Of course, do report if something is still not working.

lim2222 commented 1 year ago

v1.13.2-2120-g612d2181a the flashing thing gone. Now only minor glitch of the player's shadow has gap in convenient store,other place shadow is normal.

lim2222 commented 1 year ago

green effect come back too,great job.

hrydgard commented 1 year ago

Could you get a GE dump of the convenience store problem? (I think I used to have one of the store, but can't find it)

lim2222 commented 1 year ago

here is ge dump NPJH50333 (1).zip

hrydgard commented 1 year ago

The split shadow is (not too surprisingly) depth related, there's a small discontinuity in the depth gradient of the floor, after converted from color to depth, at the same place as one of the color components wrapping around:

image

I don't see any unwanted filtering going on in Renderdoc, so there's likely a minor math error in the color->depth conversion shader, or in one of the passes leading up to it.

I'm postponing investigation of this minor glitch to after 1.14.0.