Skip to content

Commit a0e18f4

Browse files
committed
kr translate 03-02-03 pipeline, conclusion
1 parent fc35393 commit a0e18f4

File tree

1 file changed

+21
-58
lines changed

1 file changed

+21
-58
lines changed

kr/03_Drawing_a_triangle/02_Graphics_pipeline_basics/04_Conclusion.md

Lines changed: 21 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
1-
We can now combine all of the structures and objects from the previous chapters
2-
to create the graphics pipeline! Here's the types of objects we have now, as a
3-
quick recap:
4-
5-
* Shader stages: the shader modules that define the functionality of the
6-
programmable stages of the graphics pipeline
7-
* Fixed-function state: all of the structures that define the fixed-function
8-
stages of the pipeline, like input assembly, rasterizer, viewport and color
9-
blending
10-
* Pipeline layout: the uniform and push values referenced by the shader that can
11-
be updated at draw time
12-
* Render pass: the attachments referenced by the pipeline stages and their usage
13-
14-
All of these combined fully define the functionality of the graphics pipeline,
15-
so we can now begin filling in the `VkGraphicsPipelineCreateInfo` structure at
16-
the end of the `createGraphicsPipeline` function. But before the calls to
17-
`vkDestroyShaderModule` because these are still to be used during the creation.
1+
이제 이전 장에서 만든 모든 구조체와 객체들을 사용해 그래픽스 파이프라인을 만들 것입니다! 복습으로 우리가 가진 객체들의 종류를 되돌아봅시다:
2+
3+
* 셰이더 단계: 그래픽스 파이프라인 내의 프로그램 가능한 단계들의 기능을 정의하는 셰이더 모듈
4+
* 고정 함수 상태: 파이프라인의 고정함수 단계들을 정의하는 구조체들. 여기에는 입력 조립기, 래스터화, 뷰포트와 컬러 블렌딩이 포함됨
5+
* 파이프라인 레이아웃: 셰이더가 참조하는, 그리기 시점에 갱신될 수 있는 uniform과 push 값들
6+
* 렌더 패스: 파이프라인에서 참조하는 어태치먼트들과 그 사용 용도
7+
8+
이 것들이 모여 그래픽스 파이프라인의 기능을 완전히 명시합니다. 이제 우리는 `createGraphicsPipeline` 함수의 마지막 부분에 `VkGraphicsPipelineCreateInfo` 구조체를 만들 수 있습니다. `vkDestroyShaderModule` 보다는 전이어야 하는데 이것들이 생성 과정에서 사용되기 때문입니다.
189

1910
```c++
2011
VkGraphicsPipelineCreateInfo pipelineInfo{};
@@ -23,7 +14,7 @@ pipelineInfo.stageCount = 2;
2314
pipelineInfo.pStages = shaderStages;
2415
```
2516

26-
We start by referencing the array of `VkPipelineShaderStageCreateInfo` structs.
17+
`VkPipelineShaderStageCreateInfo`구조체의 배열을 참조하는 것으로 시작합니다.
2718

2819
```c++
2920
pipelineInfo.pVertexInputState = &vertexInputInfo;
@@ -36,73 +27,48 @@ pipelineInfo.pColorBlendState = &colorBlending;
3627
pipelineInfo.pDynamicState = &dynamicState;
3728
```
3829

39-
Then we reference all of the structures describing the fixed-function stage.
30+
그리고 고정함수 단계를 기술하는 구조체들을 참조합니다.
4031

4132
```c++
4233
pipelineInfo.layout = pipelineLayout;
4334
```
4435

45-
After that comes the pipeline layout, which is a Vulkan handle rather than a
46-
struct pointer.
36+
다음으로 파이프라인 레이아웃으로 구조체에 대한 포인터가 아닌 Vulkan 핸들입니다.
4737

4838
```c++
4939
pipelineInfo.renderPass = renderPass;
5040
pipelineInfo.subpass = 0;
5141
```
5242

