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
Then we need to create multiple command buffers. Rename `createCommandBuffer`
45
-
to `createCommandBuffers`. Next we need to resize the command buffers vector
46
-
to the size of `MAX_FRAMES_IN_FLIGHT`, alter the `VkCommandBufferAllocateInfo`
47
-
to contain that many command buffers, and then change the destination to our
48
-
vector of command buffers:
38
+
이제 여러 개의 명령 버퍼를 생성해야 합니다.
39
+
`createCommandBuffer`를 `createCommandBuffers`로 이름을 변경하고 명령 버퍼 벡터의 크기를 `MAX_FRAMES_IN_FLIGHT`로 수정합니다.
40
+
`VkCommandBufferAllocateInfo`를 수정하여 명령 버퍼의 숫자를 받고록 하고 새로운 명령 버퍼 벡터의 위치를 넘겨줍니다:
49
41
50
42
```c++
51
43
voidcreateCommandBuffers() {
@@ -59,7 +51,7 @@ void createCommandBuffers() {
59
51
}
60
52
```
61
53
62
-
The `createSyncObjects`function should be changed to create all of the objects:
54
+
`createSyncObjects`함수는 모든 객체를 생성하도록 수정되어야 합니다:
63
55
64
56
```c++
65
57
voidcreateSyncObjects() {
@@ -85,7 +77,7 @@ void createSyncObjects() {
85
77
}
86
78
```
87
79
88
-
Similarly, they should also all be cleaned up:
80
+
모두 정리되어야 하는 것도 마찬가지입니다:
89
81
90
82
```c++
91
83
voidcleanup() {
@@ -99,17 +91,16 @@ void cleanup() {
99
91
}
100
92
```
101
93
102
-
Remember, because command buffers are freed for us when we free the command
103
-
pool, there is nothing extra to do for command buffer cleanup.
94
+
명령 풀을 해제하면 명령 버퍼가 자동으로 해제되기 때문에 명령 버퍼 정리에는 별도의 작업이 필요 없다는 사실을 기억하세요.
95
+
96
+
각 프레임에서 올바른 객체를 사용하기 위해서는 현재 프레임이 무엇인지를 알고 있어야 합니다. 이를 위해 프레임 인덱스를 사용할 것입니다:
104
97
105
-
To use the right objects every frame, we need to keep track of the current
106
-
frame. We will use a frame index for that purpose:
107
98
108
99
```c++
109
100
uint32_t currentFrame = 0;
110
101
```
111
102
112
-
The `drawFrame`function can now be modified to use the right objects:
103
+
`drawFrame`함수에서는 적절한 객체를 사용하도록 수정합니다:
113
104
114
105
```c++
115
106
voiddrawFrame() {
@@ -141,7 +132,7 @@ void drawFrame() {
141
132
}
142
133
```
143
134
144
-
Of course, we shouldn't forget to advance to the next frame every time:
135
+
당연히 다음 프레임에는 프레임을 증가시켜주어야 합니다:
145
136
146
137
```c++
147
138
voiddrawFrame() {
@@ -151,25 +142,18 @@ void drawFrame() {
151
142
}
152
143
```
153
144
154
-
By using the modulo (%) operator, we ensure that the frame index loops around
155
-
after every `MAX_FRAMES_IN_FLIGHT` enqueued frames.
145
+
모듈로 연산(%)을 사용해 프레임 인덱스가 `MAX_FRAMES_IN_FLIGHT`개의 프레임 뒤에는 다시 0이 되도록 합니다.
156
146
157
147
<!-- Possibly use swapchain-image-count for renderFinished semaphores, as it can't
158
148
be known with a fence whether the semaphore is ready for re-use. -->
159
149
160
-
We've now implemented all the needed synchronization to ensure that there are
161
-
no more than `MAX_FRAMES_IN_FLIGHT` frames of work enqueued and that these
162
-
frames are not stepping over eachother. Note that it is fine for other parts of
163
-
the code, like the final cleanup, to rely on more rough synchronization like
164
-
`vkDeviceWaitIdle`. You should decide on which approach to use based on
165
-
performance requirements.
166
-
167
-
To learn more about synchronization through examples, have a look at [this extensive overview](https://github.com/KhronosGroup/Vulkan-Docs/wiki/Synchronization-Examples#swapchain-image-acquire-and-present) by Khronos.
168
-
150
+
이제 동기화화 관련한 모든 구현을 마쳐서 `MAX_FRAMES_IN_FLIGHT`개 이상의 프레임 작업이 동시에 큐에 들어가지 않도록 하였으며 이러한 프레임들이 서로 겹치지도 않게 되었습니다.
151
+
정리 부분과 같은 나머지 부분은 `vkDeviceWaitIdle` 처럼 보다 기초적인 동기화 방법에 의존하고 있습니다.
152
+
어떠한 접근법을 사용할지는 성능 요구사항에 따라서 여러분이 선택하셔야 합니다.
169
153
170
-
In the next chapter we'll deal with one more small thing that is required for a
171
-
well-behaved Vulkan program.
154
+
동기화에 대해 예를 통해 더 알고 싶으시면 Khronos에서 제공하는 [이 개요 문서](https://github.com/KhronosGroup/Vulkan-Docs/wiki/Synchronization-Examples#swapchain-image-acquire-and-present)를 살펴보세요.
172
155
156
+
다음 챕터에서는 잘 동작하는 Vulkan 프로그램에 필요한 또다른 요구사항을 살펴보겠습니다.
0 commit comments