summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D12/Render.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2016-03-15 22:26:01 +1000
committerStenzek <stenzek@gmail.com>2016-05-08 23:18:59 +1000
commitccf9470241309114bdc46d9dc80bb9b99aed4a41 (patch)
tree81fe92b0101399b9ecf1d935b4f5628cfd67a5b2 /Source/Core/VideoBackends/D3D12/Render.cpp
parentfde7dee652674f3d42d80e2f4a3ae0ff30ecaa06 (diff)
D3D12: Specify read/write ranges when calling Map/Unmap
Diffstat (limited to 'Source/Core/VideoBackends/D3D12/Render.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D12/Render.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/Core/VideoBackends/D3D12/Render.cpp b/Source/Core/VideoBackends/D3D12/Render.cpp
index 05cc323c0b..17653bd193 100644
--- a/Source/Core/VideoBackends/D3D12/Render.cpp
+++ b/Source/Core/VideoBackends/D3D12/Render.cpp
@@ -665,11 +665,13 @@ bool Renderer::SaveScreenshot(const std::string& filename, const TargetRectangle
D3D::command_list_mgr->ExecuteQueuedWork(true);
void* screenshot_texture_map;
- CheckHR(s_screenshot_texture->Map(0, nullptr, &screenshot_texture_map));
+ D3D12_RANGE read_range = { 0, dst_location.PlacedFootprint.Footprint.RowPitch * (source_box.bottom - source_box.top) };
+ CheckHR(s_screenshot_texture->Map(0, &read_range, &screenshot_texture_map));
saved_png = TextureToPng(static_cast<u8*>(screenshot_texture_map), dst_location.PlacedFootprint.Footprint.RowPitch, filename, source_box.right - source_box.left, source_box.bottom - source_box.top, false);
- s_screenshot_texture->Unmap(0, nullptr);
+ D3D12_RANGE write_range = {};
+ s_screenshot_texture->Unmap(0, &write_range);
if (saved_png)
{
@@ -871,9 +873,12 @@ void Renderer::SwapImpl(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height
}
void* screenshot_texture_map;
- CheckHR(s_screenshot_texture->Map(0, nullptr, &screenshot_texture_map));
+ D3D12_RANGE read_range = { 0, dst_location.PlacedFootprint.Footprint.RowPitch * source_height };
+ CheckHR(s_screenshot_texture->Map(0, &read_range, &screenshot_texture_map));
formatBufferDump(static_cast<u8*>(screenshot_texture_map), &frame_data[0], source_width, source_height, dst_location.PlacedFootprint.Footprint.RowPitch);
- s_screenshot_texture->Unmap(0, nullptr);
+
+ D3D12_RANGE write_range = {};
+ s_screenshot_texture->Unmap(0, &write_range);
FlipImageData(&frame_data[0], w, h);
AVIDump::AddFrame(&frame_data[0], source_width, source_height);