Merge pull request #1057 from asuessenbach/CStructureType

Introduce NativeType to get the C-type from the corresponding Cpp-type.
This commit is contained in:
Andreas Süßenbach 2021-08-31 18:37:48 +02:00 committed by GitHub
commit e0eb94e848
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1469 additions and 46 deletions

View File

@ -7503,6 +7503,7 @@ ${enter} class ${className}
{
public:
using CType = Vk${className};
using NativeType = Vk${className};
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::${objTypeEnum};
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::${debugReportObjectType};
@ -8093,7 +8094,7 @@ std::string VulkanHppGenerator::generateRAIIHandleConstructorArguments( std::str
( specialPointerTypes.find( param.type.type ) == specialPointerTypes.end() ) )
{
// this is supposed to be the returned size on an enumeration function!
#if !defined(NDEBUG)
#if !defined( NDEBUG )
assert( param.type.type == "uint32_t" );
auto typeIt = std::find_if(
params.begin(), params.end(), [&handleType]( ParamData const & pd ) { return pd.type.type == handleType; } );
@ -8548,7 +8549,7 @@ std::string VulkanHppGenerator::generateRAIIHandleConstructorVector(
lenIt = std::find_if( constructorIt->second.params.begin(),
constructorIt->second.params.end(),
[&lenParts]( ParamData const & pd ) { return pd.name == lenParts[0]; } );
#if !defined(NDEBUG)
#if !defined( NDEBUG )
assert( lenIt != constructorIt->second.params.end() );
auto structureIt = m_structures.find( lenIt->type.type );
assert( structureIt != m_structures.end() );
@ -12025,6 +12026,8 @@ std::string VulkanHppGenerator::generateStructure( std::pair<std::string, Struct
static const std::string structureTemplate = R"( struct ${structureName}
{
using NativeType = Vk${structureName};
${allowDuplicate}
${structureType}
${constructorAndSetters}
@ -12132,6 +12135,9 @@ std::string VulkanHppGenerator::generateUnion( std::pair<std::string, StructureD
str += " union " + unionName +
"\n"
" {\n"
" using NativeType = " +
structure.first +
";\n"
"#if !defined( VULKAN_HPP_NO_UNION_CONSTRUCTORS )\n"
" " +
unionName + "( VULKAN_HPP_NAMESPACE::" + unionName +

View File

@ -1237,7 +1237,8 @@ namespace VULKAN_HPP_NAMESPACE
class SurfaceKHR
{
public:
using CType = VkSurfaceKHR;
using CType = VkSurfaceKHR;
using NativeType = VkSurfaceKHR;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eSurfaceKHR;
@ -1333,7 +1334,8 @@ namespace VULKAN_HPP_NAMESPACE
class DebugReportCallbackEXT
{
public:
using CType = VkDebugReportCallbackEXT;
using CType = VkDebugReportCallbackEXT;
using NativeType = VkDebugReportCallbackEXT;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eDebugReportCallbackEXT;
@ -1431,7 +1433,8 @@ namespace VULKAN_HPP_NAMESPACE
class DebugUtilsMessengerEXT
{
public:
using CType = VkDebugUtilsMessengerEXT;
using CType = VkDebugUtilsMessengerEXT;
using NativeType = VkDebugUtilsMessengerEXT;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eDebugUtilsMessengerEXT;
@ -1522,7 +1525,8 @@ namespace VULKAN_HPP_NAMESPACE
class DisplayKHR
{
public:
using CType = VkDisplayKHR;
using CType = VkDisplayKHR;
using NativeType = VkDisplayKHR;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eDisplayKHR;
@ -1618,7 +1622,8 @@ namespace VULKAN_HPP_NAMESPACE
class SwapchainKHR
{
public:
using CType = VkSwapchainKHR;
using CType = VkSwapchainKHR;
using NativeType = VkSwapchainKHR;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eSwapchainKHR;
@ -1715,7 +1720,8 @@ namespace VULKAN_HPP_NAMESPACE
class Semaphore
{
public:
using CType = VkSemaphore;
using CType = VkSemaphore;
using NativeType = VkSemaphore;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eSemaphore;
@ -1810,7 +1816,8 @@ namespace VULKAN_HPP_NAMESPACE
class Fence
{
public:
using CType = VkFence;
using CType = VkFence;
using NativeType = VkFence;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eFence;
@ -1903,7 +1910,8 @@ namespace VULKAN_HPP_NAMESPACE
class PerformanceConfigurationINTEL
{
public:
using CType = VkPerformanceConfigurationINTEL;
using CType = VkPerformanceConfigurationINTEL;
using NativeType = VkPerformanceConfigurationINTEL;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::ePerformanceConfigurationINTEL;
@ -1996,7 +2004,8 @@ namespace VULKAN_HPP_NAMESPACE
class QueryPool
{
public:
using CType = VkQueryPool;
using CType = VkQueryPool;
using NativeType = VkQueryPool;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eQueryPool;
@ -2091,7 +2100,8 @@ namespace VULKAN_HPP_NAMESPACE
class Buffer
{
public:
using CType = VkBuffer;
using CType = VkBuffer;
using NativeType = VkBuffer;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eBuffer;
@ -2185,7 +2195,8 @@ namespace VULKAN_HPP_NAMESPACE
class PipelineLayout
{
public:
using CType = VkPipelineLayout;
using CType = VkPipelineLayout;
using NativeType = VkPipelineLayout;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::ePipelineLayout;
@ -2282,7 +2293,8 @@ namespace VULKAN_HPP_NAMESPACE
class DescriptorSet
{
public:
using CType = VkDescriptorSet;
using CType = VkDescriptorSet;
using NativeType = VkDescriptorSet;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorSet;
@ -2379,7 +2391,8 @@ namespace VULKAN_HPP_NAMESPACE
class ImageView
{
public:
using CType = VkImageView;
using CType = VkImageView;
using NativeType = VkImageView;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eImageView;
@ -2474,7 +2487,8 @@ namespace VULKAN_HPP_NAMESPACE
class Pipeline
{
public:
using CType = VkPipeline;
using CType = VkPipeline;
using NativeType = VkPipeline;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::ePipeline;
@ -2568,7 +2582,8 @@ namespace VULKAN_HPP_NAMESPACE
class Image
{
public:
using CType = VkImage;
using CType = VkImage;
using NativeType = VkImage;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eImage;
@ -2661,7 +2676,8 @@ namespace VULKAN_HPP_NAMESPACE
class AccelerationStructureNV
{
public:
using CType = VkAccelerationStructureNV;
using CType = VkAccelerationStructureNV;
using NativeType = VkAccelerationStructureNV;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eAccelerationStructureNV;
@ -2759,7 +2775,8 @@ namespace VULKAN_HPP_NAMESPACE
class DescriptorUpdateTemplate
{
public:
using CType = VkDescriptorUpdateTemplate;
using CType = VkDescriptorUpdateTemplate;
using NativeType = VkDescriptorUpdateTemplate;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorUpdateTemplate;
@ -2858,7 +2875,8 @@ namespace VULKAN_HPP_NAMESPACE
class Event
{
public:
using CType = VkEvent;
using CType = VkEvent;
using NativeType = VkEvent;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eEvent;
@ -2951,7 +2969,8 @@ namespace VULKAN_HPP_NAMESPACE
class AccelerationStructureKHR
{
public:
using CType = VkAccelerationStructureKHR;
using CType = VkAccelerationStructureKHR;
using NativeType = VkAccelerationStructureKHR;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eAccelerationStructureKHR;
@ -3049,7 +3068,8 @@ namespace VULKAN_HPP_NAMESPACE
class CommandBuffer
{
public:
using CType = VkCommandBuffer;
using CType = VkCommandBuffer;
using NativeType = VkCommandBuffer;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eCommandBuffer;
@ -4752,7 +4772,8 @@ namespace VULKAN_HPP_NAMESPACE
class DeviceMemory
{
public:
using CType = VkDeviceMemory;
using CType = VkDeviceMemory;
using NativeType = VkDeviceMemory;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eDeviceMemory;
@ -4850,7 +4871,8 @@ namespace VULKAN_HPP_NAMESPACE
class VideoSessionKHR
{
public:
using CType = VkVideoSessionKHR;
using CType = VkVideoSessionKHR;
using NativeType = VkVideoSessionKHR;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eVideoSessionKHR;
@ -4941,7 +4963,8 @@ namespace VULKAN_HPP_NAMESPACE
class DeferredOperationKHR
{
public:
using CType = VkDeferredOperationKHR;
using CType = VkDeferredOperationKHR;
using NativeType = VkDeferredOperationKHR;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eDeferredOperationKHR;
@ -5031,7 +5054,8 @@ namespace VULKAN_HPP_NAMESPACE
class BufferView
{
public:
using CType = VkBufferView;
using CType = VkBufferView;
using NativeType = VkBufferView;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eBufferView;
@ -5127,7 +5151,8 @@ namespace VULKAN_HPP_NAMESPACE
class CommandPool
{
public:
using CType = VkCommandPool;
using CType = VkCommandPool;
using NativeType = VkCommandPool;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eCommandPool;
@ -5224,7 +5249,8 @@ namespace VULKAN_HPP_NAMESPACE
class PipelineCache
{
public:
using CType = VkPipelineCache;
using CType = VkPipelineCache;
using NativeType = VkPipelineCache;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::ePipelineCache;
@ -5321,7 +5347,8 @@ namespace VULKAN_HPP_NAMESPACE
class CuFunctionNVX
{
public:
using CType = VkCuFunctionNVX;
using CType = VkCuFunctionNVX;
using NativeType = VkCuFunctionNVX;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eCuFunctionNVX;
@ -5418,7 +5445,8 @@ namespace VULKAN_HPP_NAMESPACE
class CuModuleNVX
{
public:
using CType = VkCuModuleNVX;
using CType = VkCuModuleNVX;
using NativeType = VkCuModuleNVX;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eCuModuleNVX;
@ -5515,7 +5543,8 @@ namespace VULKAN_HPP_NAMESPACE
class DescriptorPool
{
public:
using CType = VkDescriptorPool;
using CType = VkDescriptorPool;
using NativeType = VkDescriptorPool;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorPool;
@ -5612,7 +5641,8 @@ namespace VULKAN_HPP_NAMESPACE
class DescriptorSetLayout
{
public:
using CType = VkDescriptorSetLayout;
using CType = VkDescriptorSetLayout;
using NativeType = VkDescriptorSetLayout;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorSetLayout;
@ -5709,7 +5739,8 @@ namespace VULKAN_HPP_NAMESPACE
class Framebuffer
{
public:
using CType = VkFramebuffer;
using CType = VkFramebuffer;
using NativeType = VkFramebuffer;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eFramebuffer;
@ -5806,7 +5837,8 @@ namespace VULKAN_HPP_NAMESPACE
class IndirectCommandsLayoutNV
{
public:
using CType = VkIndirectCommandsLayoutNV;
using CType = VkIndirectCommandsLayoutNV;
using NativeType = VkIndirectCommandsLayoutNV;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eIndirectCommandsLayoutNV;
@ -5897,7 +5929,8 @@ namespace VULKAN_HPP_NAMESPACE
class PrivateDataSlotEXT
{
public:
using CType = VkPrivateDataSlotEXT;
using CType = VkPrivateDataSlotEXT;
using NativeType = VkPrivateDataSlotEXT;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::ePrivateDataSlotEXT;
@ -5987,7 +6020,8 @@ namespace VULKAN_HPP_NAMESPACE
class RenderPass
{
public:
using CType = VkRenderPass;
using CType = VkRenderPass;
using NativeType = VkRenderPass;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eRenderPass;
@ -6083,7 +6117,8 @@ namespace VULKAN_HPP_NAMESPACE
class Sampler
{
public:
using CType = VkSampler;
using CType = VkSampler;
using NativeType = VkSampler;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eSampler;
@ -6177,7 +6212,8 @@ namespace VULKAN_HPP_NAMESPACE
class SamplerYcbcrConversion
{
public:
using CType = VkSamplerYcbcrConversion;
using CType = VkSamplerYcbcrConversion;
using NativeType = VkSamplerYcbcrConversion;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eSamplerYcbcrConversion;
@ -6276,7 +6312,8 @@ namespace VULKAN_HPP_NAMESPACE
class ShaderModule
{
public:
using CType = VkShaderModule;
using CType = VkShaderModule;
using NativeType = VkShaderModule;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eShaderModule;
@ -6373,7 +6410,8 @@ namespace VULKAN_HPP_NAMESPACE
class ValidationCacheEXT
{
public:
using CType = VkValidationCacheEXT;
using CType = VkValidationCacheEXT;
using NativeType = VkValidationCacheEXT;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eValidationCacheEXT;
@ -6471,7 +6509,8 @@ namespace VULKAN_HPP_NAMESPACE
class VideoSessionParametersKHR
{
public:
using CType = VkVideoSessionParametersKHR;
using CType = VkVideoSessionParametersKHR;
using NativeType = VkVideoSessionParametersKHR;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eVideoSessionParametersKHR;
@ -6563,7 +6602,8 @@ namespace VULKAN_HPP_NAMESPACE
class Queue
{
public:
using CType = VkQueue;
using CType = VkQueue;
using NativeType = VkQueue;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eQueue;
@ -7051,7 +7091,8 @@ namespace VULKAN_HPP_NAMESPACE
class Device
{
public:
using CType = VkDevice;
using CType = VkDevice;
using NativeType = VkDevice;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eDevice;
@ -11437,7 +11478,8 @@ namespace VULKAN_HPP_NAMESPACE
class DisplayModeKHR
{
public:
using CType = VkDisplayModeKHR;
using CType = VkDisplayModeKHR;
using NativeType = VkDisplayModeKHR;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eDisplayModeKHR;
@ -11544,7 +11586,8 @@ namespace VULKAN_HPP_NAMESPACE
class PhysicalDevice
{
public:
using CType = VkPhysicalDevice;
using CType = VkPhysicalDevice;
using NativeType = VkPhysicalDevice;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::ePhysicalDevice;
@ -13064,7 +13107,8 @@ namespace VULKAN_HPP_NAMESPACE
class Instance
{
public:
using CType = VkInstance;
using CType = VkInstance;
using NativeType = VkInstance;
static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType =
VULKAN_HPP_NAMESPACE::ObjectType::eInstance;

File diff suppressed because it is too large Load Diff