diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 3950731..43c73f7 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -1912,7 +1912,8 @@ std::string VulkanHppGenerator::combineDataTypes( std::map const std::vector const & returnParams, bool singular, bool enumerating, - std::vector const & dataTypes ) const + std::vector const & dataTypes, + bool raii ) const { assert( dataTypes.size() == returnParams.size() ); @@ -1922,7 +1923,8 @@ std::string VulkanHppGenerator::combineDataTypes( std::map const auto vectorParamIt = vectorParams.find( returnParams[i] ); modifiedDataTypes[i] = ( vectorParamIt == vectorParams.end() || singular ) ? dataTypes[i] - : ( "std::vector<" + dataTypes[i] + ", " + startUpperCase( stripPrefix( dataTypes[i], "VULKAN_HPP_NAMESPACE::" ) ) + "Allocator>" ); + : ( "std::vector<" + dataTypes[i] + + ( raii ? ">" : ( ", " + startUpperCase( stripPrefix( dataTypes[i], "VULKAN_HPP_NAMESPACE::" ) ) + "Allocator>" ) ) ); } std::string combinedType; @@ -3155,8 +3157,8 @@ std::string VulkanHppGenerator::generateCallSequence( std::string const & auto vectorParamIt = vectorParams.find( returnParams[1] ); assert( ( vectorParamIt != vectorParams.end() ) && ( vectorParamIt->second == returnParams[0] ) ); - std::string firstCallArguments = generateCallArgumentsEnhanced( commandData, initialSkipCount, true, {}, templatedParams, false ); - std::string secondCallArguments = generateCallArgumentsEnhanced( commandData, initialSkipCount, false, {}, templatedParams, false ); + std::string firstCallArguments = generateCallArgumentsEnhanced( commandData, initialSkipCount, true, {}, templatedParams, raii ); + std::string secondCallArguments = generateCallArgumentsEnhanced( commandData, initialSkipCount, false, {}, templatedParams, raii ); std::string vectorName = startLowerCase( stripPrefix( commandData.params[vectorParamIt->first].name, "p" ) ); std::string vectorSize = startLowerCase( stripPrefix( commandData.params[vectorParamIt->second].name, "p" ) ); @@ -3444,7 +3446,7 @@ std::string VulkanHppGenerator::generateCommandEnhanced( std::string const & bool enumerating = determineEnumeration( vectorParams, returnParams ); std::vector dataTypes = determineDataTypes( commandData.params, vectorParams, returnParams, templatedParams ); - std::string dataType = combineDataTypes( vectorParams, returnParams, singular, enumerating, dataTypes ); + std::string dataType = combineDataTypes( vectorParams, returnParams, singular, enumerating, dataTypes, false ); std::string argumentTemplates = generateArgumentTemplates( commandData.params, returnParams, vectorParams, templatedParams, chained, false ); auto [allocatorTemplates, uniqueHandleAllocatorTemplates] = @@ -6141,7 +6143,7 @@ std::string VulkanHppGenerator::generateRAIIHandleCommandEnhanced( std::map dataTypes = determineDataTypes( commandIt->second.params, vectorParams, returnParams, templatedParams ); - std::string dataType = combineDataTypes( vectorParams, returnParams, false, enumerating, dataTypes ); + std::string dataType = combineDataTypes( vectorParams, returnParams, false, enumerating, dataTypes, true ); std::string argumentTemplates = generateArgumentTemplates( commandIt->second.params, returnParams, vectorParams, templatedParams, chained, true ); std::string argumentList = @@ -6168,6 +6170,7 @@ ${vectorSizeCheck} ${dataDeclarations} ${callSequence} ${resultCheck} + ${dataPreparation} ${returnStatement} } )"; @@ -6178,6 +6181,8 @@ ${vectorSizeCheck} std::string returnVariable = generateReturnVariable( commandIt->second, returnParams, vectorParams, chained, false ); std::string dataDeclarations = generateDataDeclarations( commandIt->second, returnParams, vectorParams, templatedParams, false, false, chained, false, dataTypes, dataType, returnType, returnVariable ); + std::string dataPreparation = + generateDataPreparation( commandIt->second, initialSkipCount, returnParams, vectorParams, templatedParams, false, false, false, chained, enumerating ); std::string resultCheck = generateResultCheck( commandIt->second, className, "::", commandName, enumerating ); std::string returnStatement = generateReturnStatement( commandIt->first, commandIt->second, @@ -6200,6 +6205,7 @@ ${vectorSizeCheck} { "className", className }, { "commandName", commandName }, { "dataDeclarations", dataDeclarations }, + { "dataPreparation", dataPreparation }, { "functionPointerCheck", generateFunctionPointerCheck( commandIt->first, commandIt->second.referencedIn ) }, { "nodiscard", nodiscard }, { "noexcept", noexceptString }, @@ -7787,7 +7793,7 @@ std::string VulkanHppGenerator::generateRAIIHandleCommandVoid( std::mapfirst ) { - str = generateRAIIHandleCommandVoid2ReturnEnumerateValue( commandIt, initialSkipCount, vectorParams, returnParams, definition ); + str = generateRAIIHandleCommandEnhanced( commandIt, initialSkipCount, returnParams, vectorParams, definition, false ); if ( isStructureChainAnchor( commandIt->second.params[returnParams[1]].type.type ) ) { str += generateRAIIHandleCommandVoid2ReturnEnumerateChain( commandIt, initialSkipCount, vectorParams, returnParams, definition ); @@ -7991,87 +7997,6 @@ std::string VulkanHppGenerator::generateRAIIHandleCommandVoid2ReturnEnumerateCha } } -std::string VulkanHppGenerator::generateRAIIHandleCommandVoid2ReturnEnumerateValue( std::map::const_iterator commandIt, - size_t initialSkipCount, - std::map const & vectorParams, - std::vector const & returnParams, - bool definition ) const -{ - std::set skippedParams = determineSkippedParams( commandIt->second.params, initialSkipCount, vectorParams, returnParams, false ); - std::set templatedParams = determineVoidPointerParams( commandIt->second.params ); - std::string argumentList = - generateArgumentListEnhanced( commandIt->second.params, returnParams, vectorParams, skippedParams, {}, templatedParams, definition, false, false, false ); - std::string argumentTemplates = generateArgumentTemplates( commandIt->second.params, returnParams, vectorParams, templatedParams, false, true ); - std::string commandName = generateCommandName( commandIt->first, commandIt->second.params, initialSkipCount, m_tags, false, false ); - std::string vectorElementType = ( templatedParams.find( vectorParams.begin()->first ) == templatedParams.end() ) - ? stripPostfix( commandIt->second.params[vectorParams.begin()->first].type.compose( "VULKAN_HPP_NAMESPACE" ), "*" ) - : ( stripPrefix( commandIt->second.params[vectorParams.begin()->first].name, "p" ) + "Type" ); - - if ( definition ) - { - const std::string definitionTemplate = - R"( - ${argumentTemplates} - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector<${vectorElementType}> ${className}::${commandName}( ${argumentList} ) const VULKAN_HPP_NOEXCEPT - {${functionPointerCheck} - ${counterType} ${counterName}; - getDispatcher()->${vkCommand}( ${firstCallArguments} );${templateArgumentSizeAssert} - std::vector<${vectorElementType}> ${vectorName}( ${vectorSize} ); - getDispatcher()->${vkCommand}( ${secondCallArguments} ); - VULKAN_HPP_ASSERT( ${counterName} == ${vectorName}.size()${timesTemplateTypeSize} ); - return ${vectorName}; - } -)"; - - std::string counterName = startLowerCase( stripPrefix( commandIt->second.params[vectorParams.begin()->second].name, "p" ) ); - std::string firstCallArguments = generateCallArgumentsEnhanced( commandIt->second, initialSkipCount, true, {}, templatedParams, true ); - std::string secondCallArguments = generateCallArgumentsEnhanced( commandIt->second, initialSkipCount, false, {}, templatedParams, true ); - std::string templateArgumentSizeAssert, timesTemplateTypeSize, vectorSize; - if ( templatedParams.find( vectorParams.begin()->first ) == templatedParams.end() ) - { - vectorSize = counterName; - } - else - { - templateArgumentSizeAssert = "\n VULKAN_HPP_ASSERT( " + counterName + " % sizeof( " + vectorElementType + " ) == 0 );"; - timesTemplateTypeSize = " * sizeof( " + vectorElementType + " )"; - vectorSize = counterName + " / sizeof( " + vectorElementType + " )"; - } - std::string vectorName = startLowerCase( stripPrefix( commandIt->second.params[vectorParams.begin()->first].name, "p" ) ); - - return replaceWithMap( definitionTemplate, - { { "argumentList", argumentList }, - { "argumentTemplates", argumentTemplates }, - { "className", stripPrefix( commandIt->second.params[initialSkipCount - 1].type.type, "Vk" ) }, - { "commandName", commandName }, - { "counterName", counterName }, - { "counterType", commandIt->second.params[vectorParams.begin()->second].type.type }, - { "firstCallArguments", firstCallArguments }, - { "functionPointerCheck", generateFunctionPointerCheck( commandIt->first, commandIt->second.referencedIn ) }, - { "secondCallArguments", secondCallArguments }, - { "templateArgumentSizeAssert", templateArgumentSizeAssert }, - { "timesTemplateTypeSize", timesTemplateTypeSize }, - { "vectorElementType", vectorElementType }, - { "vectorName", vectorName }, - { "vectorSize", vectorSize }, - { "vkCommand", commandIt->first } } ); - } - else - { - std::string const declarationTemplate = - R"( - ${argumentTemplates} - VULKAN_HPP_NODISCARD std::vector<${vectorElementType}> ${commandName}( ${argumentList} ) const VULKAN_HPP_NOEXCEPT; -)"; - - return replaceWithMap( declarationTemplate, - { { "argumentList", argumentList }, - { "argumentTemplates", argumentTemplates }, - { "commandName", commandName }, - { "vectorElementType", vectorElementType } } ); - } -} - std::pair VulkanHppGenerator::generateRAIIHandleConstructor( std::pair const & handle, std::map::const_iterator constructorIt, diff --git a/VulkanHppGenerator.hpp b/VulkanHppGenerator.hpp index f385972..bff422e 100644 --- a/VulkanHppGenerator.hpp +++ b/VulkanHppGenerator.hpp @@ -400,7 +400,8 @@ private: std::vector const & returnParams, bool singular, bool enumerating, - std::vector const & dataTypes ) const; + std::vector const & dataTypes, + bool raii ) const; bool containsArray( std::string const & type ) const; bool containsFuncPointer( std::string const & type ) const; bool containsFloatingPoints( std::vector const & members ) const; @@ -816,11 +817,6 @@ private: std::map const & vectorParamIndices, std::vector const & returnParamIndices, bool definition ) const; - std::string generateRAIIHandleCommandVoid2ReturnEnumerateValue( std::map::const_iterator commandIt, - size_t initialSkipCount, - std::map const & vectorParamIndices, - std::vector const & returnParamIndices, - bool definition ) const; std::pair generateRAIIHandleConstructor( std::pair const & handle, std::map::const_iterator constructorIt, std::string const & enter, diff --git a/vulkan/vulkan_raii.hpp b/vulkan/vulkan_raii.hpp index 82e159e..7ea28bd 100644 --- a/vulkan/vulkan_raii.hpp +++ b/vulkan/vulkan_raii.hpp @@ -10213,6 +10213,7 @@ namespace VULKAN_HPP_NAMESPACE static_cast( flags ), reinterpret_cast( &imageFormatProperties ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getImageFormatProperties" ); + return imageFormatProperties; } @@ -10228,13 +10229,19 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector PhysicalDevice::getQueueFamilyProperties() const VULKAN_HPP_NOEXCEPT { - uint32_t queueFamilyPropertyCount; + std::vector queueFamilyProperties; + uint32_t queueFamilyPropertyCount; getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties( static_cast( m_physicalDevice ), &queueFamilyPropertyCount, nullptr ); - std::vector queueFamilyProperties( queueFamilyPropertyCount ); + queueFamilyProperties.resize( queueFamilyPropertyCount ); getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties( static_cast( m_physicalDevice ), &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); - VULKAN_HPP_ASSERT( queueFamilyPropertyCount == queueFamilyProperties.size() ); + + VULKAN_HPP_ASSERT( queueFamilyPropertyCount <= queueFamilyProperties.size() ); + if ( queueFamilyPropertyCount < queueFamilyProperties.size() ) + { + queueFamilyProperties.resize( queueFamilyPropertyCount ); + } return queueFamilyProperties; } @@ -10439,6 +10446,7 @@ namespace VULKAN_HPP_NAMESPACE static_cast( flags ), &pData ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::DeviceMemory::mapMemory" ); + return pData; } @@ -10507,15 +10515,21 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector Image::getSparseMemoryRequirements() const VULKAN_HPP_NOEXCEPT { - uint32_t sparseMemoryRequirementCount; + std::vector sparseMemoryRequirements; + uint32_t sparseMemoryRequirementCount; getDispatcher()->vkGetImageSparseMemoryRequirements( static_cast( m_device ), static_cast( m_image ), &sparseMemoryRequirementCount, nullptr ); - std::vector sparseMemoryRequirements( sparseMemoryRequirementCount ); + sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); getDispatcher()->vkGetImageSparseMemoryRequirements( static_cast( m_device ), static_cast( m_image ), &sparseMemoryRequirementCount, reinterpret_cast( sparseMemoryRequirements.data() ) ); - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount == sparseMemoryRequirements.size() ); + + VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); + if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) + { + sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); + } return sparseMemoryRequirements; } @@ -10526,7 +10540,8 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, VULKAN_HPP_NAMESPACE::ImageTiling tiling ) const VULKAN_HPP_NOEXCEPT { - uint32_t propertyCount; + std::vector properties; + uint32_t propertyCount; getDispatcher()->vkGetPhysicalDeviceSparseImageFormatProperties( static_cast( m_physicalDevice ), static_cast( format ), static_cast( type ), @@ -10535,7 +10550,7 @@ namespace VULKAN_HPP_NAMESPACE static_cast( tiling ), &propertyCount, nullptr ); - std::vector properties( propertyCount ); + properties.resize( propertyCount ); getDispatcher()->vkGetPhysicalDeviceSparseImageFormatProperties( static_cast( m_physicalDevice ), static_cast( format ), static_cast( type ), @@ -10544,7 +10559,12 @@ namespace VULKAN_HPP_NAMESPACE static_cast( tiling ), &propertyCount, reinterpret_cast( properties.data() ) ); - VULKAN_HPP_ASSERT( propertyCount == properties.size() ); + + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + if ( propertyCount < properties.size() ) + { + properties.resize( propertyCount ); + } return properties; } @@ -10574,6 +10594,7 @@ namespace VULKAN_HPP_NAMESPACE resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Fence::getStatus", { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eNotReady } ); + return static_cast( result ); } @@ -10585,6 +10606,7 @@ namespace VULKAN_HPP_NAMESPACE resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::waitForFences", { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eTimeout } ); + return static_cast( result ); } @@ -10608,6 +10630,7 @@ namespace VULKAN_HPP_NAMESPACE resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Event::getStatus", { VULKAN_HPP_NAMESPACE::Result::eEventSet, VULKAN_HPP_NAMESPACE::Result::eEventReset } ); + return static_cast( result ); } @@ -11347,6 +11370,7 @@ namespace VULKAN_HPP_NAMESPACE uint32_t apiVersion; VkResult result = getDispatcher()->vkEnumerateInstanceVersion( &apiVersion ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Context::enumerateInstanceVersion" ); + return apiVersion; } @@ -11477,15 +11501,21 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector Device::getImageSparseMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 & info ) const VULKAN_HPP_NOEXCEPT { - uint32_t sparseMemoryRequirementCount; + std::vector sparseMemoryRequirements; + uint32_t sparseMemoryRequirementCount; getDispatcher()->vkGetImageSparseMemoryRequirements2( static_cast( m_device ), reinterpret_cast( &info ), &sparseMemoryRequirementCount, nullptr ); - std::vector sparseMemoryRequirements( sparseMemoryRequirementCount ); + sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); getDispatcher()->vkGetImageSparseMemoryRequirements2( static_cast( m_device ), reinterpret_cast( &info ), &sparseMemoryRequirementCount, reinterpret_cast( sparseMemoryRequirements.data() ) ); - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount == sparseMemoryRequirements.size() ); + + VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); + if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) + { + sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); + } return sparseMemoryRequirements; } @@ -11560,6 +11590,7 @@ namespace VULKAN_HPP_NAMESPACE reinterpret_cast( &imageFormatInfo ), reinterpret_cast( &imageFormatProperties ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getImageFormatProperties2" ); + return imageFormatProperties; } @@ -11583,13 +11614,19 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector PhysicalDevice::getQueueFamilyProperties2() const VULKAN_HPP_NOEXCEPT { - uint32_t queueFamilyPropertyCount; + std::vector queueFamilyProperties; + uint32_t queueFamilyPropertyCount; getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties2( static_cast( m_physicalDevice ), &queueFamilyPropertyCount, nullptr ); - std::vector queueFamilyProperties( queueFamilyPropertyCount ); + queueFamilyProperties.resize( queueFamilyPropertyCount ); getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties2( static_cast( m_physicalDevice ), &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); - VULKAN_HPP_ASSERT( queueFamilyPropertyCount == queueFamilyProperties.size() ); + + VULKAN_HPP_ASSERT( queueFamilyPropertyCount <= queueFamilyProperties.size() ); + if ( queueFamilyPropertyCount < queueFamilyProperties.size() ) + { + queueFamilyProperties.resize( queueFamilyPropertyCount ); + } return queueFamilyProperties; } @@ -11640,17 +11677,23 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector PhysicalDevice::getSparseImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 & formatInfo ) const VULKAN_HPP_NOEXCEPT { - uint32_t propertyCount; + std::vector properties; + uint32_t propertyCount; getDispatcher()->vkGetPhysicalDeviceSparseImageFormatProperties2( static_cast( m_physicalDevice ), reinterpret_cast( &formatInfo ), &propertyCount, nullptr ); - std::vector properties( propertyCount ); + properties.resize( propertyCount ); getDispatcher()->vkGetPhysicalDeviceSparseImageFormatProperties2( static_cast( m_physicalDevice ), reinterpret_cast( &formatInfo ), &propertyCount, reinterpret_cast( properties.data() ) ); - VULKAN_HPP_ASSERT( propertyCount == properties.size() ); + + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + if ( propertyCount < properties.size() ) + { + properties.resize( propertyCount ); + } return properties; } @@ -11819,6 +11862,7 @@ namespace VULKAN_HPP_NAMESPACE uint64_t value; VkResult result = getDispatcher()->vkGetSemaphoreCounterValue( static_cast( m_device ), static_cast( m_semaphore ), &value ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Semaphore::getCounterValue" ); + return value; } @@ -11830,6 +11874,7 @@ namespace VULKAN_HPP_NAMESPACE resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::waitSemaphores", { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eTimeout } ); + return static_cast( result ); } @@ -12180,15 +12225,21 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector Device::getImageSparseMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info ) const VULKAN_HPP_NOEXCEPT { - uint32_t sparseMemoryRequirementCount; + std::vector sparseMemoryRequirements; + uint32_t sparseMemoryRequirementCount; getDispatcher()->vkGetDeviceImageSparseMemoryRequirements( static_cast( m_device ), reinterpret_cast( &info ), &sparseMemoryRequirementCount, nullptr ); - std::vector sparseMemoryRequirements( sparseMemoryRequirementCount ); + sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); getDispatcher()->vkGetDeviceImageSparseMemoryRequirements( static_cast( m_device ), reinterpret_cast( &info ), &sparseMemoryRequirementCount, reinterpret_cast( sparseMemoryRequirements.data() ) ); - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount == sparseMemoryRequirements.size() ); + + VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); + if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) + { + sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); + } return sparseMemoryRequirements; } @@ -12204,6 +12255,7 @@ namespace VULKAN_HPP_NAMESPACE VkResult result = getDispatcher()->vkGetPhysicalDeviceSurfaceSupportKHR( static_cast( m_physicalDevice ), queueFamilyIndex, static_cast( surface ), reinterpret_cast( &supported ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceSupportKHR" ); + return supported; } @@ -12218,6 +12270,7 @@ namespace VULKAN_HPP_NAMESPACE static_cast( surface ), reinterpret_cast( &surfaceCapabilities ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceCapabilitiesKHR" ); + return surfaceCapabilities; } @@ -12354,6 +12407,7 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_NAMESPACE::Result::eTimeout, VULKAN_HPP_NAMESPACE::Result::eNotReady, VULKAN_HPP_NAMESPACE::Result::eSuboptimalKHR } ); + return std::make_pair( static_cast( result ), imageIndex ); } @@ -12365,6 +12419,7 @@ namespace VULKAN_HPP_NAMESPACE resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Queue::presentKHR", { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eSuboptimalKHR } ); + return static_cast( result ); } @@ -12377,6 +12432,7 @@ namespace VULKAN_HPP_NAMESPACE VkResult result = getDispatcher()->vkGetDeviceGroupPresentCapabilitiesKHR( static_cast( m_device ), reinterpret_cast( &deviceGroupPresentCapabilities ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getGroupPresentCapabilitiesKHR" ); + return deviceGroupPresentCapabilities; } @@ -12390,6 +12446,7 @@ namespace VULKAN_HPP_NAMESPACE VkResult result = getDispatcher()->vkGetDeviceGroupSurfacePresentModesKHR( static_cast( m_device ), static_cast( surface ), reinterpret_cast( &modes ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getGroupSurfacePresentModesKHR" ); + return modes; } @@ -12444,6 +12501,7 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_NAMESPACE::Result::eTimeout, VULKAN_HPP_NAMESPACE::Result::eNotReady, VULKAN_HPP_NAMESPACE::Result::eSuboptimalKHR } ); + return std::make_pair( static_cast( result ), imageIndex ); } @@ -12576,6 +12634,7 @@ namespace VULKAN_HPP_NAMESPACE planeIndex, reinterpret_cast( &capabilities ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::DisplayModeKHR::getDisplayPlaneCapabilities" ); + return capabilities; } @@ -12792,6 +12851,7 @@ namespace VULKAN_HPP_NAMESPACE reinterpret_cast( &videoProfile ), reinterpret_cast( &capabilities ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getVideoCapabilitiesKHR" ); + return capabilities; } @@ -13108,6 +13168,7 @@ namespace VULKAN_HPP_NAMESPACE VkResult result = getDispatcher()->vkGetImageViewAddressNVX( static_cast( m_device ), static_cast( m_imageView ), reinterpret_cast( &properties ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::ImageView::getAddressNVX" ); + return properties; } @@ -13245,6 +13306,7 @@ namespace VULKAN_HPP_NAMESPACE static_cast( externalHandleType ), reinterpret_cast( &externalImageFormatProperties ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getExternalImageFormatPropertiesNV" ); + return externalImageFormatProperties; } @@ -13260,6 +13322,7 @@ namespace VULKAN_HPP_NAMESPACE VkResult result = getDispatcher()->vkGetMemoryWin32HandleNV( static_cast( m_device ), static_cast( m_memory ), static_cast( handleType ), &handle ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::DeviceMemory::getMemoryWin32HandleNV" ); + return handle; } # endif /*VK_USE_PLATFORM_WIN32_KHR*/ @@ -13358,6 +13421,7 @@ namespace VULKAN_HPP_NAMESPACE reinterpret_cast( &imageFormatInfo ), reinterpret_cast( &imageFormatProperties ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getImageFormatProperties2KHR" ); + return imageFormatProperties; } @@ -13383,13 +13447,20 @@ namespace VULKAN_HPP_NAMESPACE { VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties2KHR && "Function needs extension enabled!" ); - uint32_t queueFamilyPropertyCount; + + std::vector queueFamilyProperties; + uint32_t queueFamilyPropertyCount; getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties2KHR( static_cast( m_physicalDevice ), &queueFamilyPropertyCount, nullptr ); - std::vector queueFamilyProperties( queueFamilyPropertyCount ); + queueFamilyProperties.resize( queueFamilyPropertyCount ); getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties2KHR( static_cast( m_physicalDevice ), &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); - VULKAN_HPP_ASSERT( queueFamilyPropertyCount == queueFamilyProperties.size() ); + + VULKAN_HPP_ASSERT( queueFamilyPropertyCount <= queueFamilyProperties.size() ); + if ( queueFamilyPropertyCount < queueFamilyProperties.size() ) + { + queueFamilyProperties.resize( queueFamilyPropertyCount ); + } return queueFamilyProperties; } @@ -13450,17 +13521,24 @@ namespace VULKAN_HPP_NAMESPACE { VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceSparseImageFormatProperties2KHR && "Function needs extension enabled!" ); - uint32_t propertyCount; + + std::vector properties; + uint32_t propertyCount; getDispatcher()->vkGetPhysicalDeviceSparseImageFormatProperties2KHR( static_cast( m_physicalDevice ), reinterpret_cast( &formatInfo ), &propertyCount, nullptr ); - std::vector properties( propertyCount ); + properties.resize( propertyCount ); getDispatcher()->vkGetPhysicalDeviceSparseImageFormatProperties2KHR( static_cast( m_physicalDevice ), reinterpret_cast( &formatInfo ), &propertyCount, reinterpret_cast( properties.data() ) ); - VULKAN_HPP_ASSERT( propertyCount == properties.size() ); + + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + if ( propertyCount < properties.size() ) + { + properties.resize( propertyCount ); + } return properties; } @@ -13589,6 +13667,7 @@ namespace VULKAN_HPP_NAMESPACE VkResult result = getDispatcher()->vkGetMemoryWin32HandleKHR( static_cast( m_device ), reinterpret_cast( &getWin32HandleInfo ), &handle ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryWin32HandleKHR" ); + return handle; } @@ -13605,6 +13684,7 @@ namespace VULKAN_HPP_NAMESPACE handle, reinterpret_cast( &memoryWin32HandleProperties ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryWin32HandlePropertiesKHR" ); + return memoryWin32HandleProperties; } # endif /*VK_USE_PLATFORM_WIN32_KHR*/ @@ -13619,6 +13699,7 @@ namespace VULKAN_HPP_NAMESPACE VkResult result = getDispatcher()->vkGetMemoryFdKHR( static_cast( m_device ), reinterpret_cast( &getFdInfo ), &fd ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryFdKHR" ); + return fd; } @@ -13634,6 +13715,7 @@ namespace VULKAN_HPP_NAMESPACE fd, reinterpret_cast( &memoryFdProperties ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryFdPropertiesKHR" ); + return memoryFdProperties; } @@ -13678,6 +13760,7 @@ namespace VULKAN_HPP_NAMESPACE VkResult result = getDispatcher()->vkGetSemaphoreWin32HandleKHR( static_cast( m_device ), reinterpret_cast( &getWin32HandleInfo ), &handle ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getSemaphoreWin32HandleKHR" ); + return handle; } # endif /*VK_USE_PLATFORM_WIN32_KHR*/ @@ -13702,6 +13785,7 @@ namespace VULKAN_HPP_NAMESPACE VkResult result = getDispatcher()->vkGetSemaphoreFdKHR( static_cast( m_device ), reinterpret_cast( &getFdInfo ), &fd ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getSemaphoreFdKHR" ); + return fd; } @@ -13843,6 +13927,7 @@ namespace VULKAN_HPP_NAMESPACE static_cast( surface ), reinterpret_cast( &surfaceCapabilities ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceCapabilities2EXT" ); + return surfaceCapabilities; } @@ -13881,6 +13966,7 @@ namespace VULKAN_HPP_NAMESPACE VkResult result = getDispatcher()->vkGetSwapchainCounterEXT( static_cast( m_device ), static_cast( m_swapchain ), static_cast( counter ), &counterValue ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::SwapchainKHR::getCounterEXT" ); + return counterValue; } @@ -13896,6 +13982,7 @@ namespace VULKAN_HPP_NAMESPACE static_cast( m_swapchain ), reinterpret_cast( &displayTimingProperties ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::SwapchainKHR::getRefreshCycleDurationGOOGLE" ); + return displayTimingProperties; } @@ -14015,6 +14102,7 @@ namespace VULKAN_HPP_NAMESPACE resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::SwapchainKHR::getStatus", { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eSuboptimalKHR } ); + return static_cast( result ); } @@ -14057,6 +14145,7 @@ namespace VULKAN_HPP_NAMESPACE VkResult result = getDispatcher()->vkGetFenceWin32HandleKHR( static_cast( m_device ), reinterpret_cast( &getWin32HandleInfo ), &handle ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getFenceWin32HandleKHR" ); + return handle; } # endif /*VK_USE_PLATFORM_WIN32_KHR*/ @@ -14079,6 +14168,7 @@ namespace VULKAN_HPP_NAMESPACE int fd; VkResult result = getDispatcher()->vkGetFenceFdKHR( static_cast( m_device ), reinterpret_cast( &getFdInfo ), &fd ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getFenceFdKHR" ); + return fd; } @@ -14169,6 +14259,7 @@ namespace VULKAN_HPP_NAMESPACE reinterpret_cast( &surfaceInfo ), reinterpret_cast( &surfaceCapabilities ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceCapabilities2KHR" ); + return surfaceCapabilities; } @@ -14392,6 +14483,7 @@ namespace VULKAN_HPP_NAMESPACE reinterpret_cast( &displayPlaneInfo ), reinterpret_cast( &capabilities ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayPlaneCapabilities2KHR" ); + return capabilities; } @@ -14523,6 +14615,7 @@ namespace VULKAN_HPP_NAMESPACE VkResult result = getDispatcher()->vkGetAndroidHardwareBufferPropertiesANDROID( static_cast( m_device ), &buffer, reinterpret_cast( &properties ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getAndroidHardwareBufferPropertiesANDROID" ); + return properties; } @@ -14551,6 +14644,7 @@ namespace VULKAN_HPP_NAMESPACE VkResult result = getDispatcher()->vkGetMemoryAndroidHardwareBufferANDROID( static_cast( m_device ), reinterpret_cast( &info ), &buffer ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryAndroidHardwareBufferANDROID" ); + return buffer; } # endif /*VK_USE_PLATFORM_ANDROID_KHR*/ @@ -14648,15 +14742,22 @@ namespace VULKAN_HPP_NAMESPACE { VULKAN_HPP_ASSERT( getDispatcher()->vkGetImageSparseMemoryRequirements2KHR && "Function needs extension enabled!" ); - uint32_t sparseMemoryRequirementCount; + + std::vector sparseMemoryRequirements; + uint32_t sparseMemoryRequirementCount; getDispatcher()->vkGetImageSparseMemoryRequirements2KHR( static_cast( m_device ), reinterpret_cast( &info ), &sparseMemoryRequirementCount, nullptr ); - std::vector sparseMemoryRequirements( sparseMemoryRequirementCount ); + sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); getDispatcher()->vkGetImageSparseMemoryRequirements2KHR( static_cast( m_device ), reinterpret_cast( &info ), &sparseMemoryRequirementCount, reinterpret_cast( sparseMemoryRequirements.data() ) ); - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount == sparseMemoryRequirements.size() ); + + VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); + if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) + { + sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); + } return sparseMemoryRequirements; } @@ -14740,6 +14841,7 @@ namespace VULKAN_HPP_NAMESPACE { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR, VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR } ); + return static_cast( result ); } @@ -14758,6 +14860,7 @@ namespace VULKAN_HPP_NAMESPACE { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR, VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR } ); + return static_cast( result ); } @@ -14777,6 +14880,7 @@ namespace VULKAN_HPP_NAMESPACE { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR, VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR } ); + return static_cast( result ); } @@ -14796,6 +14900,7 @@ namespace VULKAN_HPP_NAMESPACE { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR, VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR } ); + return static_cast( result ); } @@ -14995,6 +15100,7 @@ namespace VULKAN_HPP_NAMESPACE VkResult result = getDispatcher()->vkGetImageDrmFormatModifierPropertiesEXT( static_cast( m_device ), static_cast( m_image ), reinterpret_cast( &properties ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Image::getDrmFormatModifierPropertiesEXT" ); + return properties; } @@ -15410,6 +15516,7 @@ namespace VULKAN_HPP_NAMESPACE pHostPointer, reinterpret_cast( &memoryHostPointerProperties ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryHostPointerPropertiesEXT" ); + return memoryHostPointerProperties; } @@ -15572,12 +15679,19 @@ namespace VULKAN_HPP_NAMESPACE { VULKAN_HPP_ASSERT( getDispatcher()->vkGetQueueCheckpointDataNV && "Function needs extension enabled!" ); - uint32_t checkpointDataCount; + + std::vector checkpointData; + uint32_t checkpointDataCount; getDispatcher()->vkGetQueueCheckpointDataNV( static_cast( m_queue ), &checkpointDataCount, nullptr ); - std::vector checkpointData( checkpointDataCount ); + checkpointData.resize( checkpointDataCount ); getDispatcher()->vkGetQueueCheckpointDataNV( static_cast( m_queue ), &checkpointDataCount, reinterpret_cast( checkpointData.data() ) ); - VULKAN_HPP_ASSERT( checkpointDataCount == checkpointData.size() ); + + VULKAN_HPP_ASSERT( checkpointDataCount <= checkpointData.size() ); + if ( checkpointDataCount < checkpointData.size() ) + { + checkpointData.resize( checkpointDataCount ); + } return checkpointData; } @@ -15591,6 +15705,7 @@ namespace VULKAN_HPP_NAMESPACE uint64_t value; VkResult result = getDispatcher()->vkGetSemaphoreCounterValueKHR( static_cast( m_device ), static_cast( m_semaphore ), &value ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Semaphore::getCounterValueKHR" ); + return value; } @@ -15604,6 +15719,7 @@ namespace VULKAN_HPP_NAMESPACE resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::waitSemaphoresKHR", { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eTimeout } ); + return static_cast( result ); } @@ -15692,6 +15808,7 @@ namespace VULKAN_HPP_NAMESPACE VkResult result = getDispatcher()->vkGetPerformanceParameterINTEL( static_cast( m_device ), static_cast( parameter ), reinterpret_cast( &value ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getPerformanceParameterINTEL" ); + return value; } @@ -15837,6 +15954,7 @@ namespace VULKAN_HPP_NAMESPACE resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::SwapchainKHR::waitForPresent", { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eTimeout, VULKAN_HPP_NAMESPACE::Result::eSuboptimalKHR } ); + return static_cast( result ); } @@ -15987,6 +16105,7 @@ namespace VULKAN_HPP_NAMESPACE reinterpret_cast( &surfaceInfo ), reinterpret_cast( &modes ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getGroupSurfacePresentModes2EXT" ); + return modes; } # endif /*VK_USE_PLATFORM_WIN32_KHR*/ @@ -16224,6 +16343,7 @@ namespace VULKAN_HPP_NAMESPACE resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::DeferredOperationKHR::join", { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eThreadDoneKHR, VULKAN_HPP_NAMESPACE::Result::eThreadIdleKHR } ); + return static_cast( result ); } @@ -16598,12 +16718,19 @@ namespace VULKAN_HPP_NAMESPACE { VULKAN_HPP_ASSERT( getDispatcher()->vkGetQueueCheckpointData2NV && "Function needs extension enabled!" ); - uint32_t checkpointDataCount; + + std::vector checkpointData; + uint32_t checkpointDataCount; getDispatcher()->vkGetQueueCheckpointData2NV( static_cast( m_queue ), &checkpointDataCount, nullptr ); - std::vector checkpointData( checkpointDataCount ); + checkpointData.resize( checkpointDataCount ); getDispatcher()->vkGetQueueCheckpointData2NV( static_cast( m_queue ), &checkpointDataCount, reinterpret_cast( checkpointData.data() ) ); - VULKAN_HPP_ASSERT( checkpointDataCount == checkpointData.size() ); + + VULKAN_HPP_ASSERT( checkpointDataCount <= checkpointData.size() ); + if ( checkpointDataCount < checkpointData.size() ) + { + checkpointData.resize( checkpointDataCount ); + } return checkpointData; } @@ -16929,6 +17056,7 @@ namespace VULKAN_HPP_NAMESPACE VkResult result = getDispatcher()->vkGetMemoryZirconHandleFUCHSIA( static_cast( m_device ), reinterpret_cast( &getZirconHandleInfo ), &zirconHandle ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryZirconHandleFUCHSIA" ); + return zirconHandle; } @@ -16945,6 +17073,7 @@ namespace VULKAN_HPP_NAMESPACE zirconHandle, reinterpret_cast( &memoryZirconHandleProperties ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryZirconHandlePropertiesFUCHSIA" ); + return memoryZirconHandleProperties; } # endif /*VK_USE_PLATFORM_FUCHSIA*/ @@ -16973,6 +17102,7 @@ namespace VULKAN_HPP_NAMESPACE VkResult result = getDispatcher()->vkGetSemaphoreZirconHandleFUCHSIA( static_cast( m_device ), reinterpret_cast( &getZirconHandleInfo ), &zirconHandle ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getSemaphoreZirconHandleFUCHSIA" ); + return zirconHandle; } # endif /*VK_USE_PLATFORM_FUCHSIA*/ @@ -17022,6 +17152,7 @@ namespace VULKAN_HPP_NAMESPACE static_cast( m_collection ), reinterpret_cast( &properties ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::BufferCollectionFUCHSIA::getProperties" ); + return properties; } # endif /*VK_USE_PLATFORM_FUCHSIA*/ @@ -17040,6 +17171,7 @@ namespace VULKAN_HPP_NAMESPACE resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::RenderPass::getSubpassShadingMaxWorkgroupSizeHUAWEI", { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eIncomplete } ); + return std::make_pair( static_cast( result ), maxWorkgroupSize ); } @@ -17076,6 +17208,7 @@ namespace VULKAN_HPP_NAMESPACE reinterpret_cast( &memoryGetRemoteAddressInfo ), reinterpret_cast( &address ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryRemoteAddressNV" ); + return address; } @@ -17092,6 +17225,7 @@ namespace VULKAN_HPP_NAMESPACE reinterpret_cast( &pipelineInfo ), reinterpret_cast( &pipelineProperties ) ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getPipelinePropertiesEXT" ); + return pipelineProperties; } @@ -17308,15 +17442,22 @@ namespace VULKAN_HPP_NAMESPACE { VULKAN_HPP_ASSERT( getDispatcher()->vkGetDeviceImageSparseMemoryRequirementsKHR && "Function needs extension enabled!" ); - uint32_t sparseMemoryRequirementCount; + + std::vector sparseMemoryRequirements; + uint32_t sparseMemoryRequirementCount; getDispatcher()->vkGetDeviceImageSparseMemoryRequirementsKHR( static_cast( m_device ), reinterpret_cast( &info ), &sparseMemoryRequirementCount, nullptr ); - std::vector sparseMemoryRequirements( sparseMemoryRequirementCount ); + sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); getDispatcher()->vkGetDeviceImageSparseMemoryRequirementsKHR( static_cast( m_device ), reinterpret_cast( &info ), &sparseMemoryRequirementCount, reinterpret_cast( sparseMemoryRequirements.data() ) ); - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount == sparseMemoryRequirements.size() ); + + VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); + if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) + { + sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); + } return sparseMemoryRequirements; }