53-
And finally we have the reference to the render pass and the index of the sub
54-
pass where this graphics pipeline will be used. It is also possible to use other
55-
render passes with this pipeline instead of this specific instance, but they
56-
have to be *compatible* with `renderPass`. The requirements for compatibility
57-
are described [here](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/chap8.html#renderpass-compatibility),
58-
but we won't be using that feature in this tutorial.
43+
마지막으로 그래픽스 파이프라인이 사용할 렌더 패스에 대한 참조와 서브패스 인덱스가 있습니다. 이 특정 인스턴스가 아닌 다른 렌더 패스를 사용할 수도 있지만 그러한 경우 그것들이 `renderPass`*호환되어야 합니다*. 호환성에 대해서는 [여기](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/chap8.html#renderpass-compatibility)에 설명되어 있지만 그러한 기능은 이 튜토리얼에서는 사용하지 않을 겁니다.
5944

6045
```c++
6146
pipelineInfo.basePipelineHandle = VK_NULL_HANDLE; // Optional
6247
pipelineInfo.basePipelineIndex = -1; // Optional
6348
```
6449

65-
There are actually two more parameters: `basePipelineHandle` and
66-
`basePipelineIndex`. Vulkan allows you to create a new graphics pipeline by
67-
deriving from an existing pipeline. The idea of pipeline derivatives is that it
68-
is less expensive to set up pipelines when they have much functionality in
69-
common with an existing pipeline and switching between pipelines from the same
70-
parent can also be done quicker. You can either specify the handle of an
71-
existing pipeline with `basePipelineHandle` or reference another pipeline that
72-
is about to be created by index with `basePipelineIndex`. Right now there is
73-
only a single pipeline, so we'll simply specify a null handle and an invalid
74-
index. These values are only used if the `VK_PIPELINE_CREATE_DERIVATIVE_BIT`
75-
flag is also specified in the `flags` field of `VkGraphicsPipelineCreateInfo`.
76-
77-
Now prepare for the final step by creating a class member to hold the
78-
`VkPipeline` object:
50+
두 개의 매개변수가 사실 더 있습니다. `basePipelineHandle`
51+
`basePipelineIndex` 입니다. Vulkan에서는 기존 파이프라인으로부터 새로운 그래픽스 파이프라인을 만들 수도 있습니다. 이러한 파이프라인 유도(derivative)는 대부분의 기능이 비슷한 파이프라인을 설정하는 데 성능적인 이점이 있고, 같은 부모로부터 유도된 파이프라인으로 교체하는 것은 더 빠르게 수행될 수 있습니다. 기존 파이프라인의 핸들을 `basePipelineHandle`에 명시하거나 곧 생성할 파리프라인의 인덱스를 `basePipelineIndex`를 사용해 참조할 수 있습니다. 지금은 하나의 파이프라인만 있으므로 널 핸들과 유효하지 않은 인덱스로 설정해 둡니다. 이러한 기능은 `VkGraphicsPipelineCreateInfo``flag` 필드에 `VK_PIPELINE_CREATE_DERIVATIVE_BIT`가 명시되어 있어야만 사용할 수 있습니다.
52+
53+
마지막으로 `VkPipeline` 객체를 저장할 클래스 멤버를 준비해 둡시다:
7954

8055
```c++
8156
VkPipeline graphicsPipeline;
8257
```
8358

84-
And finally create the graphics pipeline:
59+
그리고 최종적으로 그래픽스 파이프라인을 만듭니다:
8560

8661
```c++
8762
if (vkCreateGraphicsPipelines(device, VK_NULL_HANDLE, 1, &pipelineInfo, nullptr, &graphicsPipeline) != VK_SUCCESS) {
8863
throw std::runtime_error("failed to create graphics pipeline!");
8964
}
9065
```
9166

92-
The `vkCreateGraphicsPipelines` function actually has more parameters than the
93-
usual object creation functions in Vulkan. It is designed to take multiple
94-
`VkGraphicsPipelineCreateInfo` objects and create multiple `VkPipeline` objects
95-
in a single call.
67+
`vkCreateGraphicsPipelines`함수는 Vulkan의 다른 객체들을 만들 떄보다 더 많은 매개별수를 받습니다. 한 번의 호출로 여러 개의 `VkGraphicsPipelineCreateInfo`를 받아 여러 개의 `VkPipeline`객체를 만들 수 있게 되어있습니다.
9668

97-
The second parameter, for which we've passed the `VK_NULL_HANDLE` argument,
98-
references an optional `VkPipelineCache` object. A pipeline cache can be used to
99-
store and reuse data relevant to pipeline creation across multiple calls to
100-
`vkCreateGraphicsPipelines` and even across program executions if the cache is
101-
stored to a file. This makes it possible to significantly speed up pipeline
102-
creation at a later time. We'll get into this in the pipeline cache chapter.
69+
`VK_NULL_HANDLE`를 념겨준 두 번째 매개변수는 선택적으로 `VkPipelineCache`객체에 대한 참조를 넘겨줄 수 있습니다. 파이프라인 캐시(cache)는 여러 `vkCreateGraphicsPipelines` 호출을 위해, 파이프라인 생성을 위한 데이터를 저장하고 재사용하는데 사용될 수 있습니다. 만일 캐시가 파일로 저장되어 있다면 다른 프로그램에서도 사용될 수 있습니다. 이렇게 하면 나중에 파이프라인 생성을 위해 소요되는 시간을 눈에 띄게 줄일 수 있습니다. 이에 대해서는 파이프라인 캐시 챕터에서 살펴보겠습니다.
10370

104-
The graphics pipeline is required for all common drawing operations, so it
105-
should also only be destroyed at the end of the program:
71+
모든 그리기 연산을 위해서는 그래픽스 파이프라인이 필요하므로 프로그램이 종료될 때에만 해제되어야 합니다.
10672

10773
```c++
10874
void cleanup() {
@@ -112,10 +78,7 @@ void cleanup() {
11278
}
11379
```
11480

115-
Now run your program to confirm that all this hard work has resulted in a
116-
successful pipeline creation! We are already getting quite close to seeing
117-
something pop up on the screen. In the next couple of chapters we'll set up the
118-
actual framebuffers from the swap chain images and prepare the drawing commands.
81+
이제 프로그램을 실행하고 작업에 대한 보상으로 성공적으로 파이프라인이 만들어졌는지 확인하세요! 이제 무언가 화면에 나오기까지 얼마 남지 않았습니다. 다음 몇 개 챕터에서는 스왑 체인으로부터 실제 프레임버퍼를 설정하고 그리기 명령을 준비해 보겠습니다.
11982

12083
[C++ code](/code/12_graphics_pipeline_complete.cpp) /
12184
[Vertex shader](/code/09_shader_base.vert) /

0 commit comments

Comments
 (0)