Updates to Multisampling chapter#104
Conversation
| std::array<VkClearValue, 3> clearValues = {}; | ||
| clearValues[0].color = { 0.0f, 0.0f, 0.0f, 1.0f }; | ||
| clearValues[1].depthStencil = { 1.0f, 0 }; | ||
| clearValues[2].color = { 0.0f, 0.0f, 0.0f, 1.0f }; |
There was a problem hiding this comment.
This is unnecessary, since the loadOp for resolve buffer is LOAD_OP_DONT_CARE, so it won't be cleared. Also, it doesn't really have to be cleared since we're not rendering to it, just resolving to it.
There was a problem hiding this comment.
Hi kondrak. Thank you for the review.
Originally I suggested those changes because the validation layers were complaining about the size of the clearValues array, saying that its size should match at least the number of attachments.
But since, as you mentioned, the attachment doesn't have to be cleared I found that just by increasing the size of the array to 3, and leaving the default values for the last index, the validation layer doesn't complain about anything so that might be enough.
There was a problem hiding this comment.
Did you get the validation layer error/warning compiling the sample code in the tutorial or was that in your own code? Which SDK version are you using? Are you sure that your new resolve attachment for color has loadOp set to DONT_CARE? You should get a validation error only if you explicitly want to clear it.
There was a problem hiding this comment.
Yes, you are right. I followed your tutorial but wrongfully wrote the loadOp as CLEAR instead of DONT_CARE. Now the validation layers don't complain with the clearValues anymore.
Thank you for the help.
As an extra note, I haven't learned how to edit a pull request but I will try to remove the commit about the clearValues.
|
Hi again. I have removed the commit related to the clearValues array and left the one that adds the adds the new function to the recreation of the swap chain. Thanks for the help and please check if everything is right this time. |
Updates recreateSwapChain to allow for window resizing.
Adds clear values for the newly created attachment in createCommandBuffers.