refactored generation of simple commands

This commit is contained in:
asuessenbach 2020-09-17 12:09:43 +02:00
parent 50cfd53e61
commit 860c2b1d4b
3 changed files with 762 additions and 482 deletions

File diff suppressed because it is too large Load Diff

View File

@ -316,16 +316,20 @@ private:
std::string const & name,
CommandData const & commandData,
bool definition ) const;
void appendCommandFixedSizeVector( std::string & str,
std::string const & name,
CommandData const & commandData,
std::map<size_t, size_t> const & vectorParamIndices,
bool definition ) const;
void appendCommandTwoStepTwoVectors( std::string & str,
std::string const & name,
CommandData const & commandData,
std::map<size_t, size_t> const & vectorParamIndices,
bool definition ) const;
void appendCommandEnumerateTwoVectors( std::string & str,
std::string const & name,
CommandData const & commandData,
std::map<size_t, size_t> const & vectorParamIndices,
bool definition ) const;
void appendCommandGetVector( std::string & str,
std::string const & name,
CommandData const & commandData,
std::map<size_t, size_t> const & vectorParamIndices,
bool definition ) const;
void appendCommandSimple( std::string & str,
std::string const & name,
CommandData const & commandData,
bool definition ) const;
void appendDispatchLoaderDynamicCommand( std::string & str,
std::string & emptyFunctions,
std::string & deviceFunctions,
@ -505,19 +509,42 @@ private:
void appendUniqueTypes( std::string & str,
std::string const & parentType,
std::set<std::string> const & childrenTypes ) const;
std::string constructArgumentList( std::vector<ParamData> const & params,
std::set<size_t> const & skippedParams,
bool withAllocators ) const;
std::string constructArgumentListEnhanced( std::vector<ParamData> const & params,
std::set<size_t> const & skippedParams,
bool withAllocators ) const;
std::string constructArgumentListStandard( std::vector<ParamData> const & params,
std::set<size_t> const & skippedParams ) const;
std::string constructCallArguments( std::vector<ParamData> const & params,
std::map<size_t, size_t> const & vectorParamIndices,
bool firstCall ) const;
std::string
constructCommandStandard( std::string const & name, CommandData const & commandData, bool definition ) const;
std::string constructCommandTwoStepTwoVectors( std::string const & name,
bool vectorAsNullptr,
bool enhanced,
bool singular ) const;
std::string constructCommandEnumerateTwoVectors( std::string const & name,
CommandData const & commandData,
std::map<size_t, size_t> const & vectorParamIndices,
bool definition,
bool withAllocators ) const;
std::string constructCommandEnumerateTwoVectorsDeprecated( std::string const & name,
CommandData const & commandData,
std::map<size_t, size_t> const & vectorParamIndices,
bool definition,
bool withAllocators ) const;
std::string constructCommandGetVector( std::string const & name,
CommandData const & commandData,
std::map<size_t, size_t> const & vectorParamIndices,
bool definition ) const;
std::string constructCommandGetVectorDeprecated( std::string const & name,
CommandData const & commandData,
std::map<size_t, size_t> const & vectorParamIndices,
bool definition ) const;
std::string constructCommandGetVectorSingular( std::string const & name,
CommandData const & commandData,
std::map<size_t, size_t> const & vectorParamIndices,
bool definition,
bool withAllocators ) const;
bool definition ) const;
std::string
constructCommandSimple( std::string const & name, CommandData const & commandData, bool definition ) const;
std::string
constructCommandStandard( std::string const & name, CommandData const & commandData, bool definition ) const;
std::string constructConstexprString( std::pair<std::string, StructureData> const & structData ) const;
std::string constructFunctionBodyEnhanced( std::string const & indentation,
std::string const & name,
@ -549,6 +576,10 @@ private:
bool withDefaults,
bool withAllocator ) const;
std::string constructFunctionHeaderArgumentsStandard( CommandData const & commandData, bool withDefaults ) const;
std::string constructNoDiscardEnhanced( CommandData const & commandData ) const;
std::string constructNoDiscardStandard( CommandData const & commandData ) const;
std::string constructReturnType( CommandData const & commandData, std::string const & baseType ) const;
std::string constructSuccessCodeList( std::vector<std::string> const & successCodes ) const;
void checkCorrectness();
bool containsArray( std::string const & type ) const;
bool containsUnion( std::string const & type ) const;
@ -562,6 +593,8 @@ private:
std::string determineSubStruct( std::pair<std::string, StructureData> const & structure ) const;
size_t determineTemplateParamIndex( std::vector<ParamData> const & params,
std::map<size_t, size_t> const & vectorParamIndices ) const;
std::vector<size_t> determineConstPointerParamIndices( std::vector<ParamData> const & params ) const;
std::vector<size_t> determineNonConstPointerParamIndices( std::vector<ParamData> const & params ) const;
std::map<size_t, size_t> determineVectorParamIndices( std::vector<ParamData> const & params ) const;
std::string generateLenInitializer(
std::vector<MemberData>::const_iterator mit,

View File

@ -52729,7 +52729,7 @@ namespace VULKAN_HPP_NAMESPACE
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
Result
VULKAN_HPP_NODISCARD Result
displayPowerControlEXT( VULKAN_HPP_NAMESPACE::DisplayKHR display,
const VULKAN_HPP_NAMESPACE::DisplayPowerInfoEXT * pDisplayPowerInfo,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT;
@ -53092,7 +53092,7 @@ namespace VULKAN_HPP_NAMESPACE
#ifdef VK_ENABLE_BETA_EXTENSIONS
template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
Result getAccelerationStructureCompatibilityKHR(
VULKAN_HPP_NODISCARD Result getAccelerationStructureCompatibilityKHR(
const VULKAN_HPP_NAMESPACE::AccelerationStructureVersionKHR * version,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT;
# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
@ -59235,7 +59235,7 @@ namespace VULKAN_HPP_NAMESPACE
uint32_t queueFamilyIndex,
ArrayProxy<VULKAN_HPP_NAMESPACE::PerformanceCounterKHR> const & counters,
Allocator const & vectorAllocator,
Dispatch const & d ) const;
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename PerformanceCounterKHRAllocator = std::allocator<PerformanceCounterKHR>,
typename PerformanceCounterDescriptionKHRAllocator = std::allocator<PerformanceCounterDescriptionKHR>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
@ -87733,6 +87733,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>(
d.vkBeginCommandBuffer( m_commandBuffer, reinterpret_cast<const VkCommandBufferBeginInfo *>( pBeginInfo ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
@ -90221,6 +90222,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>( d.vkCmdSetPerformanceMarkerINTEL(
m_commandBuffer, reinterpret_cast<const VkPerformanceMarkerInfoINTEL *>( pMarkerInfo ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
@ -90240,6 +90242,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>( d.vkCmdSetPerformanceOverrideINTEL(
m_commandBuffer, reinterpret_cast<const VkPerformanceOverrideInfoINTEL *>( pOverrideInfo ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
@ -90260,6 +90263,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>( d.vkCmdSetPerformanceStreamMarkerINTEL(
m_commandBuffer, reinterpret_cast<const VkPerformanceStreamMarkerInfoINTEL *>( pMarkerInfo ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
@ -91058,6 +91062,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>(
d.vkAcquireProfilingLockKHR( m_device, reinterpret_cast<const VkAcquireProfilingLockInfoKHR *>( pInfo ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
@ -94081,6 +94086,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>( d.vkDebugMarkerSetObjectNameEXT(
m_device, reinterpret_cast<const VkDebugMarkerObjectNameInfoEXT *>( pNameInfo ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
@ -94099,6 +94105,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>(
d.vkDebugMarkerSetObjectTagEXT( m_device, reinterpret_cast<const VkDebugMarkerObjectTagInfoEXT *>( pTagInfo ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
@ -95397,7 +95404,7 @@ namespace VULKAN_HPP_NAMESPACE
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
template <typename Dispatch>
VULKAN_HPP_INLINE Result
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result
Device::displayPowerControlEXT( VULKAN_HPP_NAMESPACE::DisplayKHR display,
const VULKAN_HPP_NAMESPACE::DisplayPowerInfoEXT * pDisplayPowerInfo,
Dispatch const & d ) const VULKAN_HPP_NOEXCEPT
@ -95407,6 +95414,7 @@ namespace VULKAN_HPP_NAMESPACE
static_cast<VkDisplayKHR>( display ),
reinterpret_cast<const VkDisplayPowerInfoEXT *>( pDisplayPowerInfo ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_INLINE typename ResultValueType<void>::type Device::displayPowerControlEXT(
@ -95647,9 +95655,8 @@ namespace VULKAN_HPP_NAMESPACE
Result result = static_cast<Result>(
d.vkGetAccelerationStructureHandleNV( m_device,
static_cast<VkAccelerationStructureKHR>( accelerationStructure ),
data.size() * sizeof( T ),
dataSize,
reinterpret_cast<void *>( data.data() ) ) );
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getAccelerationStructureHandleNV" );
}
@ -95662,9 +95669,8 @@ namespace VULKAN_HPP_NAMESPACE
Result result = static_cast<Result>(
d.vkGetAccelerationStructureHandleNV( m_device,
static_cast<VkAccelerationStructureKHR>( accelerationStructure ),
1 * sizeof( T ),
sizeof( T ),
reinterpret_cast<void *>( &data ) ) );
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getAccelerationStructureHandleNV" );
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
@ -96125,13 +96131,14 @@ namespace VULKAN_HPP_NAMESPACE
#ifdef VK_ENABLE_BETA_EXTENSIONS
template <typename Dispatch>
VULKAN_HPP_INLINE Result Device::getAccelerationStructureCompatibilityKHR(
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getAccelerationStructureCompatibilityKHR(
const VULKAN_HPP_NAMESPACE::AccelerationStructureVersionKHR * version,
Dispatch const & d ) const VULKAN_HPP_NOEXCEPT
{
return static_cast<Result>( d.vkGetDeviceAccelerationStructureCompatibilityKHR(
m_device, reinterpret_cast<const VkAccelerationStructureVersionKHR *>( version ) ) );
}
# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_INLINE typename ResultValueType<void>::type
@ -97608,11 +97615,10 @@ namespace VULKAN_HPP_NAMESPACE
static_cast<VkQueryPool>( queryPool ),
firstQuery,
queryCount,
data.size() * sizeof( T ),
dataSize,
reinterpret_cast<void *>( data.data() ),
static_cast<VkDeviceSize>( stride ),
static_cast<VkQueryResultFlags>( flags ) ) );
return createResultValue( result,
data,
VULKAN_HPP_NAMESPACE_STRING "::Device::getQueryPoolResults",
@ -97633,14 +97639,13 @@ namespace VULKAN_HPP_NAMESPACE
static_cast<VkQueryPool>( queryPool ),
firstQuery,
queryCount,
1 * sizeof( T ),
sizeof( T ),
reinterpret_cast<void *>( &data ),
static_cast<VkDeviceSize>( stride ),
static_cast<VkQueryResultFlags>( flags ) ) );
return createResultValue( result,
data,
VULKAN_HPP_NAMESPACE_STRING "::Device::getQueryPoolResults",
VULKAN_HPP_NAMESPACE_STRING "::Device::getQueryPoolResult",
{ Result::eSuccess, Result::eNotReady } );
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
@ -97696,9 +97701,8 @@ namespace VULKAN_HPP_NAMESPACE
static_cast<VkPipeline>( pipeline ),
firstGroup,
groupCount,
data.size() * sizeof( T ),
dataSize,
reinterpret_cast<void *>( data.data() ) ) );
return createResultValue(
result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingCaptureReplayShaderGroupHandlesKHR" );
}
@ -97716,11 +97720,10 @@ namespace VULKAN_HPP_NAMESPACE
static_cast<VkPipeline>( pipeline ),
firstGroup,
groupCount,
1 * sizeof( T ),
sizeof( T ),
reinterpret_cast<void *>( &data ) ) );
return createResultValue(
result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingCaptureReplayShaderGroupHandlesKHR" );
result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingCaptureReplayShaderGroupHandleKHR" );
}
# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VK_ENABLE_BETA_EXTENSIONS*/
@ -97775,9 +97778,8 @@ namespace VULKAN_HPP_NAMESPACE
static_cast<VkPipeline>( pipeline ),
firstGroup,
groupCount,
data.size() * sizeof( T ),
dataSize,
reinterpret_cast<void *>( data.data() ) ) );
return createResultValue(
result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandlesKHR" );
}
@ -97794,11 +97796,9 @@ namespace VULKAN_HPP_NAMESPACE
static_cast<VkPipeline>( pipeline ),
firstGroup,
groupCount,
1 * sizeof( T ),
sizeof( T ),
reinterpret_cast<void *>( &data ) ) );
return createResultValue(
result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandlesKHR" );
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandleKHR" );
}
# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VK_ENABLE_BETA_EXTENSIONS*/
@ -97852,9 +97852,8 @@ namespace VULKAN_HPP_NAMESPACE
static_cast<VkPipeline>( pipeline ),
firstGroup,
groupCount,
data.size() * sizeof( T ),
dataSize,
reinterpret_cast<void *>( data.data() ) ) );
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandlesNV" );
}
@ -97870,10 +97869,9 @@ namespace VULKAN_HPP_NAMESPACE
static_cast<VkPipeline>( pipeline ),
firstGroup,
groupCount,
1 * sizeof( T ),
sizeof( T ),
reinterpret_cast<void *>( &data ) ) );
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandlesNV" );
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandleNV" );
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
@ -98311,6 +98309,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>(
d.vkImportFenceFdKHR( m_device, reinterpret_cast<const VkImportFenceFdInfoKHR *>( pImportFenceFdInfo ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
@ -98331,6 +98330,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>( d.vkImportFenceWin32HandleKHR(
m_device, reinterpret_cast<const VkImportFenceWin32HandleInfoKHR *>( pImportFenceWin32HandleInfo ) ) );
}
# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
@ -98352,6 +98352,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>( d.vkImportSemaphoreFdKHR(
m_device, reinterpret_cast<const VkImportSemaphoreFdInfoKHR *>( pImportSemaphoreFdInfo ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
@ -98372,6 +98373,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>( d.vkImportSemaphoreWin32HandleKHR(
m_device, reinterpret_cast<const VkImportSemaphoreWin32HandleInfoKHR *>( pImportSemaphoreWin32HandleInfo ) ) );
}
# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
@ -98393,6 +98395,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>( d.vkInitializePerformanceApiINTEL(
m_device, reinterpret_cast<const VkInitializePerformanceApiInfoINTEL *>( pInitializeInfo ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
@ -98802,6 +98805,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>( d.vkSetDebugUtilsObjectNameEXT(
m_device, reinterpret_cast<const VkDebugUtilsObjectNameInfoEXT *>( pNameInfo ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
@ -98820,6 +98824,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>(
d.vkSetDebugUtilsObjectTagEXT( m_device, reinterpret_cast<const VkDebugUtilsObjectTagInfoEXT *>( pTagInfo ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
@ -98941,6 +98946,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>(
d.vkSignalSemaphore( m_device, reinterpret_cast<const VkSemaphoreSignalInfo *>( pSignalInfo ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
@ -98959,6 +98965,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>(
d.vkSignalSemaphoreKHR( m_device, reinterpret_cast<const VkSemaphoreSignalInfo *>( pSignalInfo ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type