39 lines
1.3 KiB
Org Mode
39 lines
1.3 KiB
Org Mode
|
#+TITLE: Vulkan Notes
|
||
|
#+AUTHOR: Mars (@pupbrained)
|
||
|
#+EMAIL: mars@pupbrained.xyz
|
||
|
|
||
|
* Main Data Structures
|
||
|
|
||
|
** Instance
|
||
|
*** The most important part
|
||
|
|
||
|
- Purpose :: Serves as the connection between the application and Vulkan itself.
|
||
|
- Usage :: Call src_c++{vk::CreateInstance} and pass in an src_c++{InstanceCreateInfo} object
|
||
|
- Note :: Anything starting with src_c++{p} / src_c++{pp} is a pointer / pointer to a pointer, respectively.
|
||
|
|
||
|
#+begin_src c++
|
||
|
vk::ApplicationInfo appInfo {
|
||
|
.pApplicationName = "Vulkan App", // App name
|
||
|
.applicationVersion = 1, // App version
|
||
|
.pEngineName = "No Engine", // Engine name
|
||
|
.engineVersion = 1, // Engine version
|
||
|
.apiVersion = vk::ApiVersion10 // API compatibility version
|
||
|
};
|
||
|
|
||
|
vk::InstanceCreateInfo createInfo {
|
||
|
.pApplicationInfo = &appInfo, // ApplicationInfo object
|
||
|
.enabledLayerCount = 0, // # of enabled layers
|
||
|
.ppEnabledLayerNames = nullptr, // Names of enabled layers
|
||
|
.enabledExtensionCount = 0, // # of enabled extensions
|
||
|
.ppEnabledExtensionNames = nullptr // Names of enabled extensions
|
||
|
};
|
||
|
|
||
|
vk::Instance instance = vk::createInstance(createInfo);
|
||
|
#+end_src
|
||
|
|
||
|
** DebugUtilsMessenger
|
||
|
*** Used by validation layers
|
||
|
|
||
|
** CreateInfo
|
||
|
*** Information for creation of various objects
|