You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that we have a multisampled color buffer in place it's time to take care of depth. Modify `createDepthResources` and add creation steps for a multisampled depth buffer:
140
+
Now that we have a multisampled color buffer in place it's time to take care of depth. Modify `createDepthResources` and update the number of samples used by the depth buffer:
We made it past the initial MSAA configuration, now we need to start using these new resources in our graphics pipeline, framebuffer, render pass and and see the results!
164
+
We made it past the initial MSAA setup, now we need to start using these new resources in our graphics pipeline, framebuffer, render pass and see the results!
182
165
183
166
## Adding new attachments
184
167
@@ -194,7 +177,7 @@ void createRenderPass() {
194
177
...
195
178
```
196
179
197
-
You'll notice that we have changed the finalLayout from `VK_IMAGE_LAYOUT_PRESENT_SRC_KHR` to `VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL`. That's because multisampled images cannot be presented directly. We first need to resolve them to a regular image. The same requirement applies to the depth buffer. Therefore we will have two new attachments that are so-called resolve attachments:
180
+
You'll notice that we have changed the finalLayout from `VK_IMAGE_LAYOUT_PRESENT_SRC_KHR` to `VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL`. That's because multisampled images cannot be presented directly. We first need to resolve them to a regular image. This requirement does not apply to the depth buffer, since it won't be presented at any point. Therefore we will have to add only one new attachment for color which is a so-called resolve attachment:
198
181
199
182
```c++
200
183
...
@@ -207,20 +190,10 @@ You'll notice that we have changed the finalLayout from `VK_IMAGE_LAYOUT_PRESENT
The render pass now has to be instructed to resolve multisampled images into these regular attachments. Create a new attachment reference that will point to the color buffer which will serve as the resolve target:
196
+
The render pass now has to be instructed to resolve multisampled color image into regular attachment. Create a new attachment reference that will point to the color buffer which will serve as the resolve target:
224
197
225
198
```c++
226
199
...
@@ -238,24 +211,23 @@ Set the `pResolveAttachments` subpass struct member to point to the newly create
238
211
...
239
212
```
240
213
241
-
Now update render pass info struct with new attachments:
214
+
Now update render pass info struct with new color attachment:
0 commit comments