Skip to content

Commit

Permalink
Simplified typename checks on allocator template types
Browse files Browse the repository at this point in the history
  • Loading branch information
asuessenbach committed Jan 10, 2024
1 parent 180ef2f commit e0546d0
Show file tree
Hide file tree
Showing 7 changed files with 653 additions and 697 deletions.
22 changes: 6 additions & 16 deletions VulkanHppGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11435,27 +11435,17 @@ std::string VulkanHppGenerator::generateTypenameCheck( std::vector<size_t> const
{
extendedElementType = "UniqueHandle<" + elementType + ", Dispatch>";
}
std::string index = std::to_string( i );
if ( definition )
elementType = startUpperCase( stripPrefix( elementType, "VULKAN_HPP_NAMESPACE::" ) );
if ( !enableIf.empty() )
{
typenameCheck += ", typename B" + index;
enableIf += " && ";
}
else
{
typenameCheck += ", typename B" + index + " = " + startUpperCase( stripPrefix( elementType, "VULKAN_HPP_NAMESPACE::" ) ) + "Allocator";
}
enableIf += enableIf.empty() ? ", typename std::enable_if<" : " && ";
enableIf += "std::is_same<typename B" + index + "::value_type, " + extendedElementType + ">::value";
enableIf += "std::is_same<typename " + elementType + "Allocator::value_type, " + extendedElementType + " > ::value ";
}
}
assert( !typenameCheck.empty() );
if ( !typenameCheck.empty() )
if ( !enableIf.empty() )
{
typenameCheck += enableIf + ", int>::type";
if ( !definition )
{
typenameCheck += " = 0";
}
typenameCheck = ", typename std::enable_if<" + enableIf + ", int>::type" + ( definition ? "" : " = 0" );
}
}
return typenameCheck;
Expand Down
4 changes: 2 additions & 2 deletions vulkan/vulkan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL == 1
# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNX__ ) || defined( __Fuchsia__ )
# include <dlfcn.h>
# elif defined( _WIN32 )
# elif defined( _WIN32 ) && !defined( VULKAN_HPP_NO_WIN32_PROTOTYPES )
typedef struct HINSTANCE__ * HINSTANCE;
# if defined( _WIN64 )
typedef int64_t( __stdcall * FARPROC )();
Expand Down Expand Up @@ -16307,7 +16307,7 @@ namespace VULKAN_HPP_NAMESPACE
m_library = dlopen( "libvulkan.1.dylib", RTLD_NOW | RTLD_LOCAL );
}
# elif defined( _WIN32 )
m_library = ::LoadLibraryA( "vulkan-1.dll" );
m_library = ::LoadLibraryA( "vulkan-1.dll" );
# else
# error unsupported platform
# endif
Expand Down
412 changes: 201 additions & 211 deletions vulkan/vulkan_funcs.hpp

Large diffs are not rendered by default.

465 changes: 231 additions & 234 deletions vulkan/vulkan_handles.hpp

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions vulkan/vulkansc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL == 1
# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNX__ ) || defined( __Fuchsia__ )
# include <dlfcn.h>
# elif defined( _WIN32 )
# elif defined( _WIN32 ) && !defined( VULKAN_HPP_NO_WIN32_PROTOTYPES )
typedef struct HINSTANCE__ * HINSTANCE;
# if defined( _WIN64 )
typedef int64_t( __stdcall * FARPROC )();
Expand Down Expand Up @@ -6995,7 +6995,7 @@ namespace VULKAN_HPP_NAMESPACE
m_library = dlopen( "libvulkan.1.dylib", RTLD_NOW | RTLD_LOCAL );
}
# elif defined( _WIN32 )
m_library = ::LoadLibraryA( "vulkan-1.dll" );
m_library = ::LoadLibraryA( "vulkan-1.dll" );
# else
# error unsupported platform
# endif
Expand Down
213 changes: 100 additions & 113 deletions vulkan/vulkansc_funcs.hpp

Large diffs are not rendered by default.

230 changes: 111 additions & 119 deletions vulkan/vulkansc_handles.hpp

Large diffs are not rendered by default.

0 comments on commit e0546d0

Please sign in to comment.