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: kr/03_Drawing_a_triangle/02_Graphics_pipeline_basics/04_Conclusion.md
+21-58Lines changed: 21 additions & 58 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff 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` 보다는 전이어야 하는데 이것들이 생성 과정에서 사용되기 때문입니다.
18
9
19
10
```c++
20
11
VkGraphicsPipelineCreateInfo pipelineInfo{};
@@ -23,7 +14,7 @@ pipelineInfo.stageCount = 2;
23
14
pipelineInfo.pStages = shaderStages;
24
15
```
25
16
26
-
We start by referencing the array of `VkPipelineShaderStageCreateInfo` structs.
17
+
`VkPipelineShaderStageCreateInfo`구조체의 배열을 참조하는 것으로 시작합니다.
Then we reference all of the structures describing the fixed-function stage.
30
+
그리고 고정함수 단계를 기술하는 구조체들을 참조합니다.
40
31
41
32
```c++
42
33
pipelineInfo.layout = pipelineLayout;
43
34
```
44
35
45
-
After that comes the pipeline layout, which is a Vulkan handle rather than a
46
-
struct pointer.
36
+
다음으로 파이프라인 레이아웃으로 구조체에 대한 포인터가 아닌 Vulkan 핸들입니다.
47
37
48
38
```c++
49
39
pipelineInfo.renderPass = renderPass;
50
40
pipelineInfo.subpass = 0;
51
41
```
52
42
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)에 설명되어 있지만 그러한 기능은 이 튜토리얼에서는 사용하지 않을 겁니다.
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` 객체를 저장할 클래스 멤버를 준비해 둡시다:
79
54
80
55
```c++
81
56
VkPipeline graphicsPipeline;
82
57
```
83
58
84
-
And finally create the graphics pipeline:
59
+
그리고 최종적으로 그래픽스 파이프라인을 만듭니다:
85
60
86
61
```c++
87
62
if (vkCreateGraphicsPipelines(device, VK_NULL_HANDLE, 1, &pipelineInfo, nullptr, &graphicsPipeline) != VK_SUCCESS) {
88
63
throw std::runtime_error("failed to create graphics pipeline!");
89
64
}
90
65
```
91
66
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`객체를 만들 수 있게 되어있습니다.
96
68
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` 호출을 위해, 파이프라인 생성을 위한 데이터를 저장하고 재사용하는데 사용될 수 있습니다. 만일 캐시가 파일로 저장되어 있다면 다른 프로그램에서도 사용될 수 있습니다. 이렇게 하면 나중에 파이프라인 생성을 위해 소요되는 시간을 눈에 띄게 줄일 수 있습니다. 이에 대해서는 파이프라인 캐시 챕터에서 살펴보겠습니다.
103
70
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
+
모든 그리기 연산을 위해서는 그래픽스 파이프라인이 필요하므로 프로그램이 종료될 때에만 해제되어야 합니다.
106
72
107
73
```c++
108
74
voidcleanup() {
@@ -112,10 +78,7 @@ void cleanup() {
112
78
}
113
79
```
114
80
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
+
이제 프로그램을 실행하고 작업에 대한 보상으로 성공적으로 파이프라인이 만들어졌는지 확인하세요! 이제 무언가 화면에 나오기까지 얼마 남지 않았습니다. 다음 몇 개 챕터에서는 스왑 체인으로부터 실제 프레임버퍼를 설정하고 그리기 명령을 준비해 보겠습니다.
0 commit comments