[d3d9] Remove evictManagedOnUnlock

This is annoying to maintain and hopefully won't be necessary anymore.
This commit is contained in:
Robin Kertels 2022-03-15 22:07:37 +01:00 committed by Joshie
parent 116feca6af
commit 45c1d7911e
4 changed files with 4 additions and 20 deletions

View File

@ -298,17 +298,6 @@
# d3d9.shaderModel = 3
# Evict Managed on Unlock
#
# Decides whether we should evict managed resources from
# system memory when they are unlocked entirely.
#
# Supported values:
# - True, False: Always enable / disable
# d3d9.evictManagedOnUnlock = False
# DPI Awareness
#
# Decides whether we should call SetProcessDPIAware on device

View File

@ -4309,8 +4309,7 @@ namespace dxvk {
pResource->SetLocked(Subresource, true);
const bool noDirtyUpdate = Flags & D3DLOCK_NO_DIRTY_UPDATE;
if (likely((pResource->IsManaged() && m_d3d9Options.evictManagedOnUnlock)
|| ((desc.Pool == D3DPOOL_DEFAULT || !noDirtyUpdate) && !readOnly))) {
if ((desc.Pool == D3DPOOL_DEFAULT || !noDirtyUpdate) && !readOnly) {
if (pBox && MipLevel != 0) {
D3DBOX scaledBox = *pBox;
scaledBox.Left <<= MipLevel;
@ -4325,7 +4324,7 @@ namespace dxvk {
}
}
if (managed && !m_d3d9Options.evictManagedOnUnlock && !readOnly) {
if (managed && !readOnly) {
pResource->SetNeedsUpload(Subresource, true);
for (uint32_t i : bit::BitMask(m_activeTextures)) {
@ -4373,7 +4372,7 @@ namespace dxvk {
const D3DBOX& box = pResource->GetDirtyBox(Face);
bool shouldFlush = pResource->GetMapMode() == D3D9_COMMON_TEXTURE_MAP_MODE_BACKED;
shouldFlush &= box.Left < box.Right && box.Top < box.Bottom && box.Front < box.Back;
shouldFlush &= !pResource->IsManaged() || m_d3d9Options.evictManagedOnUnlock;
shouldFlush &= !pResource->IsManaged();
if (shouldFlush) {
this->FlushImage(pResource, Subresource);
@ -4385,7 +4384,7 @@ namespace dxvk {
// and we aren't managed (for sysmem copy.)
bool shouldToss = pResource->GetMapMode() == D3D9_COMMON_TEXTURE_MAP_MODE_BACKED;
shouldToss &= !pResource->IsDynamic();
shouldToss &= !pResource->IsManaged() || m_d3d9Options.evictManagedOnUnlock;
shouldToss &= !pResource->IsManaged();
if (shouldToss) {
pResource->DestroyBufferSubresource(Subresource);

View File

@ -43,7 +43,6 @@ namespace dxvk {
this->maxFrameRate = config.getOption<int32_t> ("d3d9.maxFrameRate", 0);
this->presentInterval = config.getOption<int32_t> ("d3d9.presentInterval", -1);
this->shaderModel = config.getOption<int32_t> ("d3d9.shaderModel", 3);
this->evictManagedOnUnlock = config.getOption<bool> ("d3d9.evictManagedOnUnlock", false);
this->dpiAware = config.getOption<bool> ("d3d9.dpiAware", true);
this->strictConstantCopies = config.getOption<bool> ("d3d9.strictConstantCopies", false);
this->strictPow = config.getOption<bool> ("d3d9.strictPow", true);

View File

@ -36,9 +36,6 @@ namespace dxvk {
/// Set the max shader model the device can support in the caps.
int32_t shaderModel;
/// Whether or not managed resources should stay in memory until unlock, or until manually evicted.
bool evictManagedOnUnlock;
/// Whether or not to set the process as DPI aware in Windows when the API interface is created.
bool dpiAware;