mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Update in README.md (#1624)
This commit is contained in:
parent
99027b5a24
commit
d8cd233010
@ -488,6 +488,7 @@ Creating a full featured ```DispatchLoaderDynamic``` is a two- to three-step pro
|
||||
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = dl.getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr");
|
||||
VULKAN_HPP_DEFAULT_DISPATCHER.init(vkGetInstanceProcAddr);
|
||||
```
|
||||
- Note that you need to keep that vk::DynamicLoader alive until after the last call to a vulkan function in your program. For example by making it static, or storing it somewhere globally.
|
||||
2. initialize it with a vk::Instance to get all the other function pointers:
|
||||
```c++
|
||||
vk::Instance instance = vk::createInstance({}, nullptr);
|
||||
|
@ -42,7 +42,7 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
|
||||
#if ( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1 )
|
||||
// initialize the DipatchLoaderDynamic to use
|
||||
static vk::DynamicLoader dl;
|
||||
vk::DynamicLoader dl;
|
||||
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = dl.getProcAddress<PFN_vkGetInstanceProcAddr>( "vkGetInstanceProcAddr" );
|
||||
VULKAN_HPP_DEFAULT_DISPATCHER.init( vkGetInstanceProcAddr );
|
||||
#endif
|
||||
|
@ -121,7 +121,7 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
{
|
||||
#if ( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1 )
|
||||
// initialize the DipatchLoaderDynamic to use
|
||||
static vk::DynamicLoader dl;
|
||||
vk::DynamicLoader dl;
|
||||
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = dl.getProcAddress<PFN_vkGetInstanceProcAddr>( "vkGetInstanceProcAddr" );
|
||||
VULKAN_HPP_DEFAULT_DISPATCHER.init( vkGetInstanceProcAddr );
|
||||
#endif
|
||||
|
@ -33,7 +33,7 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
{
|
||||
#if ( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1 )
|
||||
// initialize the DipatchLoaderDynamic to use
|
||||
static vk::DynamicLoader dl;
|
||||
vk::DynamicLoader dl;
|
||||
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = dl.getProcAddress<PFN_vkGetInstanceProcAddr>( "vkGetInstanceProcAddr" );
|
||||
VULKAN_HPP_DEFAULT_DISPATCHER.init( vkGetInstanceProcAddr );
|
||||
#endif
|
||||
|
@ -50,7 +50,7 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
{
|
||||
// need to initialize the dynamic dispatcher before the very first vulkan call
|
||||
#if ( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1 )
|
||||
static vk::DynamicLoader dl;
|
||||
vk::DynamicLoader dl;
|
||||
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = dl.getProcAddress<PFN_vkGetInstanceProcAddr>( "vkGetInstanceProcAddr" );
|
||||
VULKAN_HPP_DEFAULT_DISPATCHER.init( vkGetInstanceProcAddr );
|
||||
#endif
|
||||
@ -93,7 +93,6 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
.getSurfaceCapabilities2KHR<vk::SurfaceCapabilities2KHR,
|
||||
vk::DisplayNativeHdrSurfaceCapabilitiesAMD,
|
||||
vk::SharedPresentSurfaceCapabilitiesKHR,
|
||||
vk::SurfaceCapabilitiesFullScreenExclusiveEXT,
|
||||
vk::SurfaceProtectedCapabilitiesKHR>( surfaceData.surface );
|
||||
|
||||
vk::SurfaceCapabilitiesKHR const & surfaceCapabilities = surfaceCapabilities2.get<vk::SurfaceCapabilities2KHR>().surfaceCapabilities;
|
||||
@ -117,16 +116,6 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
std::cout << "\n";
|
||||
}
|
||||
|
||||
if ( vk::su::contains( extensionProperties, "VK_EXT_full_screen_exclusive" ) )
|
||||
{
|
||||
vk::SurfaceCapabilitiesFullScreenExclusiveEXT surfaceCapabilitiesFullScreenExclusive =
|
||||
surfaceCapabilities2.get<vk::SurfaceCapabilitiesFullScreenExclusiveEXT>();
|
||||
std::cout << std::string( "\t" ) << "SurfaceCapabilitiesFullScreenExclusiveEXT:\n";
|
||||
std::cout << std::string( "\t\t" ) << "fullScreenExclusiveSupported = " << !!surfaceCapabilitiesFullScreenExclusive.fullScreenExclusiveSupported
|
||||
<< "\n";
|
||||
std::cout << "\n";
|
||||
}
|
||||
|
||||
if ( vk::su::contains( extensionProperties, "VK_KHR_surface_protected_capabilities" ) )
|
||||
{
|
||||
vk::SurfaceProtectedCapabilitiesKHR surfaceProtectedCapabilities = surfaceCapabilities2.get<vk::SurfaceProtectedCapabilitiesKHR>();
|
||||
|
Loading…
Reference in New Issue
Block a user