Hello!
We have a main opaque pass that uses 3 multisampled color attachments and a multisampled depth attachment; we want all of these attachments to be resolved on tile so that we don't pay extra bandwidth to store them.
It's easy to do with color attachments using .pResolveAttachments field of VkSubpassDescription and appropriate load/store ops, but with depth the situation gets a bit more complicated. Since Vulkan 1.2 is pretty much non-existent on Android and VK_KHR_depth_stencil_resolve extension is not as widely available as we had hoped, we decided to use a separate resolve subpass.
The approach worked well on Adreno devices and on PC, but on devices with Mali GPUs it just doesn't work: after the pass ends, the resolved depth target appears to be filled with default values. ( tested on Xiaomi Note 8 Pro and on Samsung S20 FE )
The following gist includes the render pass setup and resolve pipeline creation code: gist.github.com/.../90f517fd963ec492ef40d27499f9a4e7
Please let me know if there's any additional information I can provide.
Thank you!
Hello Peter, thanks for quick response!
Interesting, so basically in our case the two subpasses will be split and we will still pay bandwidth cost for the depth attachment?
How exactly does it work if we have VK_ATTACHMENT_STORE_OP_DONT_CARE storeOp for depth? Will it get discarded before the second subpass begins? (btw, I tried storing multisampled attachments and it didn't solve the issue)
VK_ATTACHMENT_STORE_OP_DONT_CARE
And do you have any suggestions on how to make it as cheap as possible in case the device doesn't support VK_KHR_depth_stencil_resolve / Vulkan 1.2?
> How exactly does it work if we have VK_ATTACHMENT_STORE_OP_DONT_CARE storeOp for depth? Will it get discarded before the second subpass begins?
Should stay live as it's an input attachment for the second subpass.
What device / driver version are you running on? Cn you share a repro APK with us by emailing developer@arm.com.
Cheers,
Pete
I tested it on two Mali devices:
As for a repro APK, I'm afraid I won't be able to share it.
Would it be helpful if I sent you a RenderDoc capture instead?