Hello guys, i have a strange bug which i couldnt solve on my own:
[ATTACH=CONFIG]124[/ATTACH]
This is how i am rendering:
1.) Render scene into an offscreen framebuffer (in the image the clear-value if BLUE)
2.) Use the previous framebuffer as a input for post-processing and render it on a fullscreen quad (in this case the shader do nothing)
3.) Copy the image from the last post-processed framebuffer into the right swapchain-image
Here comes the weird thing:
If i am rendering a skybox (overwrite the whole render-target) then everything works fine
If i display just the rendered-scene (without the post-process stage) it works fine again. That means that the scene framebuffer gets definitely cleared with the mentioned blue color.
The “Clear-Value” pixels are the problem but i dont know why, nor i couldn’t find any solution. Blending is disabled.
Why the post-processing shader cant render those “cleared-pixels”?
Are you using the correct storeOp for your attachment? If so, do you have proper barriers for resource transitioning between rendering to the offscreen framebuffer and using it in the second pass? (In case you’re using separate render passes instead of subpasses, where you’d use dependencies for implicit layout transitions).
I am using separate renderpasses. Both have VK_ATTACHMENT_STORE_OP_STORE for the color-attachment.
Beside that both renderpasses have these subpass-dependencies:
This was on AMD too and didn’t happen on NVIDIA as AMD relies on proper image layout transitions. In my case the example was missing a post present barrier. I have folded those into renderpasses. But on AMD you must ensure that resources are always in the required layout for the next operation.
Can you also post the attachment descriptions showing the layouts and usage types of the attachment?
Depends on the implementation, but yes, using the best fit image layout is always advised and may result in better performance. So try to stay away from VK_IMAGE_LAYOUT_GENERAL if possible.