mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-11-29 19:24:10 +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:
parent
44c0f96fc1
commit
20f79a754b
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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!");
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user