Themaister / parallel-rdp

A low-level Vulkan compute emulation of the N64 RDP
MIT License
156 stars 15 forks source link

Crash in QueryPool::add_pool() #23

Closed loganmc10 closed 3 years ago

loganmc10 commented 3 years ago

Hi @Themaister ,

I'm trying to port ParaLLEl-RDP to standalone mupen64plus.

I've got it working on Linux, now I'm trying to compile it on Windows using MinGW.

It crashes with the following backtrace:

(gdb) backtrace
#0  Vulkan::QueryPool::add_pool (this=0x200b82a28f8)
    at C:/msys64/home/lmcnaughton/m64p/parallel-rdp-standalone/vulkan/query_pool.cpp:375
#1  0x00007ffb07978de3 in Vulkan::QueryPool::QueryPool (this=0x200b82a28f8,
    device_=0x200b82a0ac0)
    at C:/msys64/home/lmcnaughton/m64p/parallel-rdp-standalone/vulkan/query_pool.cpp:320
#2  0x00007ffb07966bfd in Vulkan::Device::PerFrame::PerFrame (
    this=0x200b82a2890, device_=0x200b82a0ac0, frame_index_=0)
    at C:/msys64/home/lmcnaughton/m64p/parallel-rdp-standalone/vulkan/device.cpp:2182
#3  0x00007ffb0796645b in Vulkan::Device::init_frame_contexts (
    this=0x200b82a0ac0, count=2)
    at C:/msys64/home/lmcnaughton/m64p/parallel-rdp-standalone/vulkan/device.cpp:2108
#4  0x00007ffb079607da in Vulkan::Device::set_context (this=0x200b82a0ac0,
    context=...)
    at C:/msys64/home/lmcnaughton/m64p/parallel-rdp-standalone/vulkan/device.cpp:731
#5  0x00007ffb0798979f in vk_init ()
    at C:/msys64/home/lmcnaughton/m64p/parallel-rdp-standalone/parallel_imp.cpp:241
#6  0x00007ffb07987f24 in RomOpen ()
    at C:/msys64/home/lmcnaughton/m64p/parallel-rdp-standalone/gfx_m64p.c:241
#7  0x00007ffb0f47d6e3 in main_run ()
   from C:\msys64\home\lmcnaughton\m64p\mupen64plus\mupen64plus.dll
#8  0x00007ff6cd2b3d56 in ?? ()
#9  0x00007ff6cd2b5a90 in ?? ()
#10 0x00007ffb12f99be3 in QThreadPrivate::start(void*) ()
   from C:\msys64\home\lmcnaughton\m64p\mupen64plus\Qt5Core.dll
#11 0x00007ffb7a0e7034 in KERNEL32!BaseThreadInitThunk ()
   from C:\WINDOWS\System32\kernel32.dll
#12 0x00007ffb7bf42651 in ntdll!RtlUserThreadStart ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#13 0x0000000000000000 in ?? ()

https://github.com/loganmc10/m64p/blob/c9a191c7e7affdc271471dd89bf3900539178f5f/parallel-rdp-standalone/vulkan/query_pool.cpp#L375

It's unclear to me why it's crashing, do you have any ideas? It crashes with a Debug and Release build

This is the repo I'm using: https://github.com/loganmc10/parallel-rdp-standalone, I'm using CMake to generate the Makefile

loganmc10 commented 3 years ago

I should add: this is on Windows 10 with an Intel GPU (Surface Pro 7)

loganmc10 commented 3 years ago

Interesting, I fixed it by adding -DVK_USE_PLATFORM_WIN32_KHR to the Makefile

But when I compile I get a lot of this:

In file included from C:/msys64/home/lmcnaughton/m64p/parallel-rdp-standalone/vulkan/fence_manager.hpp:25,
                 from C:/msys64/home/lmcnaughton/m64p/parallel-rdp-standalone/vulkan/fence_manager.cpp:23:
C:/msys64/home/lmcnaughton/m64p/parallel-rdp-standalone/vulkan/vulkan_headers.hpp:26: warning: "VK_USE_PLATFORM_WIN32_KHR" redefined
   26 | #define VK_USE_PLATFORM_WIN32_KHR

It's not a showstopper, just generates a lot of warnings, I'll close this, but I assume there might be a way to clean that up in the Granite project?