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
Copy file name to clipboardExpand all lines: 07_Depth_buffering.md
+28-21Lines changed: 28 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,14 +125,12 @@ range of `0.0` to `1.0` using the `GLM_FORCE_DEPTH_ZERO_TO_ONE` definition.
125
125
126
126
A depth attachment is based on an image, just like the color attachment. The
127
127
difference is that the swap chain will not automatically create depth images for
128
-
us. We only need a single depth image, because only one draw operation is
129
-
running at once. The depth image will again require the trifecta of resources:
130
-
image, memory and image view.
128
+
us. We need a depth image for every frame that can be in flight simultaneously. In practice it's easiest to juse have one per swap chain image similar to the uniform buffers. The depth images will again require the trifecta of resources: image, memory and image view.
131
129
132
130
```c++
133
-
VkImage depthImage;
134
-
VkDeviceMemory depthImageMemory;
135
-
VkImageView depthImageView;
131
+
std::vector<VkImage> depthImages;
132
+
std::vector<VkDeviceMemory> depthImagesMemory;
133
+
std::vector<VkImageView> depthImagesView;
136
134
```
137
135
138
136
Create a new function `createDepthResources` to set up these resources:
0 commit comments