PrismaticRenderer/Source/Vulkan/Abstraction/peVulkanInstance.cpp
/// <summary>
/// Creates a Vulkan instance
/// </summary>
/// <returns>Vulkan instance</returns>

Creates a Vulkan instance

Vulkan instance
Creates a Vulkan instance Vulkan instance
static VkInstance CreateVkInstance() {
  auto appInfo = pe::ApplicationInfo();
  appInfo.apiVersion = VK_API_VERSION_1_0;
  appInfo.applicationVersion = 1;
  appInfo.engineVersion = 1;
  appInfo.pApplicationName = "PrismaticEngine";
  appInfo.pEngineName = "PrismaticEngine";
  auto createInfo = pe::InstanceCreateInfo();
  createInfo.pApplicationInfo = &appInfo;
  std::vector<const char *> layerNames = {
      "VK_LAYER_LUNARG_standard_validation"};
  createInfo.enabledLayerCount = static_cast<uint32_t>(layerNames.size());
  createInfo.ppEnabledLayerNames = layerNames.data();
  std::vector<const char *> extensionNames = {
      VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_WIN32_SURFACE_EXTENSION_NAME};
  createInfo.enabledExtensionCount =
      static_cast<uint32_t>(extensionNames.size());
  createInfo.ppEnabledExtensionNames = extensionNames.data();
  VkInstance ret;
  VK_EXPECT_SUCCESS(vkCreateInstance(&createInfo, nullptr, &ret));
  return ret;
}
static VkInstance CreateVkInstance ( ) { auto appInfo = pe :: ApplicationInfo ( ) ; appInfo . apiVersion = VK_API_VERSION_1_0 ; appInfo . applicationVersion = 1 ; appInfo . engineVersion = 1 ; appInfo . pApplicationName = " " ; appInfo . pEngineName = " " ; auto createInfo = pe :: InstanceCreateInfo ( ) ; createInfo . pApplicationInfo = & appInfo ; std :: vector < const char * > layerNames = { " " } ; createInfo . enabledLayerCount = static_cast < uint32_t > ( layerNames . size ( ) ) ; createInfo . ppEnabledLayerNames = layerNames . data ( ) ; std :: vector < const char * > extensionNames = { VK_KHR_SURFACE_EXTENSION_NAME , VK_KHR_WIN32_SURFACE_EXTENSION_NAME } ; createInfo . enabledExtensionCount = static_cast < uint32_t > ( extensionNames . size ( ) ) ; createInfo . ppEnabledExtensionNames = extensionNames . data ( ) ; VkInstance ret ; VK_EXPECT_SUCCESS ( vkCreateInstance ( & createInfo , nullptr , & ret ) ) ; return ret ; }
<summary>
Creates a Vulkan instance
</summary>
<returns>Vulkan instance</returns>
<summary > Creates a Vulkan instance < / summary > <returns > Vulkan instance< / returns >
// TODO Check that requested layers actually are supported