summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D12/Render.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2016-10-08 14:46:44 +0200
committerdegasus <wickmarkus@web.de>2016-10-08 15:40:49 +0200
commit1ef5ba0c53fc82017dbe9ec745e7eb2765a928ed (patch)
tree9987e73e19745b514fdea8119abb0e579cf5a9a2 /Source/Core/VideoBackends/D3D12/Render.cpp
parentb5a91e1dfaf62924e05421de48987c105546f8ca (diff)
D3D: Skip redundant format convertions.
Diffstat (limited to 'Source/Core/VideoBackends/D3D12/Render.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D12/Render.cpp24
1 files changed, 2 insertions, 22 deletions
diff --git a/Source/Core/VideoBackends/D3D12/Render.cpp b/Source/Core/VideoBackends/D3D12/Render.cpp
index 0646490044..cd402d0ecc 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)
@@ -863,12 +847,8 @@ 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,
+ AVIDump::DumpFormat::FORMAT_RGBA);
FinishFrameData();
D3D12_RANGE write_range = {};