When providing a SubpassDescription that has the following properties:
1) colorAttachmentCount == 0
2) pResolveAttachments is a non-null pointer
Will cause an Oculus Quest 2 to return an OOM error when calling vkCreateRenderPass.
The issue is worked around by making sure pResolveAttachments is null when colorAttachmentCount is 0. This comes up in practice when you are providing a pre-allocated Vector with non-zero capacity and zero size.
The spec says the following about pResolveAttachments:
pResolveAttachments is NULL or a pointer to an array of colorAttachmentCount VkAttachmentReference structures defining the resolve attachments for this subpass and their layouts.
There is no additional requirement that pResolveAttachments is null when colorAttachmentCount == 0.
Upstream workaround: https://github.com/gfx-rs/wgpu/pull/2262
Information about the device:
QUALCOMM build : 403b3691c1, Ife7a905a8c Build Date : 09/03/21 Shader Compiler Version : EV031.35.17.01 Local Branch : Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.UM.8.12.R1.10.00.00.561.144 Remote Branch : NONE Reconstruct Branch : NOTHING Build Config : S P 8.0.12 AArch64 Driver Path : /vendor/lib64/hw/vulkan.kona.so Driver Version : 0582.0
Thanks for reporting this. Yes, this is a known bug in prior Adreno drivers. The bug was fixed in our mainline branch at the end of August 2021. Driver Versions 0597.0 and later should contain the fix. Note that if colorAttachmentCount==0, then yes it is valid to have a non-null pResolveAttachments, however the spec requies that each of the pResolveAttachments has the value VK_ATTACHMENT_UNUSED.
I'm not sure about the process of getting an updated driver for Quest2, but you could reach out if you need assistance with that and we could put you in touch with a POC at Oculus.