Skip to content

Commit

Permalink
[d3d9] Don't block on GetRenderTargetData
Browse files Browse the repository at this point in the history
Fixes perf in #1363
  • Loading branch information
misyltoad committed Jan 24, 2020
1 parent 7469f5d commit 6fa28bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
12 changes: 4 additions & 8 deletions src/d3d9/d3d9_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,13 +812,8 @@ namespace dxvk {
cImage, cSubresources, VkOffset3D { 0, 0, 0 },
cLevelExtent);
});

// We need to force a wait here
// as some applications depend on
// DO_NOT_WAIT not applying after
// this has happened.
// (this is a blocking call)
WaitForResource(dstBuffer, 0);

dstTexInfo->SetDirty(dst->GetSubresource(), true);

return D3D_OK;
}
Expand Down Expand Up @@ -3861,7 +3856,8 @@ namespace dxvk {
// or is reading. Remember! This will only trigger for MANAGED resources
// that cannot get affected by GPU, therefore readonly is A-OK for NOT waiting.
const bool readOnly = Flags & D3DLOCK_READONLY;
const bool skipWait = (readOnly && managed) || scratch || (readOnly && systemmem);
const bool dirty = pResource->SetDirty(Subresource, false);
const bool skipWait = (readOnly && managed) || scratch || (readOnly && systemmem && !dirty);

if (alloced)
std::memset(physSlice.mapPtr, 0, physSlice.length);
Expand Down
7 changes: 1 addition & 6 deletions src/d3d9/d3d9_swapchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,7 @@ namespace dxvk {
cLevelExtent);
});

// We need to force a wait here
// as some applications depend on
// DO_NOT_WAIT not applying after
// this has happened.
// (this is a blocking call)
m_parent->WaitForResource(dstBuffer, 0);
dstTexInfo->SetDirty(dst->GetSubresource(), true);

return D3D_OK;
}
Expand Down

1 comment on commit 6fa28bf

@AlexTMjugador
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏🏻

Please sign in to comment.