Fix regression from d07ca3fcf4

#670
This commit is contained in:
Wojtek Figat
2021-11-17 21:40:07 +01:00
parent e16c7f3ac4
commit 2a2b70f83f

View File

@@ -1307,8 +1307,6 @@ PixelFormat GPUDeviceVulkan::GetClosestSupportedPixelFormat(PixelFormat format,
if (!IsVkFormatSupported(RenderToolsVulkan::ToVulkanFormat(format), wantedFeatureFlags, optimalTiling)) if (!IsVkFormatSupported(RenderToolsVulkan::ToVulkanFormat(format), wantedFeatureFlags, optimalTiling))
{ {
auto remap = format;
// Special case for depth-stencil formats // Special case for depth-stencil formats
if (flags & GPUTextureFlags::DepthStencil) if (flags & GPUTextureFlags::DepthStencil)
{ {
@@ -1331,6 +1329,7 @@ PixelFormat GPUDeviceVulkan::GetClosestSupportedPixelFormat(PixelFormat format,
else else
{ {
// Perform remapping to bigger format that might be supported (more likely) // Perform remapping to bigger format that might be supported (more likely)
auto remap = format;
switch (format) switch (format)
{ {
case PixelFormat::R11G11B10_Float: case PixelFormat::R11G11B10_Float:
@@ -1352,15 +1351,14 @@ PixelFormat GPUDeviceVulkan::GetClosestSupportedPixelFormat(PixelFormat format,
remap = PixelFormat::R32G32B32A32_Float; remap = PixelFormat::R32G32B32A32_Float;
break; break;
} }
}
#if !BUILD_RELEASE #if !BUILD_RELEASE
if (format != remap) if (format != remap)
{ {
LOG(Warning, "Unsupported Vulkan format {0}. Remapping to {1}", (int32)format, (int32)remap); LOG(Warning, "Unsupported Vulkan format {0}. Remapping to {1}", (int32)format, (int32)remap);
format = GetClosestSupportedPixelFormat(remap, flags, optimalTiling); format = GetClosestSupportedPixelFormat(remap, flags, optimalTiling);
} }
#endif #endif
}
} }
return format; return format;