-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.txt
More file actions
67 lines (53 loc) · 2.82 KB
/
README.txt
File metadata and controls
67 lines (53 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Documentation Author: Niko Procopi
Vulkan 1.2
As of Feb 15, 2019, the newest version of Vulkan is 1.2.131
This tutorial applies to all future versions of the API
This tutorial has three parts
- How to update the Vulkan SDK within the Visual Studio solution
- How to initialize the newest version of the Vulkan SDK
- How to use new features in new versions of the SDK
The best part about upgrading Vulkan 1.0 to 1.1+ is that we can
flip the viewport upside down, making it so we do not need to
modify the projection matrix every time we want to draw. This is
standard practice in all modern Vulkan projects in the gaming industry
How to update the Vulkan SDK
1. In the directory of this README, delete the Bin, Include, and Lib folders
Caution: GLM is inside the Include folder, you'll need to save that
2. Download and install the latest SDK
https://vulkan.lunarg.com/sdk/home
3. Go to the install directory
Default is C:\VulkanSDK\version
4. Copy and Paste the Bin, Include, and Lib folders from
Vulkan SDK into the directory of this README
5. Compile and run the program, it should work just fine
How to initialize the newest version of Vulkan SDK
Prior to now, we've had the Vulkan 1.1.114 SDK bundled
with each project, but we were initializing Vulkan 1.0.
We did this to ensure compatibility with all Vulkan-enabled
devices, we did not want to exclude anyone with legacy hardware.
Now that we are 20+ tutorials into the series, it is time to move on
void Demo::prepare_instance()
In this function, we have vkCreateInstance function that uses a pointer
to a VkInstanceCreateInfo structure. This structure has the ability to hold
a pointer to a VkApplicationCreateInfo. This was never used, and as a
result, Vulkan 1.0 was initialized.
The apiVersion variable inside VkApplicationInfo will determine which
version of Vulkan API is initialized, in this case we want Vulkan 1.2.
Nothing else in this structure will have any impact on the program or the
performance of the program
This structure is then given to VkCreateInstanceInfo, and then the newer
version of Vulkan is initialized
How to use new Vulkan features
First thing we will do is flip the Viewport. If you try to do this in Vulkan 1.0,
you would get a validation error if validation was enabled, or the program
would crash
In Vulkan 1.1+, we can give the viewport a negative height, so that
the screen does not render upside-down (the way Vulkan is by default)
which can be seen here
Demo::build_secondary_cmd()
Now that we flipped the viewport, we do not need to invert the Y axis
in projection matrices anymore. You can see that it is removed from
Scene.cpp, we can now use unmodifed projection matrices, just like
OpenGL.
This is standard for all modern Vulkan projects in the gaming industry.
It is used in Cemu, Yuzu, RPCS3, GPCS4, Dolphin, and more