From 1dc278a2b8b866b08155b9d1085b34df70fced86 Mon Sep 17 00:00:00 2001 From: Eugene Golushkov Date: Fri, 6 Dec 2024 16:33:01 +0100 Subject: [PATCH] [Vk] fixed build for AndroidSwappy --- RenderSystems/Vulkan/src/OgreVulkanDevice.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/RenderSystems/Vulkan/src/OgreVulkanDevice.cpp b/RenderSystems/Vulkan/src/OgreVulkanDevice.cpp index cec3747fd2..69cf48092e 100644 --- a/RenderSystems/Vulkan/src/OgreVulkanDevice.cpp +++ b/RenderSystems/Vulkan/src/OgreVulkanDevice.cpp @@ -897,8 +897,10 @@ namespace Ogre #ifdef OGRE_VULKAN_USE_SWAPPY // Add any extensions that SwappyVk requires: uint32_t numSwappyRequiredExtensions = 0u; - SwappyVk_determineDeviceExtensions( mPhysicalDevice, numExtensions, availableExtensions.begin(), - &numSwappyRequiredExtensions, 0 ); + SwappyVk_determineDeviceExtensions( + mPhysicalDevice, static_cast( availableExtensions.size() ), + const_cast( availableExtensions.begin() ), // swappy API flaw + &numSwappyRequiredExtensions, 0 ); struct ExtName { @@ -912,9 +914,10 @@ namespace Ogre for( ExtName &extName : swappyRequiredExtensionNames ) swappyRequiredExtensionNamesTmp.push_back( extName.name ); - SwappyVk_determineDeviceExtensions( mPhysicalDevice, numExtensions, availableExtensions.begin(), - &numSwappyRequiredExtensions, - swappyRequiredExtensionNamesTmp.begin() ); + SwappyVk_determineDeviceExtensions( + mPhysicalDevice, static_cast( availableExtensions.size() ), + const_cast( availableExtensions.begin() ), // swappy API flaw + &numSwappyRequiredExtensions, swappyRequiredExtensionNamesTmp.begin() ); for( const char *swappyReqExtension : swappyRequiredExtensionNamesTmp ) {