I'm porting a game to Quest and so part of my work is to interface the engine's Vulkan renderer w/ the Oculus Mobile SDK.
I believe I'm setting up the SDK correctly (I'm following the examples and the guidelines from Oculus' docs) but still I'm getting a nasty error when trying to submit a frame.
Here's a high-level list of the things I'm currently doing:
Then at the end of my render loop I setup an ovrSubmitFrameDesc
and then call vrapi_SubmitFrame2()
. I'm also making sure I only call vrapi_SubmitFrame2()
after all work has been submitted to the GPU (I'm currently using a fence on my work queues).
However, as I mentioned before, the call to vrapi_SubmitFrame2()
fails. It currently raises a SIGSEGV inside Quest's Vulkan driver:
backtrace:
#00 pc 000000000010b2d8 /vendor/lib64/hw/vulkan.kona.so (!!!0000!b78ad09fc24eab751708d0a80613cf!09c6a36!+24) (BuildId: cc478ff923cc27b87607fb1f1a3b87ef)
#01 pc 00000000000c3b04 /vendor/lib64/hw/vulkan.kona.so (qglinternal::vkQueueSubmit(VkQueue_T*, unsigned int, VkSubmitInfo const*, VkFence_T*)+4468) (BuildId: cc478ff923cc27b87607fb1f1a3b87ef)
#02 pc 000000000018a608 /system/priv-app/VrDriver/VrDriver.apk!libvrapiimpl.so (offset 0x8cd000) (BuildId: aa2c28d3d4127c2e2e9a5125be000207dcc27ebd)
#03 pc 0000000000160a2c /system/priv-app/VrDriver/VrDriver.apk!libvrapiimpl.so (offset 0x8cd000) (BuildId: aa2c28d3d4127c2e2e9a5125be000207dcc27ebd)
#04 pc 0000000000162b6c /system/priv-app/VrDriver/VrDriver.apk!libvrapiimpl.so (offset 0x8cd000) (vrapi_SubmitFrame2+7564) (BuildId: aa2c28d3d4127c2e2e9a5125be000207dcc27ebd)
#05 pc 00000000048a85fc /data/app/myapp-Y6tT_vtGWj8JJ1PwgxheNA==/base.apk!libgrid.so (offset 0x6a9b000) (MyEngine::endVrFrame(unsigned int)+160) (BuildId: c9933f7ea0ad0c36a592bc4316e499e9db767d60)
The fact that the error is happening at an internal vkQueueSubmit()
call makes me think that this is somehow related to the way I'm using command queues. But even if I set a separated queue as the synchronization queue and don't do anything with it (i.e., don't submit any command to it) I still get the same error.
Does anybody have an idea of what I could be doing wrong?
PS (1), I've tried to use a blank layer, instead of a proper projection layer, just to see if I could get past that point, but that didn't help.
PS (2), I'm getting no errors from the validation layer.
PS (3), the thread in which I enter VR mode is the same thread in which I'm calling vrapi_SubmitFrame2()
.
Let me start this by asking: who do you think would win, 18 years of experience in software development or this bad boi here '&'?
The mystery of SIGSEGV being raised from vrapi_SubmitFrame2()
was nothing more than a stupid mistake when setting OVR's synchronization queue:
vpapi_DefaultModeParmsVulkan(&m_java, (long long)&queueHandle);
That line should have been written as:
vpapi_DefaultModeParmsVulkan(&m_java, (long long)queueHandle);