Skip to content

Commit 1560ed3

Browse files
Fixed MSVC compiler warning
1 parent 7ec84e7 commit 1560ed3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,11 @@ VkPhysicalDevice VulkanInstance::SelectPhysicalDevice(uint32_t AdapterId) const
680680
return SelectedPhysicalDevice;
681681
}
682682

683+
#ifdef _MSC_VER
684+
# pragma warning(push)
685+
# pragma warning(disable : 4702) // unreachable code
686+
#endif
687+
683688
VkPhysicalDevice VulkanInstance::SelectPhysicalDeviceForOpenXR(const CreateInfo::OpenXRInfo& XRInfo) const noexcept(false)
684689
{
685690
#if DILIGENT_USE_OPENXR
@@ -708,8 +713,12 @@ VkPhysicalDevice VulkanInstance::SelectPhysicalDeviceForOpenXR(const CreateInfo:
708713
return vkDevice;
709714
#else
710715
LOG_ERROR_AND_THROW("OpenXR is not supported. Use DILIGENT_USE_OPENXR CMake option to enable it.");
711-
return VK_NULL_HANDLE;
716+
return VK_NULL_HANDLE; // Triggers unreachable code warning on MSVC
712717
#endif
713718
}
714719

720+
#ifdef _MSC_VER
721+
# pragma warning(pop)
722+
#endif
723+
715724
} // namespace VulkanUtilities

0 commit comments

Comments
 (0)