From f99407cf28d0baa0b480f284fa175594ff65d1d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=BC=C3=9Fenbach?= Date: Thu, 8 Nov 2018 03:46:18 +0100 Subject: [PATCH] Check result in two-step functions like enumeratePhysicalDevices (#270) Resolves issue #265 --- VulkanHppGenerator.cpp | 7 +- vulkan/vulkan.hpp | 336 +++++++++++++++++++++++++++++------------ 2 files changed, 245 insertions(+), 98 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index ac2814e..ca1b657 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -3589,8 +3589,11 @@ ${i} ${returnName}.resize( ${sizeName} ); ${i} result = static_cast( ${call2} ); ${i} } ${i} } while ( result == Result::eIncomplete ); -${i} VULKAN_HPP_ASSERT( ${sizeName} <= ${returnName}.size() ); -${i} ${returnName}.resize( ${sizeName} ); +${i} if ( result == Result::eSuccess ) +${i} { +${i} VULKAN_HPP_ASSERT( ${sizeName} <= ${returnName}.size() ); +${i} ${returnName}.resize( ${sizeName} ); +${i} } )"; writeFunctionBodyTwoStep(os, templateString, indentation, returnName, sizeName, commandData); } diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index 481bc69..60d17bc 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -37623,8 +37623,11 @@ public: result = static_cast( d.vkEnumerateInstanceLayerProperties( &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::enumerateInstanceLayerProperties" ); } template @@ -37642,8 +37645,11 @@ public: result = static_cast( d.vkEnumerateInstanceLayerProperties( &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::enumerateInstanceLayerProperties" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -37679,8 +37685,11 @@ public: result = static_cast( d.vkEnumerateInstanceExtensionProperties( layerName ? layerName->c_str() : nullptr, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::enumerateInstanceExtensionProperties" ); } template @@ -37698,8 +37707,11 @@ public: result = static_cast( d.vkEnumerateInstanceExtensionProperties( layerName ? layerName->c_str() : nullptr, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::enumerateInstanceExtensionProperties" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -42435,8 +42447,11 @@ public: result = static_cast( d.vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), &dataSize, reinterpret_cast( data.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( dataSize <= data.size() ); - data.resize( dataSize ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( dataSize <= data.size() ); + data.resize( dataSize ); + } return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING"::Device::getPipelineCacheData" ); } template @@ -42454,8 +42469,11 @@ public: result = static_cast( d.vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), &dataSize, reinterpret_cast( data.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( dataSize <= data.size() ); - data.resize( dataSize ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( dataSize <= data.size() ); + data.resize( dataSize ); + } return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING"::Device::getPipelineCacheData" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -43387,8 +43405,11 @@ public: result = static_cast( d.vkGetSwapchainImagesKHR( m_device, static_cast( swapchain ), &swapchainImageCount, reinterpret_cast( swapchainImages.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( swapchainImageCount <= swapchainImages.size() ); - swapchainImages.resize( swapchainImageCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( swapchainImageCount <= swapchainImages.size() ); + swapchainImages.resize( swapchainImageCount ); + } return createResultValue( result, swapchainImages, VULKAN_HPP_NAMESPACE_STRING"::Device::getSwapchainImagesKHR" ); } template @@ -43406,8 +43427,11 @@ public: result = static_cast( d.vkGetSwapchainImagesKHR( m_device, static_cast( swapchain ), &swapchainImageCount, reinterpret_cast( swapchainImages.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( swapchainImageCount <= swapchainImages.size() ); - swapchainImages.resize( swapchainImageCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( swapchainImageCount <= swapchainImages.size() ); + swapchainImages.resize( swapchainImageCount ); + } return createResultValue( result, swapchainImages, VULKAN_HPP_NAMESPACE_STRING"::Device::getSwapchainImagesKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -44217,8 +44241,11 @@ public: result = static_cast( d.vkGetPastPresentationTimingGOOGLE( m_device, static_cast( swapchain ), &presentationTimingCount, reinterpret_cast( presentationTimings.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( presentationTimingCount <= presentationTimings.size() ); - presentationTimings.resize( presentationTimingCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( presentationTimingCount <= presentationTimings.size() ); + presentationTimings.resize( presentationTimingCount ); + } return createResultValue( result, presentationTimings, VULKAN_HPP_NAMESPACE_STRING"::Device::getPastPresentationTimingGOOGLE" ); } template @@ -44236,8 +44263,11 @@ public: result = static_cast( d.vkGetPastPresentationTimingGOOGLE( m_device, static_cast( swapchain ), &presentationTimingCount, reinterpret_cast( presentationTimings.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( presentationTimingCount <= presentationTimings.size() ); - presentationTimings.resize( presentationTimingCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( presentationTimingCount <= presentationTimings.size() ); + presentationTimings.resize( presentationTimingCount ); + } return createResultValue( result, presentationTimings, VULKAN_HPP_NAMESPACE_STRING"::Device::getPastPresentationTimingGOOGLE" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -44569,8 +44599,11 @@ public: result = static_cast( d.vkGetValidationCacheDataEXT( m_device, static_cast( validationCache ), &dataSize, reinterpret_cast( data.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( dataSize <= data.size() ); - data.resize( dataSize ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( dataSize <= data.size() ); + data.resize( dataSize ); + } return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING"::Device::getValidationCacheDataEXT" ); } template @@ -44588,8 +44621,11 @@ public: result = static_cast( d.vkGetValidationCacheDataEXT( m_device, static_cast( validationCache ), &dataSize, reinterpret_cast( data.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( dataSize <= data.size() ); - data.resize( dataSize ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( dataSize <= data.size() ); + data.resize( dataSize ); + } return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING"::Device::getValidationCacheDataEXT" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -44675,8 +44711,11 @@ public: result = static_cast( d.vkGetShaderInfoAMD( m_device, static_cast( pipeline ), static_cast( shaderStage ), static_cast( infoType ), &infoSize, reinterpret_cast( info.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( infoSize <= info.size() ); - info.resize( infoSize ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( infoSize <= info.size() ); + info.resize( infoSize ); + } return createResultValue( result, info, VULKAN_HPP_NAMESPACE_STRING"::Device::getShaderInfoAMD" ); } template @@ -44694,8 +44733,11 @@ public: result = static_cast( d.vkGetShaderInfoAMD( m_device, static_cast( pipeline ), static_cast( shaderStage ), static_cast( infoType ), &infoSize, reinterpret_cast( info.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( infoSize <= info.size() ); - info.resize( infoSize ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( infoSize <= info.size() ); + info.resize( infoSize ); + } return createResultValue( result, info, VULKAN_HPP_NAMESPACE_STRING"::Device::getShaderInfoAMD" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -45764,8 +45806,11 @@ public: result = static_cast( d.vkEnumerateDeviceLayerProperties( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::enumerateDeviceLayerProperties" ); } template @@ -45783,8 +45828,11 @@ public: result = static_cast( d.vkEnumerateDeviceLayerProperties( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::enumerateDeviceLayerProperties" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -45810,8 +45858,11 @@ public: result = static_cast( d.vkEnumerateDeviceExtensionProperties( m_physicalDevice, layerName ? layerName->c_str() : nullptr, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::enumerateDeviceExtensionProperties" ); } template @@ -45829,8 +45880,11 @@ public: result = static_cast( d.vkEnumerateDeviceExtensionProperties( m_physicalDevice, layerName ? layerName->c_str() : nullptr, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::enumerateDeviceExtensionProperties" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -45884,8 +45938,11 @@ public: result = static_cast( d.vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayPropertiesKHR" ); } template @@ -45903,8 +45960,11 @@ public: result = static_cast( d.vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayPropertiesKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -45930,8 +45990,11 @@ public: result = static_cast( d.vkGetPhysicalDeviceDisplayPlanePropertiesKHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayPlanePropertiesKHR" ); } template @@ -45949,8 +46012,11 @@ public: result = static_cast( d.vkGetPhysicalDeviceDisplayPlanePropertiesKHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayPlanePropertiesKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -45976,8 +46042,11 @@ public: result = static_cast( d.vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, &displayCount, reinterpret_cast( displays.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( displayCount <= displays.size() ); - displays.resize( displayCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( displayCount <= displays.size() ); + displays.resize( displayCount ); + } return createResultValue( result, displays, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR" ); } template @@ -45995,8 +46064,11 @@ public: result = static_cast( d.vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, &displayCount, reinterpret_cast( displays.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( displayCount <= displays.size() ); - displays.resize( displayCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( displayCount <= displays.size() ); + displays.resize( displayCount ); + } return createResultValue( result, displays, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -46022,8 +46094,11 @@ public: result = static_cast( d.vkGetDisplayModePropertiesKHR( m_physicalDevice, static_cast( display ), &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayModePropertiesKHR" ); } template @@ -46041,8 +46116,11 @@ public: result = static_cast( d.vkGetDisplayModePropertiesKHR( m_physicalDevice, static_cast( display ), &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayModePropertiesKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -46128,8 +46206,11 @@ public: result = static_cast( d.vkGetPhysicalDeviceSurfaceFormatsKHR( m_physicalDevice, static_cast( surface ), &surfaceFormatCount, reinterpret_cast( surfaceFormats.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); - surfaceFormats.resize( surfaceFormatCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); + surfaceFormats.resize( surfaceFormatCount ); + } return createResultValue( result, surfaceFormats, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getSurfaceFormatsKHR" ); } template @@ -46147,8 +46228,11 @@ public: result = static_cast( d.vkGetPhysicalDeviceSurfaceFormatsKHR( m_physicalDevice, static_cast( surface ), &surfaceFormatCount, reinterpret_cast( surfaceFormats.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); - surfaceFormats.resize( surfaceFormatCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); + surfaceFormats.resize( surfaceFormatCount ); + } return createResultValue( result, surfaceFormats, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getSurfaceFormatsKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -46174,8 +46258,11 @@ public: result = static_cast( d.vkGetPhysicalDeviceSurfacePresentModesKHR( m_physicalDevice, static_cast( surface ), &presentModeCount, reinterpret_cast( presentModes.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( presentModeCount <= presentModes.size() ); - presentModes.resize( presentModeCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( presentModeCount <= presentModes.size() ); + presentModes.resize( presentModeCount ); + } return createResultValue( result, presentModes, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getSurfacePresentModesKHR" ); } template @@ -46193,8 +46280,11 @@ public: result = static_cast( d.vkGetPhysicalDeviceSurfacePresentModesKHR( m_physicalDevice, static_cast( surface ), &presentModeCount, reinterpret_cast( presentModes.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( presentModeCount <= presentModes.size() ); - presentModes.resize( presentModeCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( presentModeCount <= presentModes.size() ); + presentModes.resize( presentModeCount ); + } return createResultValue( result, presentModes, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getSurfacePresentModesKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -46791,8 +46881,11 @@ public: result = static_cast( d.vkGetPhysicalDevicePresentRectanglesKHR( m_physicalDevice, static_cast( surface ), &rectCount, reinterpret_cast( rects.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( rectCount <= rects.size() ); - rects.resize( rectCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( rectCount <= rects.size() ); + rects.resize( rectCount ); + } return createResultValue( result, rects, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getPresentRectanglesKHR" ); } template @@ -46810,8 +46903,11 @@ public: result = static_cast( d.vkGetPhysicalDevicePresentRectanglesKHR( m_physicalDevice, static_cast( surface ), &rectCount, reinterpret_cast( rects.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( rectCount <= rects.size() ); - rects.resize( rectCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( rectCount <= rects.size() ); + rects.resize( rectCount ); + } return createResultValue( result, rects, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getPresentRectanglesKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -46875,8 +46971,11 @@ public: result = static_cast( d.vkGetPhysicalDeviceSurfaceFormats2KHR( m_physicalDevice, reinterpret_cast( &surfaceInfo ), &surfaceFormatCount, reinterpret_cast( surfaceFormats.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); - surfaceFormats.resize( surfaceFormatCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); + surfaceFormats.resize( surfaceFormatCount ); + } return createResultValue( result, surfaceFormats, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getSurfaceFormats2KHR" ); } template @@ -46894,8 +46993,11 @@ public: result = static_cast( d.vkGetPhysicalDeviceSurfaceFormats2KHR( m_physicalDevice, reinterpret_cast( &surfaceInfo ), &surfaceFormatCount, reinterpret_cast( surfaceFormats.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); - surfaceFormats.resize( surfaceFormatCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); + surfaceFormats.resize( surfaceFormatCount ); + } return createResultValue( result, surfaceFormats, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getSurfaceFormats2KHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -46921,8 +47023,11 @@ public: result = static_cast( d.vkGetPhysicalDeviceDisplayProperties2KHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayProperties2KHR" ); } template @@ -46940,8 +47045,11 @@ public: result = static_cast( d.vkGetPhysicalDeviceDisplayProperties2KHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayProperties2KHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -46967,8 +47075,11 @@ public: result = static_cast( d.vkGetPhysicalDeviceDisplayPlaneProperties2KHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayPlaneProperties2KHR" ); } template @@ -46986,8 +47097,11 @@ public: result = static_cast( d.vkGetPhysicalDeviceDisplayPlaneProperties2KHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayPlaneProperties2KHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -47013,8 +47127,11 @@ public: result = static_cast( d.vkGetDisplayModeProperties2KHR( m_physicalDevice, static_cast( display ), &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayModeProperties2KHR" ); } template @@ -47032,8 +47149,11 @@ public: result = static_cast( d.vkGetDisplayModeProperties2KHR( m_physicalDevice, static_cast( display ), &propertyCount, reinterpret_cast( properties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - properties.resize( propertyCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + } return createResultValue( result, properties, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getDisplayModeProperties2KHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -47074,8 +47194,11 @@ public: result = static_cast( d.vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( m_physicalDevice, &timeDomainCount, reinterpret_cast( timeDomains.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( timeDomainCount <= timeDomains.size() ); - timeDomains.resize( timeDomainCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( timeDomainCount <= timeDomains.size() ); + timeDomains.resize( timeDomainCount ); + } return createResultValue( result, timeDomains, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getCalibrateableTimeDomainsEXT" ); } template @@ -47093,8 +47216,11 @@ public: result = static_cast( d.vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( m_physicalDevice, &timeDomainCount, reinterpret_cast( timeDomains.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( timeDomainCount <= timeDomains.size() ); - timeDomains.resize( timeDomainCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( timeDomainCount <= timeDomains.size() ); + timeDomains.resize( timeDomainCount ); + } return createResultValue( result, timeDomains, VULKAN_HPP_NAMESPACE_STRING"::PhysicalDevice::getCalibrateableTimeDomainsEXT" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -47647,8 +47773,11 @@ public: result = static_cast( d.vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, reinterpret_cast( physicalDevices.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( physicalDeviceCount <= physicalDevices.size() ); - physicalDevices.resize( physicalDeviceCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( physicalDeviceCount <= physicalDevices.size() ); + physicalDevices.resize( physicalDeviceCount ); + } return createResultValue( result, physicalDevices, VULKAN_HPP_NAMESPACE_STRING"::Instance::enumeratePhysicalDevices" ); } template @@ -47666,8 +47795,11 @@ public: result = static_cast( d.vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, reinterpret_cast( physicalDevices.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( physicalDeviceCount <= physicalDevices.size() ); - physicalDevices.resize( physicalDeviceCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( physicalDeviceCount <= physicalDevices.size() ); + physicalDevices.resize( physicalDeviceCount ); + } return createResultValue( result, physicalDevices, VULKAN_HPP_NAMESPACE_STRING"::Instance::enumeratePhysicalDevices" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -48027,8 +48159,11 @@ public: result = static_cast( d.vkEnumeratePhysicalDeviceGroups( m_instance, &physicalDeviceGroupCount, reinterpret_cast( physicalDeviceGroupProperties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); - physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); + physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); + } return createResultValue( result, physicalDeviceGroupProperties, VULKAN_HPP_NAMESPACE_STRING"::Instance::enumeratePhysicalDeviceGroups" ); } template @@ -48046,8 +48181,11 @@ public: result = static_cast( d.vkEnumeratePhysicalDeviceGroups( m_instance, &physicalDeviceGroupCount, reinterpret_cast( physicalDeviceGroupProperties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); - physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); + physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); + } return createResultValue( result, physicalDeviceGroupProperties, VULKAN_HPP_NAMESPACE_STRING"::Instance::enumeratePhysicalDeviceGroups" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -48073,8 +48211,11 @@ public: result = static_cast( d.vkEnumeratePhysicalDeviceGroupsKHR( m_instance, &physicalDeviceGroupCount, reinterpret_cast( physicalDeviceGroupProperties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); - physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); + physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); + } return createResultValue( result, physicalDeviceGroupProperties, VULKAN_HPP_NAMESPACE_STRING"::Instance::enumeratePhysicalDeviceGroupsKHR" ); } template @@ -48092,8 +48233,11 @@ public: result = static_cast( d.vkEnumeratePhysicalDeviceGroupsKHR( m_instance, &physicalDeviceGroupCount, reinterpret_cast( physicalDeviceGroupProperties.data() ) ) ); } } while ( result == Result::eIncomplete ); - VULKAN_HPP_ASSERT( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); - physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); + if ( result == Result::eSuccess ) + { + VULKAN_HPP_ASSERT( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); + physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); + } return createResultValue( result, physicalDeviceGroupProperties, VULKAN_HPP_NAMESPACE_STRING"::Instance::enumeratePhysicalDeviceGroupsKHR" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/