summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D12/TextureCache.cpp
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2016-03-18 01:11:59 +0100
committerPierre Bourdon <delroth@gmail.com>2016-03-18 01:11:59 +0100
commit647fec92a047c7341be0216e81a81f48c7301749 (patch)
treef67415011f9296726a335c85ea514d553d3d4421 /Source/Core/VideoBackends/D3D12/TextureCache.cpp
parent421a67d7cce08aae2582b7337846d0691ba9edae (diff)
parente4f984d5dd10782ffdac07a932e78a5c22875bcd (diff)
Merge pull request #3266 from mimimi085181/partial-updates-with-parts-of-efb-copies
Partial texture updates with parts of efb copies
Diffstat (limited to 'Source/Core/VideoBackends/D3D12/TextureCache.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D12/TextureCache.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/Source/Core/VideoBackends/D3D12/TextureCache.cpp b/Source/Core/VideoBackends/D3D12/TextureCache.cpp
index 309e62c6fc..f4a57eb3e1 100644
--- a/Source/Core/VideoBackends/D3D12/TextureCache.cpp
+++ b/Source/Core/VideoBackends/D3D12/TextureCache.cpp
@@ -106,18 +106,13 @@ void TextureCache::TCacheEntry::CopyRectangleFromTexture(
if (src_rect.GetWidth() == dst_rect.GetWidth()
&& src_rect.GetHeight() == dst_rect.GetHeight())
{
- const D3D12_BOX* src_box_pointer = nullptr;
- D3D12_BOX src_box;
- if (src_rect.left != 0 || src_rect.top != 0)
- {
- src_box.front = 0;
- src_box.back = 1;
- src_box.left = src_rect.left;
- src_box.top = src_rect.top;
- src_box.right = src_rect.right;
- src_box.bottom = src_rect.bottom;
- src_box_pointer = &src_box;
- }
+ D3D12_BOX srcbox;
+ srcbox.left = src_rect.left;
+ srcbox.top = src_rect.top;
+ srcbox.right = src_rect.right;
+ srcbox.bottom = src_rect.bottom;
+ srcbox.front = 0;
+ srcbox.back = srcentry->config.layers;
if (static_cast<u32>(src_rect.GetHeight()) > config.height ||
static_cast<u32>(src_rect.GetWidth()) > config.width)
@@ -137,7 +132,7 @@ void TextureCache::TCacheEntry::CopyRectangleFromTexture(
m_texture->TransitionToResourceState(D3D::current_command_list, D3D12_RESOURCE_STATE_COPY_DEST);
srcentry->m_texture->TransitionToResourceState(D3D::current_command_list, D3D12_RESOURCE_STATE_COPY_SOURCE);
- D3D::current_command_list->CopyTextureRegion(&dst_location, dst_rect.left, dst_rect.top, 0, &src_location, src_box_pointer);
+ D3D::current_command_list->CopyTextureRegion(&dst_location, dst_rect.left, dst_rect.top, 0, &src_location, &srcbox);
m_texture->TransitionToResourceState(D3D::current_command_list, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);
srcentry->m_texture->TransitionToResourceState(D3D::current_command_list, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);