From ede229f31338ded485f20160384ac292c25f1cd0 Mon Sep 17 00:00:00 2001 From: Carl Woffenden Date: Tue, 12 Jan 2021 08:55:27 +0000 Subject: [PATCH] Minor fix to build with MSVC: Removes switch with only default case Fixes warning C4065: switch statement contains 'default' but no 'case' labels Change-Id: If9a8f20eaeb2499f71bc25a69e545b3e8b21be4d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36081 Reviewed-by: Corentin Wallez Commit-Queue: Carl Woffenden --- src/dawn_native/vulkan/VulkanBackend.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/dawn_native/vulkan/VulkanBackend.cpp b/src/dawn_native/vulkan/VulkanBackend.cpp index faf17f86e6..8e1304faf1 100644 --- a/src/dawn_native/vulkan/VulkanBackend.cpp +++ b/src/dawn_native/vulkan/VulkanBackend.cpp @@ -91,8 +91,8 @@ namespace dawn_native { namespace vulkan { #endif // DAWN_PLATFORM_LINUX WGPUTexture WrapVulkanImage(WGPUDevice cDevice, const ExternalImageDescriptorVk* descriptor) { - switch (descriptor->type) { #if defined(DAWN_PLATFORM_LINUX) + switch (descriptor->type) { case ExternalImageType::OpaqueFD: case ExternalImageType::DmaBuf: { const ExternalImageDescriptorFD* fdDescriptor = @@ -102,10 +102,12 @@ namespace dawn_native { namespace vulkan { fdDescriptor, fdDescriptor->memoryFD, fdDescriptor->waitFDs); return reinterpret_cast(texture); } -#endif // DAWN_PLATFORM_LINUX default: return nullptr; } +#else + return nullptr; +#endif // DAWN_PLATFORM_LINUX } bool ExportVulkanImage(WGPUTexture cTexture, @@ -114,8 +116,8 @@ namespace dawn_native { namespace vulkan { if (cTexture == nullptr) { return false; } - switch (info->type) { #if defined(DAWN_PLATFORM_LINUX) + switch (info->type) { case ExternalImageType::OpaqueFD: case ExternalImageType::DmaBuf: { Texture* texture = reinterpret_cast(cTexture); @@ -124,10 +126,12 @@ namespace dawn_native { namespace vulkan { return device->SignalAndExportExternalTexture(texture, desiredLayout, fdInfo, &fdInfo->semaphoreHandles); } -#endif // DAWN_PLATFORM_LINUX default: return false; } +#else + return false; +#endif // DAWN_PLATFORM_LINUX } }} // namespace dawn_native::vulkan