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 [Vulkan Graphics Pipeline](https://docs.vulkan.org/spec/latest/chapters/pipelines.html) is a large object that encompasses the entire graphics pipeline. It consists of many stages - all this happens during a single `draw()`call. There is however an extension called[`VK_EXT_shader_object`](https://www.khronos.org/blog/you-can-use-vulkan-without-pipelines-today) which enables avoiding graphics pipelines entirely. Almost all pipeline state becomes dynamic, ie set at draw time, and the only Vulkan handles to own are `ShaderEXT`objects. For a comprehensive guide, check out the [Vulkan Sample from Khronos](https://github.com/KhronosGroup/Vulkan-Samples/tree/main/samples/extensions/shader_object).
3
+
[Vulkan의 그래픽스 파이프라인](https://docs.vulkan.org/spec/latest/chapters/pipelines.html)은 전체 렌더링 과정을 아우르는 거대한 객체로, `draw()`호출 한 번에 여러 단계를 수행합니다. 하지만[`VK_EXT_shader_object`](https://www.khronos.org/blog/you-can-use-vulkan-without-pipelines-today)라는 확장을 사용하면, 이러한 그래픽스 파이프라인 자체를 완전히 생략할 수 있습니다. 이 확장을 사용할 경우 대부분의 파이프라인 상태가 동적으로 설정되며, 그리는 시점에 설정됩니다. 이때 개발자가 직접 다뤄야할 Vulkan 핸들은 `ShaderEXT`객체뿐입니다. 더 자세한 정보는 [여기](https://github.com/KhronosGroup/Vulkan-Samples/tree/main/samples/extensions/shader_object)를 참고하세요.
4
4
5
-
Vulkan requires shader code to be provided as SPIR-V (IR). We shall use `glslc` (part of the Vulkan SDK) to compile GLSL to SPIR-V manually when required.
5
+
Vulkan에서는 셰이더 코드를 SPIR-V 형태로 제공해야 합니다. 우리는 Vulkan SDK에 포함된 `glslc`를 사용해 GLSL 코드를 필요할 때 수동으로 SPIR-V 파일로 컴파일하겠습니다.
Copy file name to clipboardExpand all lines: guide/translations/ko-KR/src/shader_objects/glsl_to_spir_v.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
-
# GLSL to SPIR-V
1
+
# GLSL 에서 SPIR-V
2
2
3
3
Shaders work in NDC space: -1 to +1 for X and Y. We output a triangle's coordinates in a new vertex shader and save it to `src/glsl/shader.vert`:
4
+
셰이더는 NDC 공간 X축과 Y축에서 -1에서 1까지 작동합니다. 새로운 정점 셰이더의 삼각형 좌표계를 출력하고 이를 `src/glsl/shader.vert`에 저장합니다.
4
5
5
6
```glsl
6
7
#version 450 core
@@ -19,6 +20,7 @@ void main() {
19
20
```
20
21
21
22
The fragment shader just outputs white for now, in `src/glsl/shader.frag`:
23
+
`src/glsl/shader.frag`의 프래그먼트 셰이더는 지금은 흰 색을 출력하기만 할 것입니다.
22
24
23
25
```glsl
24
26
#version 450 core
@@ -31,17 +33,20 @@ void main() {
31
33
```
32
34
33
35
Compile both shaders into `assets/`:
36
+
이 둘을 `assets/`로 컴파일합니다.
34
37
35
38
```
36
39
glslc src/glsl/shader.vert -o assets/shader.vert
37
40
glslc src/glsl/shader.frag -o assets/shader.frag
38
41
```
39
42
40
43
> glslc is part of the Vulkan SDK.
44
+
> glslc는 Vulkan SDK의 일부입니다.
41
45
42
-
## Loading SPIR-V
46
+
## SPIR-V 불러오기
43
47
44
48
SPIR-V shaders are binary files with a stride/alignment of 4 bytes. As we have seen, the Vulkan API accepts a span of `std::uint32_t`s, so we need to load it into such a buffer (and _not_`std::vector<std::byte>` or other 1-byte equivalents). Add a helper function in `app.cpp`:
49
+
SPIR-V 셰이더는 4바이트 단위로 정렬이 되어있는 바이너리 파일입니다. 지금까지 봐왔던 대로, Vulkan API는 `std::uint32_t`의 묶음을 받습니다. 따라서 이러한 종류의 버퍼(단, `std::vector<std::byte>` 혹은 다른 종류의 1바이트 컨테이너는 아닙니다)에 담습니다. 이를 돕는 함수를 `app.cpp`에 추가합니다.
Copy file name to clipboardExpand all lines: guide/translations/ko-KR/src/shader_objects/locating_assets.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# Locating Assets
1
+
# 에셋 위치
2
2
3
-
Before we can use shaders, we need to load them as asset/data files. To do that correctly, first the asset directory needs to be located. There are a few ways to go about this, we will use the approach of looking for a particular subdirectory, starting from the working directory and walking up the parent directory tree. This enables `app` in any project/build subdirectory to locate `assets/`in the various examples below:
3
+
셰이더를 사용하기 전에, 에셋 파일들을 불러와야 합니다. 이를 제대로 수행하려면 우선 에셋들이 위치한 경로를 알아야 합니다. 에셋 경로를 찾는 방법에는 여러 가지가 있지만, 우리는 현재 작업 디렉토리에서 시작하여 상위 디렉토리로 올라가며 특정 하위 폴더(`assets/`)를 찾는 방식을 사용할 것입니다. 이렇게 하면 프로젝트나 빌드 디렉토리 어디에서 `app`이 실행되더라도 `assets/`디렉토리를 자동으로 찾아 접근할 수 있게 됩니다.
4
4
5
5
```
6
6
.
@@ -15,11 +15,11 @@ Before we can use shaders, we need to load them as asset/data files. To do that
15
15
|-- app
16
16
```
17
17
18
-
In a release package you would want to use the path to the executable instead (and probably not perform an "upfind" walk), the working directory could be anywhere whereas assets shipped with the package will be in the vicinity of the executable.
18
+
릴리즈 패키지에서는 일반적으로 실행 파일의 경로를 기준으로 에셋 경로를 설정하며, 상위 경로로 거슬러 올라가는 방식은 사용하지 않는 것이 보통입니다. 작업 경로에 상관없이 패키지에 포함된 에셋은 보통 실행 파일과 같은 위치나 그 주변에 위치하기 때문입니다.
19
19
20
-
## Assets Directory
21
-
22
-
Add a member to `App` to store this path to `assets/`:
20
+
## 에셋 경로
21
+
:
22
+
`App`에 `assets/` 경로를 담을 멤버를 추가합니다.
23
23
24
24
```cpp
25
25
namespacefs = std::filesystem;
@@ -28,7 +28,7 @@ namespace fs = std::filesystem;
28
28
fs::path m_assets_dir{};
29
29
```
30
30
31
-
Add a helper function to locate the assets dir, and assign `m_assets_dir` to its return value at the top of `run()`:
31
+
에셋 경로를 찾는 함수를 추가하고, 그 반환값을 `run()` 함수 상단에서 `m_assets_dir`에 저장하세요.
32
32
33
33
```cpp
34
34
[[nodiscard]] auto locate_assets_dir() -> fs::path {
Copy file name to clipboardExpand all lines: guide/translations/ko-KR/src/shader_objects/pipelines.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
# Graphics Pipelines
1
+
# 그래픽스 파이프라인
2
2
3
-
This page describes the usage of Graphics Pipelines _instead of_ Shader Objects. While the guide assumes Shader Object usage, not much should change in the rest of the code if you instead choose to use Graphics Pipelines. A notable exception is the setup of Descriptor Set Layouts: with pipelines it needs to be specified as part of the Pipeline Layout, whereas with Shader Objects it is part of each ShaderEXT's CreateInfo.
3
+
여기서는 셰이더 오브젝트 대신 그래픽스 파이프라인을 사용하는 방법을 설명합니다. 이 가이드는 셰이더 오브젝트를 사용한다고 가정하지만, 그래픽스 파이프라인을 대신 사용하더라도 나머지 코드에는 큰 변화가 없을 것입니다. 다만, 알아둬야할 예외 사항은 디스크립터 셋 레이아웃 설정 방식입니다. 셰이더 오브젝트에서는 ShaderEXT의 CreateInfo에 포함되지만, 파이프라인을 사용할 경우 파이프라인 레이아웃에 지정해야 합니다.
4
4
5
-
## Pipeline State
5
+
## 파이프라인 상태
6
6
7
-
Most dynamic state with Shader Objects is static with pipelines: specified at pipeline creation time. Pipelines also require additional parameters, like attachment formats and sample count: these will be considered constant and stored in the builder later. Expose a subset of dynamic states through a struct:
7
+
셰이더 오브젝트는 대부분의 동적 상태를 런타임에 설정할 수 있었지만, 파이프라인에서는 파이프라인 생성 시점에 고정되기 때문에 정적입니다. 파이프라인은 또한 어태치먼트 포맷과 샘플 수 같은 추가 파라미터를 요구합니다. 이러한 값들은 상수로 간주되어 이후의 추상화 클래스에 담길 것입니다. 동적 상태의 일부를 구조체를 통해 나타냅시다.
8
8
9
9
```cpp
10
10
// bit flags for various binary Pipeline States.
@@ -38,7 +38,7 @@ struct PipelineState {
38
38
};
39
39
```
40
40
41
-
Encapsulate building pipelines into a class:
41
+
파이프라인을 구성하는 과정을 클래스로 캡슐화합시다.
42
42
43
43
```cpp
44
44
struct PipelineBuilderCreateInfo {
@@ -64,7 +64,7 @@ class PipelineBuilder {
64
64
};
65
65
```
66
66
67
-
The implementation is quite verbose, splitting it into multiple functions helps a bit:
67
+
구현은 다소 길어질 수 있으니, 여러 함수로 나누어 작성하는 것이 좋습니다.
68
68
69
69
```cpp
70
70
// single viewport and scissor.
@@ -192,6 +192,7 @@ auto PipelineBuilder::build(vk::PipelineLayout const layout,
192
192
```
193
193
194
194
`App` will need to store a builder, a Pipeline Layout, and the Pipeline(s):
Copy file name to clipboardExpand all lines: guide/translations/ko-KR/src/shader_objects/shader_program.md
+18-17Lines changed: 18 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# Shader Program
1
+
# 셰이더 프로그램
2
2
3
-
To use Shader Objects we need to enable the corresponding feature and extension during device creation:
3
+
셰이더 오브젝트를 사용하려면 디바이스 생성 시 대응되는 기능과 확장을 활성화해야 합니다.
4
4
5
5
```cpp
6
6
auto shader_object_feature =
@@ -15,9 +15,10 @@ static constexpr auto extensions_v = std::array{
15
15
};
16
16
```
17
17
18
-
## Emulation Layer
18
+
## 에뮬레이션 레이어
19
+
20
+
현재 사용중인 드라이버나 물리 디바이스가 `VK_EXT_shader_object`를 지원하지 않을 수 있기 때문에(특히 인텔에서 자주 발생합니다) 디바이스 생성이 실패할 수 있습니다. Vulkan SDK는 이 확장을 구현하는 레이어 [`VK_LAYER_KHRONOS_shader_object`](https://github.com/KhronosGroup/Vulkan-ExtensionLayer/blob/main/docs/shader_object_layer.md)를 제공합니다. 이 레이어를 InstanceCreateInfo에 추가하면 해당 기능을 사용할 수 있습니다.
19
21
20
-
It's possible device creation now fails because the driver or physical device does not support `VK_EXT_shader_object` (especially likely with Intel). Vulkan SDK provides a layer that implements this extension: [`VK_LAYER_KHRONOS_shader_object`](https://github.com/KhronosGroup/Vulkan-ExtensionLayer/blob/main/docs/shader_object_layer.md). Adding this layer to the Instance Create Info should unblock usage of this feature:
This layer <em>is not</em> part of standard Vulkan driver installs, you must package the layer with the application for it to run on environments without Vulkan SDK / Vulkan Configurator. Read more <ahref="https://docs.vulkan.org/samples/latest/samples/extensions/shader_object/README.html#_emulation_layer">here</a>.
36
+
이 레이어는 표준 Vulkan 드라이버 설치에 포함되어 있지 <em>않기</em> 때문에, Vulkan SDK나 Vulkan Configurator가 없는 환경에서도 실행할 수 있도록 애플리케이션과 함께 패키징해야 합니다. 자세한 내용은<ahref="https://docs.vulkan.org/samples/latest/samples/extensions/shader_object/README.html#_emulation_layer">여기</a>를 참고하세요.
36
37
</div>
37
38
38
-
Since desired layers may not be available, we can set up a defensive check:
39
+
원하는 레이어가 사용 불가능할 수 있으므로, 이를 확인하는 코드를 추가하는 것이 좋습니다.
We will encapsulate both vertex and fragment shaders into a single `ShaderProgram`, which will also bind the shaders before a draw, and expose/set various dynamic states.
68
+
정점 셰이더와 프래그먼트 셰이더를 하나의 `ShaderProgram`으로 캡슐화하여, 그리기 전에 셰이더를 바인딩하고 다양한 동적 상태를 설정할 수 있도록 하겠습니다.
68
69
69
-
In `shader_program.hpp`, first add a `ShaderProgramCreateInfo` struct:
70
+
`shader_program.hpp`에서 가장 먼저 `ShaderProgramCreateInfo` 구조체를 추가합니다.
0 commit comments