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