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

Vulkan: Refactor swapchain code. #399

Merged
merged 27 commits into from
Nov 4, 2022

Conversation

goeiecool9999
Copy link
Contributor

@goeiecool9999 goeiecool9999 commented Oct 21, 2022

Changes in this PR:

  • Change all variants of mainWindow (isMainWindow, main_window, mainwindow) to mainWindow
  • Change all variants of chainInfo (swapInfo, swap_info, swap_chain_info, swapchain_info) to chainInfo
  • Eliminate all capitalisations of swapchain that aren't Swapchain or swapchain (treated as a single word in Vulkan)
  • Renamed SwapChainInfo struct SwapchainInfoVk and put it in separate files
  • Separate out a lot of swapchain related code into SwapchainInfoVk
  • Put ternary operator to choose between SwapchainInfoVk structures in dedicated function
  • Remove a bunch of branches for picking between the two SwapchainInfoVk instances
  • Call existing WaitDeviceIdle member function instead of vkWaitDeviceIdle

@goeiecool9999 goeiecool9999 changed the title Refactor swapchain code. Vulkan: Refactor swapchain code. Oct 21, 2022
@goeiecool9999
Copy link
Contributor Author

Both swapchains used the same VkSurfaceFormat variable. Unlikely to cause issues, but not very safe either.

@goeiecool9999
Copy link
Contributor Author

I would move the CreateSwapchain function into SwapChainInfo but it depends on a lot of other functions in VulkanRenderer and that might make the PR too large

@lijunyu-cn
Copy link
Contributor

I tried this, but it crashes at the time I startup any game, here's the log.

Crashlog for Cemu 2.0 (experimental)
Date: 22-10-2022 18:32:19


Stack trace

0x00007ff637b74f18 +0x00354f18 Cemu_release.exe PPCRecompiler_getJumpTableBase
0x00007ff637b7541a +0x0035541a Cemu_release.exe PPCRecompiler_getJumpTableBase
0x00007ff637b7613d +0x0035613d Cemu_release.exe PPCRecompiler_getJumpTableBase
0x00007ffcfbd302e7 +0x001102e7 KERNELBASE.dll UnhandledExceptionFilter
0x00007ffcfe435530 +0x000a5530 ntdll.dll memset
0x00007ffcfe41c876 +0x0008c876 ntdll.dll _C_specific_handler
0x00007ffcfe43241f +0x000a241f ntdll.dll _chkstk
0x00007ffcfe3e14a4 +0x000514a4 ntdll.dll RtlRaiseException
0x00007ffcfe430f4e +0x000a0f4e ntdll.dll KiUserExceptionDispatcher
0x00007ff637b3299c +0x0031299c Cemu_release.exe PPCRecompiler_getJumpTableBase
0x00007ff6379a447c +0x0018447c Cemu_release.exe PPCRecompiler_getJumpTableBase
0x00007ff6378fe74b +0x000de74b Cemu_release.exe memory_getBase
0x00007ff6385368ac +0x00d168ac Cemu_release.exe wxCheckTree::SetFocusFromKbd
0x00007ffcfca57034 +0x00017034 KERNEL32.DLL BaseThreadInitThunk
0x00007ffcfe3e26a1 +0x000526a1 ntdll.dll RtlUserThreadStart
Exception 0xc0000005 at 0x7ff637b3299c(+0x31299c) in module Cemu_release.exe
cemu.exe at 0x7ff637820000

RAX=0000000000000000 RBX=000002254687b0d0 RCX=000002254687b0d0 RDX=0000000000000001
RSP=00000083c51ff630 RBP=00000000000005a0 RDI=0000000000000000 RSI=0000000000000a00
R8 =00000000ffffffff R9 =0000000000000001 R10=000000000000001b R11=00000083c51ff400
R12=0000000000000000 R13=0000000000000000 R14=0000000000000000 R15=0000000000000000


Game info

Game: Captain Toad: Treasure Tracker
TitleId: 5000010180600
RPXHash: 51c69ca0


Active PPC instance

Not active


PPC threads

0e30eaa0 Ent 00e0000c IP 00e00004 LR 00e00000 READY Aff 111 Pri 32 Name Alarm Thread
0e4b9c00 Ent 00e00010 IP 00e00004 LR 00e00000 READY Aff 100 Pri 15 Name {SYS IPC Core 0}
0e4ba29c Ent 00e00010 IP 00e00004 LR 00e00000 READY Aff 010 Pri 15 Name {SYS IPC Core 1}
0e4ba938 Ent 00e00010 IP 00e00004 LR 00e00000 READY Aff 001 Pri 15 Name {SYS IPC Core 2}
0e48b338 Ent 00e00014 IP 00e00004 LR 00e00000 READY Aff 111 Pri 32 Name Callback Thread

@Exzap Exzap merged commit 348d866 into cemu-project:main Nov 4, 2022
@goeiecool9999 goeiecool9999 deleted the swapchaincleanup branch November 4, 2022 18:34
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.

None yet

3 participants