From 2a2b70f83fcb20f9d61fe0f366d79fa6ba3418ae Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 17 Nov 2021 21:40:07 +0100 Subject: [PATCH] Fix regression from d07ca3fcf4812c8c17f23999b245bdee9c5573ca #670 --- .../GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp index 143b973df..c3e41a9d6 100644 --- a/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp +++ b/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp @@ -1307,8 +1307,6 @@ PixelFormat GPUDeviceVulkan::GetClosestSupportedPixelFormat(PixelFormat format, if (!IsVkFormatSupported(RenderToolsVulkan::ToVulkanFormat(format), wantedFeatureFlags, optimalTiling)) { - auto remap = format; - // Special case for depth-stencil formats if (flags & GPUTextureFlags::DepthStencil) { @@ -1331,6 +1329,7 @@ PixelFormat GPUDeviceVulkan::GetClosestSupportedPixelFormat(PixelFormat format, else { // Perform remapping to bigger format that might be supported (more likely) + auto remap = format; switch (format) { case PixelFormat::R11G11B10_Float: @@ -1352,15 +1351,14 @@ PixelFormat GPUDeviceVulkan::GetClosestSupportedPixelFormat(PixelFormat format, remap = PixelFormat::R32G32B32A32_Float; break; } - } - #if !BUILD_RELEASE - if (format != remap) - { - LOG(Warning, "Unsupported Vulkan format {0}. Remapping to {1}", (int32)format, (int32)remap); - format = GetClosestSupportedPixelFormat(remap, flags, optimalTiling); - } + if (format != remap) + { + LOG(Warning, "Unsupported Vulkan format {0}. Remapping to {1}", (int32)format, (int32)remap); + format = GetClosestSupportedPixelFormat(remap, flags, optimalTiling); + } #endif + } } return format;