Sorry for the kind of “open question”, but what are the usual suspects to check when trying to have a first render pass rendering only to a depth buffer and then trying to read from it on the next render pass (typically what you would see in a shadow map implementation)? Currently my depth buffer has only 1.0’s when reading the .r value in the second render pass…
A little bit about my setup:
- I have 2 frames in flight, and 2 sets of descriptor sets, one for each frame in flight (even though I have 3 swap chain images/swap chain frameBuffers, could that be a problem?)
- I create the images/imageViews and use them as an attachment in the first render pass, and then try to read from it in the second render pass - each is also loaded as a SAMPLED_IMAGE in their respective descriptor set… I use subpasses to perform layout transitions in the first render pass (there are no vulkan validation messages)
- loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR; and storeOp = VK_ATTACHMENT_STORE_OP_STORE;
- A lot of the code is based on (Vulkan/shadowmapping.cpp at master · SaschaWillems/Vulkan · GitHub). with the biggest difference perhaps being this 2 sets of resources: I have 2 framebuffers for the depth pass and 2 descriptor sets, so I use/bind always the ones using the same imageView when recording the command buffer (so if the first render pass would write to “imageView” , this would be the one also referenced in the bound descriptor set)
Any hint/tip/guidance about common issues I should be looking for would be much appreciated!
Thanks a lot!