I started learning to write compute shaders recently and I had a working shader for my purpose (texture encoding/decoding), running on Android. Now I made some modifications and it stopped working on Android. Not just that, it results in the app not displaying anything anymore at all, even parts that don’t use the compute shader, like a texture displaying the source I’m encoding.
It does work in the editor on Windows and I’m not getting any warnings or errors for the shader code. There is some buggy behavior (graphical corruptions/noise after decoding) which I have to yet to figure out but it does display everything fine apart from that.
Not sure what causes the problem on Android and I have problem finding explanations for the errors. The first one is right at the start:
Error vulkan invalid vkGetInstanceProcAddr(VK_NULL_HANDLE, "vkEnumerateInstanceVersion") call
But this one occurs even on an earlier version using my old compute shader, so it doesn’t seem to be breaking anything necessarily. The other ones are all new though and unique to the version not displaying anything.
This one I get after calling GetData on an RWStructuredBuffer:
Error SwappyVk Failed to wait for fence -4
The next one is some time (not immediately) after uploading data to a RWStructuredBuffer:
Error SwappyVk Failed to vkQueueSubmit -4
I get this twice in a row.*
The next one doesn’t seem to relate directly to any call to the compute shader but the last action was calling dispatch on some kernels (which are called for the first time here):
Error vulkan dequeueBuffer failed: Function not implemented (-38)
The last error I get after another dispatch on different kernels:
Error SwappyVk Failed to wait for fence 2
This is also twice in the row. These kernels were previously called without raising an error, before downloading data from the RWStructuredBuffer that gave the Failed to wait for fence -4 error above.
After that execution stops entirely and no other logcat messages are received until I pause/unpause the device.
*Rerunning the app the timing of the errors isn’t consistent, but the order and the content of the errors is always the same.