1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 01:24:11 +01:00

[d3d11] Adjust buffer memory flags if apitrace is attached

Using cached memory speeds up apitrace significantly as it
reads back mapped memory regions.
This commit is contained in:
Philip Rebohle 2019-10-26 22:56:47 +02:00
parent 44c0f96fc1
commit 20f79a754b
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 21 additions and 0 deletions

View File

@ -252,6 +252,11 @@ namespace dxvk {
break;
}
if (memoryFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT && m_device->GetOptions()->apitraceMode) {
memoryFlags |= VK_MEMORY_PROPERTY_HOST_COHERENT_BIT
| VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
}
return memoryFlags;
}

View File

@ -17,6 +17,18 @@ namespace dxvk {
this->numBackBuffers = config.getOption<int32_t>("dxgi.numBackBuffers", 0);
this->maxFrameLatency = config.getOption<int32_t>("dxgi.maxFrameLatency", 0);
this->syncInterval = config.getOption<int32_t>("dxgi.syncInterval", -1);
bool apitraceAttached = false;
#ifndef __WINE__
apitraceAttached = ::GetModuleHandle("dxgitrace.dll") != nullptr;
#endif
this->apitraceMode = config.getOption<bool>("d3d11.apitraceMode", apitraceAttached);
// Inform user in case they have the option enabled or a game
// ships a file called dxgitrace.dll for whatever reason.
if (this->apitraceMode)
Logger::warn("D3D11: Apitrace mode enabled, may affect performance!");
}
}

View File

@ -76,6 +76,10 @@ namespace dxvk {
/// fixes issues with games that create multiple swap chains
/// for a single window that may interfere with each other.
bool deferSurfaceCreation;
/// Apitrace mode: Maps all buffers in cached memory.
/// Enabled automatically if dxgitrace.dll is attached.
bool apitraceMode;
};
}