| 265 | } |
| 266 | |
| 267 | vk::Instance createInstance( std::string const & appName, |
| 268 | std::string const & engineName, |
| 269 | std::vector<std::string> const & layers, |
| 270 | std::vector<std::string> const & extensions, |
| 271 | uint32_t apiVersion ) |
| 272 | { |
| 273 | #if ( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1 ) |
| 274 | VULKAN_HPP_DEFAULT_DISPATCHER.init(); |
| 275 | #endif |
| 276 | |
| 277 | vk::ApplicationInfo applicationInfo( appName.c_str(), 1, engineName.c_str(), 1, apiVersion ); |
| 278 | std::vector<char const *> enabledLayers = vk::su::gatherLayers( layers |
| 279 | #if !defined( NDEBUG ) |
| 280 | , |
| 281 | vk::enumerateInstanceLayerProperties() |
| 282 | #endif |
| 283 | ); |
| 284 | std::vector<char const *> enabledExtensions = vk::su::gatherExtensions( extensions |
| 285 | #if !defined( NDEBUG ) |
| 286 | , |
| 287 | vk::enumerateInstanceExtensionProperties() |
| 288 | #endif |
| 289 | ); |
| 290 | |
| 291 | vk::Instance instance = |
| 292 | vk::createInstance( makeInstanceCreateInfoChain( {}, applicationInfo, enabledLayers, enabledExtensions ).get<vk::InstanceCreateInfo>() ); |
| 293 | |
| 294 | #if ( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1 ) |
| 295 | // initialize function pointers for instance |
| 296 | VULKAN_HPP_DEFAULT_DISPATCHER.init( instance ); |
| 297 | #endif |
| 298 | |
| 299 | return instance; |
| 300 | } |
| 301 | |
| 302 | vk::RenderPass createRenderPass( |
| 303 | vk::Device const & device, vk::Format colorFormat, vk::Format depthFormat, vk::AttachmentLoadOp loadOp, vk::ImageLayout colorFinalLayout ) |