I've written an OpenXR application I call MirrorBall VR that simulates infinity mirrors. I runs on Oculus Quest devices and APKs for it can be downloaded from sidequestvr.com and itch.io. It's based on the OpenXR SDK hello_xr sample program.
One problem with the currently published version of MirrorBall VR is a lot of the rendering logic still happens in the CPUs rather than the GPUs and that translates to poor frame rates for some configurations. I've recently implemented an enhancement that moves that last bit of CPU processing to the GPUs. My usual process is to first get an enhancement written and running on Monado's OpenXR implementation on my Ubuntu Intel laptop and then copy that code over to a project in Android Studio to get it built for and running on the Oculus devices using the Oculus SDK. Very often if I can get it to work on Monado/Ubuntu it will work on Oculus with very little additional debugging.
But this time I haven't been so lucky. My enhancement works fine on the Ubuntu laptop with Monado but when I run it on my Oculus Quest 2, I get this error during the Vulkan pipeline creation:
02-14 15:37:30.014 5100 5125 E mirror_ball: [15:37:30.014][Error ] VkResult failure [-13] 02-14 15:37:30.014 5100 5125 E mirror_ball: Origin: vkCreateGraphicsPipelines(m_vkDevice, VK_NULL_HANDLE, 1, &pipeInfo, nullptr, &pipe) 02-14 15:37:30.014 5100 5125 E mirror_ball: Source: ../../../../graphicsplugin_vulkan.cpp:967
The -13 VkResult is not very informative (VK_ERROR_UNKNOWN). The problem it turns out is not dependent on the CPU code of my application. It happens due to something with one or the other of the vertex or fragment shader GLSL programs I've written. If I modify the vertex and fragment shader code to much simpler forms and make no other changes to the CPU code, the call to vkCreateGraphicsPipelines() succeeds and the program runs, albeit not correctly because the application depends on what the problematic shaders are supposed to be doing.
Both of the problematic shader sources compile with glslangValidator without error. Both are prefixed with:
#version 320 es
which to my knowledge is the proper version of Oculus Quest targets.
So at this point I am hoping I can get some clue as to what the Oculus vulkan driver doesn't like about my glsl code via logs it may be generating before returning VK_ERROR_UNKNOWN in that pipeline creation function call.
But the logcat output on my Quest 2 is like a fire hose at a 5 alarm fire. Suggestions as to how to filter its output to find logs from its vulkan driver appreciated.
I'd also appreciate suggestions as to other ways I can debug this.
Thanks.
I've narrowed the problem down to the shader code, but given that the glsl code compiles fine and the vulkan driver is not to specific about why its failing, that's as far as I've been able to take it.