Skip to content

Commit 98a9279

Browse files
Flip golden images vertically on OpenGL
1 parent dafd38d commit 98a9279

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

SampleBase/src/SampleApp.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,9 @@ void SampleApp::CompareGoldenImage(const std::string& FileName, ScreenCapture::C
887887
pCtx->MapTextureSubresource(Capture.pTexture, 0, 0, MAP_READ, MAP_FLAG_DO_NOT_WAIT, nullptr, TexData);
888888
auto CapturedPixels = Image::ConvertImageData(TexDesc.Width, TexDesc.Height,
889889
reinterpret_cast<const Uint8*>(TexData.pData), static_cast<Uint32>(TexData.Stride),
890-
TexDesc.Format, TEX_FORMAT_RGBA8_UNORM, false /*Keep alpha*/);
890+
TexDesc.Format, TEX_FORMAT_RGBA8_UNORM,
891+
/*KeepAlpha = */ false,
892+
/*FlipY = */ m_pDevice->GetDeviceInfo().IsGLDevice());
891893
pCtx->UnmapTextureSubresource(Capture.pTexture, 0, 0);
892894

893895
auto* pGoldenImgPixels = reinterpret_cast<const Uint8*>(pGoldenImg->GetData()->GetDataPtr());
@@ -955,6 +957,7 @@ void SampleApp::SaveScreenCapture(const std::string& FileName, ScreenCapture::Ca
955957
Info.Height = TexDesc.Height;
956958
Info.TexFormat = TexDesc.Format;
957959
Info.KeepAlpha = m_ScreenCaptureInfo.KeepAlpha;
960+
Info.FlipY = m_pDevice->GetDeviceInfo().IsGLDevice();
958961
Info.pData = TexData.pData;
959962
Info.Stride = static_cast<Uint32>(TexData.Stride);
960963
Info.FileFormat = m_ScreenCaptureInfo.FileFormat;

0 commit comments

Comments
 (0)