From 1626d2d00741771053c288285fb5e6e4cf54f367 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 14 Oct 2021 23:36:45 -0700 Subject: [PATCH] Minor code cleanup. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Common/Code/Source/FrameCaptureSystemComponent.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/FrameCaptureSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/FrameCaptureSystemComponent.cpp index 66b5cff8ce..cdcc07b545 100644 --- a/Gems/Atom/Feature/Common/Code/Source/FrameCaptureSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/FrameCaptureSystemComponent.cpp @@ -54,13 +54,13 @@ namespace AZ { AZStd::shared_ptr> buffer = readbackResult.m_dataBuffer; - RHI::Format finalFormat = readbackResult.m_imageDescriptor.m_format; + RHI::Format format = readbackResult.m_imageDescriptor.m_format; // convert bgra to rgba by swapping channels const int numChannels = AZ::RHI::GetFormatComponentCount(readbackResult.m_imageDescriptor.m_format); - if (readbackResult.m_imageDescriptor.m_format == RHI::Format::B8G8R8A8_UNORM) + if (format == RHI::Format::B8G8R8A8_UNORM) { - finalFormat = RHI::Format::R8G8B8A8_UNORM; + format = RHI::Format::R8G8B8A8_UNORM; buffer = AZStd::make_shared>(readbackResult.m_dataBuffer->size()); AZStd::copy(readbackResult.m_dataBuffer->begin(), readbackResult.m_dataBuffer->end(), buffer->begin()); @@ -93,7 +93,7 @@ namespace AZ jobCompletion.StartAndWaitForCompletion(); } - Utils::PngFile image = Utils::PngFile::Create(readbackResult.m_imageDescriptor.m_size, finalFormat, *buffer); + Utils::PngFile image = Utils::PngFile::Create(readbackResult.m_imageDescriptor.m_size, format, *buffer); Utils::PngFile::SaveSettings saveSettings; saveSettings.m_compressionLevel = r_pngCompressionLevel;