1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-20 19:54:19 +01:00

[d3d10] Respect D3D10_CREATE_DEVICE_SINGLETHREADED flag

May improve performance in games which do not need the locking behaviour.
This commit is contained in:
Philip Rebohle 2018-10-12 18:36:02 +02:00
parent 6d18efdfc7
commit e549c9303b
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 8 additions and 2 deletions

View File

@ -9,7 +9,9 @@ namespace dxvk {
D3D11Device* pDevice,
D3D11ImmediateContext* pContext)
: m_device(pDevice), m_context(pContext) {
// Respecting the single-threaded flag may improve performance
UINT flags = pDevice->GetCreationFlags();
m_threadSafe = !(flags & D3D10_CREATE_DEVICE_SINGLETHREADED);
}

View File

@ -474,7 +474,9 @@ namespace dxvk {
UINT* pHeight);
D3D10DeviceLock LockDevice() {
return D3D10DeviceLock(m_mutex);
return m_threadSafe
? D3D10DeviceLock(m_mutex)
: D3D10DeviceLock();
}
private:
@ -483,6 +485,8 @@ namespace dxvk {
D3D11Device* m_device;
D3D11ImmediateContext* m_context;
bool m_threadSafe = true;
};
}