Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Updates to Multisampling chapter#104

Merged
Overv merged 1 commit intoOverv:masterfrom
Fill4:master
Aug 12, 2018
Merged

Updates to Multisampling chapter#104
Overv merged 1 commit intoOverv:masterfrom
Fill4:master

Conversation

@Fill4
Copy link
Copy Markdown
Contributor

@Fill4 Fill4 commented Aug 7, 2018

Updates recreateSwapChain to allow for window resizing.
Adds clear values for the newly created attachment in createCommandBuffers.

Comment thread 10_Multisampling.md Outdated
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 };
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Fill4
Copy link
Copy Markdown
Contributor Author

Fill4 commented Aug 12, 2018

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.

@Overv Overv merged commit 98a35c8 into Overv:master Aug 12, 2018
Overv added a commit that referenced this pull request Mar 8, 2023
Updates to Multisampling chapter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants