From 1560ed383e69f2dceeb59da95ab1cee47b6d2348 Mon Sep 17 00:00:00 2001 From: assiduous Date: Mon, 16 Dec 2024 00:19:08 -0800 Subject: [PATCH] Fixed MSVC compiler warning --- .../src/VulkanUtilities/VulkanInstance.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp index 98ccb57e9..a02de4219 100644 --- a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp +++ b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp @@ -680,6 +680,11 @@ VkPhysicalDevice VulkanInstance::SelectPhysicalDevice(uint32_t AdapterId) const return SelectedPhysicalDevice; } +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable : 4702) // unreachable code +#endif + VkPhysicalDevice VulkanInstance::SelectPhysicalDeviceForOpenXR(const CreateInfo::OpenXRInfo& XRInfo) const noexcept(false) { #if DILIGENT_USE_OPENXR @@ -708,8 +713,12 @@ VkPhysicalDevice VulkanInstance::SelectPhysicalDeviceForOpenXR(const CreateInfo: return vkDevice; #else LOG_ERROR_AND_THROW("OpenXR is not supported. Use DILIGENT_USE_OPENXR CMake option to enable it."); - return VK_NULL_HANDLE; + return VK_NULL_HANDLE; // Triggers unreachable code warning on MSVC #endif } +#ifdef _MSC_VER +# pragma warning(pop) +#endif + } // namespace VulkanUtilities