Introduce version check in function wrappers

The assertions fire when the dispatcher and the actual function call is compiled with different VK_HEADER_VERSION.
This commit is contained in:
asuessenbach
2021-07-19 18:22:47 +02:00
parent f70d4291e4
commit 987bd214e5
4 changed files with 1276 additions and 13 deletions

View File

@@ -1314,8 +1314,22 @@ namespace VULKAN_HPP_NAMESPACE
}
#endif
class DispatchLoaderBase
{
#if !defined( NDEBUG )
public:
size_t getVkHeaderVersion() const
{
return vkHeaderVersion;
}
private:
size_t vkHeaderVersion = VK_HEADER_VERSION;
#endif
};
#if !defined( VK_NO_PROTOTYPES )
class DispatchLoaderStatic
class DispatchLoaderStatic : public DispatchLoaderBase
{
public:
//=== VK_VERSION_1_0 ===
@@ -10351,7 +10365,7 @@ namespace VULKAN_HPP_NAMESPACE
};
#endif
class DispatchLoaderDynamic
class DispatchLoaderDynamic : public DispatchLoaderBase
{
public:
using PFN_dummy = void ( * )();