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
A call to this function is very similar to `vkCmdDraw`. The first two parameters
149
-
specify the number of indices and the number of instances. We're not using
150
-
instancing, so just specify `1` instance. The number of indices represents the
151
-
number of vertices that will be passed to the vertex shader. The next parameter
152
-
specifies an offset into the index buffer, using a value of `1` would cause the
153
-
graphics card to start reading at the second index. The second to last parameter
154
-
specifies an offset to add to the indices in the index buffer. The final
155
-
parameter specifies an offset for instancing, which we're not using.
132
+
`vkCmdDraw` 호출과 매우 유사합니다.
133
+
첫 두 매개변수는 인덱스의 개수와 인스턴스 개수를 명시합니다.
134
+
인스턴싱을 하지 않으므로 `1`로 두었습니다.
135
+
인덱스의 개수는 정점 셰이더에 넘겨질 정점의 개수를 의미합니다.
136
+
다음 매개변수는 인덱스 버터의 오프셋이고 `1`을 사용하면 두 번째 인덱스부터 렌더링을 시작합니다.
137
+
마지막에서 두 번째 매개변수는 인덱스 버퍼에 추가할 인덱스의 오프셋을 의미합니다.
138
+
마지막 매개변수는 인스턴싱을 위한 오프셋이고, 여기서는 사용하지 않습니다.
156
139
157
-
Now run your program and you should see the following:
140
+
이제 프로그램을 실행하면 아래와 같은 화면이 보입니다:
158
141
159
142

160
143
161
-
You now know how to save memory by reusing vertices with index buffers. This
162
-
will become especially important in a future chapter where we're going to load
163
-
complex 3D models.
164
-
165
-
The previous chapter already mentioned that you should allocate multiple
166
-
resources like buffers from a single memory allocation, but in fact you should
167
-
go a step further. [Driver developers recommend](https://developer.nvidia.com/vulkan-memory-management)
168
-
that you also store multiple buffers, like the vertex and index buffer, into a
169
-
single `VkBuffer` and use offsets in commands like `vkCmdBindVertexBuffers`. The
170
-
advantage is that your data is more cache friendly in that case, because it's
171
-
closer together. It is even possible to reuse the same chunk of memory for
172
-
multiple resources if they are not used during the same render operations,
173
-
provided that their data is refreshed, of course. This is known as *aliasing*
174
-
and some Vulkan functions have explicit flags to specify that you want to do
175
-
this.
144
+
이제 인덱스 버퍼를 사용해 정점을 재사용하여 메모리를 아끼는 법을 배웠습니다.
145
+
나중에 복잡한 3D 모델을 로딩할 챕터에서는 이러한 기능이 특히 중요합니다.
146
+
147
+
이전 챕터에서 버퍼와 같은 다중 리소스들을 한 번의 메모리 할당으로 진행해야 한다고 언급했지만 사실 그 이상으로 해야 할 일들이 있습니다.
148
+
[드라이버 개발자가 추천하길](https://developer.nvidia.com/vulkan-memory-management) 정점과 인덱스 버퍼와 같은 다중 버퍼를 하나의 `VkBuffer`에 저장하고 `vkCmdBindVertexBuffers`와 같은 명령에서 오프셋을 사용하라고 합니다.
149
+
이렇게 하면 데이터가 함께 존재하기 때문에 더 캐시 친화적입니다.
150
+
또한 같은 렌더링 연산에 사용되는 것이 아니라면, 메모리 덩어리(chunk)를 여러 리소스에서 재사용 하는 것도 가능합니다.
151
+
이는 *앨리어싱(aliasing)*이라고 불리며 몇몇 Vulkan 함수는 이러한 동작을 수행하려 한다는 것을 알려주기 위한 명시적 플래그도 존재합니다.
0 commit comments