Skip to content

Commit 6d6b4d6

Browse files
committed
Update guide
1 parent 3b2a39c commit 6d6b4d6

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

guide/src/initialization/instance.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Instead of linking to Vulkan (via the SDK) at build-time, we will load Vulkan at
66
1. In `app.cpp` this line is added to the global scope: `VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE`
77
1. Before and during initialization `VULKAN_HPP_DEFAULT_DISPATCHER.init()` is called
88

9-
The first thing to do in Vulkan is to create a `vk::Instance`, which will enable enumeration of physical devices (GPUs) and creation of a logical device.
9+
The first thing to do in Vulkan is to create an [Instance](https://registry.khronos.org/vulkan/specs/latest/man/html/VkInstance.html), which will enable enumeration of physical devices (GPUs) and creation of a logical device.
1010

1111
Since we require Vulkan 1.3, store that in a constant to be easily referenced:
1212

@@ -54,9 +54,13 @@ Create a `vk::InstanceCreateInfo` object and fill it up:
5454
extensions);
5555
```
5656

57-
Add a `vk::UniqueInstance` member, create it, and initialize the dispatcher against it:
57+
Add a `vk::UniqueInstance` member _after_ `m_window`: this must be destroyed before terminating GLFW. Create it, and initialize the dispatcher against it:
5858

5959
```cpp
60+
glfw::Window m_window{};
61+
vk::UniqueInstance m_instance{};
62+
63+
// ...
6064
m_instance = vk::createInstanceUnique(instance_ci);
6165
VULKAN_HPP_DEFAULT_DISPATCHER.init(*m_instance);
6266
```

guide/src/initialization/surface.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Vulkan Surface
22

3-
Being platform agnostic, Vulkan interfaces with the WSI via the [`VK_KHR_surface` extension](https://registry.khronos.org/vulkan/specs/latest/man/html/VK_KHR_surface.html).
3+
Being platform agnostic, Vulkan interfaces with the WSI via the [`VK_KHR_surface` extension](https://registry.khronos.org/vulkan/specs/latest/man/html/VK_KHR_surface.html). A [Surface](https://registry.khronos.org/vulkan/specs/latest/man/html/VkSurfaceKHR.html) enables displaying images on the window through the presentation engine.
44

55
Add another helper function in `window.hpp/cpp`:
66

@@ -17,7 +17,7 @@ auto glfw::create_surface(GLFWwindow* window, vk::Instance const instance)
1717
}
1818
```
1919
20-
Add corrseponding members to `App` and create the surface:
20+
Add a `vk::UniqueSurfaceKHR` member to `App` after `m_instance`, and create the surface:
2121
2222
```cpp
2323
void App::create_surface() {

0 commit comments

Comments
 (0)