MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Hpp / createInstance

Function createInstance

samples/utils/utils.cpp:267–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 )

Callers 15

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 2

initMethod · 0.45

Tested by

no test coverage detected