diff options
| author | Markus Wick <degasus@users.noreply.github.com> | 2016-10-08 18:13:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-08 18:13:05 +0200 |
| commit | 8b38d5a1155c9d91036935b2abc388aaa1822e41 (patch) | |
| tree | a2d7453ae1962185d119c7f0a818f41d0fbba00d /Source/Core/VideoBackends/D3D12/Render.cpp | |
| parent | a9d8e3fe9b25ab97d9d95f4a28bde1e497aaf147 (diff) | |
| parent | 0864ef435219dbbded3b07a8159a85731e605087 (diff) | |
Merge pull request #4320 from degasus/framedump
Framedump: General code cleanup.
Diffstat (limited to 'Source/Core/VideoBackends/D3D12/Render.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D12/Render.cpp | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/Source/Core/VideoBackends/D3D12/Render.cpp b/Source/Core/VideoBackends/D3D12/Render.cpp index fb1740d9ac..53d6eb3d7f 100644 --- a/Source/Core/VideoBackends/D3D12/Render.cpp +++ b/Source/Core/VideoBackends/D3D12/Render.cpp @@ -688,22 +688,6 @@ bool Renderer::SaveScreenshot(const std::string& filename, const TargetRectangle return saved_png; } -void formatBufferDump(const u8* in, u8* out, int w, int h, int p) -{ - for (int y = 0; y < h; ++y) - { - auto line = (in + (h - y - 1) * p); - for (int x = 0; x < w; ++x) - { - out[0] = line[2]; - out[1] = line[1]; - out[2] = line[0]; - out += 3; - line += 4; - } - } -} - // This function has the final picture. We adjust the aspect ratio here. void Renderer::SwapImpl(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height, const EFBRectangle& rc, float gamma) @@ -711,7 +695,6 @@ void Renderer::SwapImpl(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height if (Fifo::WillSkipCurrentFrame() || (!XFBWrited && !g_ActiveConfig.RealXFBEnabled()) || !fb_width || !fb_height) { - RepeatFrameDumpFrame(); Core::Callback_VideoCopiedToXFB(false); return; } @@ -721,7 +704,6 @@ void Renderer::SwapImpl(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height FramebufferManager::GetXFBSource(xfb_addr, fb_stride, fb_height, &xfb_count); if ((!xfb_source_list || xfb_count == 0) && g_ActiveConfig.bUseXFB && !g_ActiveConfig.bUseRealXFB) { - RepeatFrameDumpFrame(); Core::Callback_VideoCopiedToXFB(false); return; } @@ -865,12 +847,10 @@ void Renderer::SwapImpl(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height D3D12_RANGE read_range = {0, dst_location.PlacedFootprint.Footprint.RowPitch * source_height}; CheckHR(s_screenshot_texture->Map(0, &read_range, &screenshot_texture_map)); - // TODO: This convertion is not needed. Get rid of it. - std::vector<u8> image(source_width * source_height * 3); - formatBufferDump(static_cast<u8*>(screenshot_texture_map), image.data(), source_width, - source_height, dst_location.PlacedFootprint.Footprint.RowPitch); - - DumpFrameData(image.data(), source_width, source_height, AVIDump::DumpFormat::FORMAT_BGR, true); + DumpFrameData(reinterpret_cast<const u8*>(screenshot_texture_map), source_width, source_height, + dst_location.PlacedFootprint.Footprint.RowPitch, + AVIDump::DumpFormat::FORMAT_RGBA); + FinishFrameData(); D3D12_RANGE write_range = {}; s_screenshot_texture->Unmap(0, &write_range); |
