mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-21 22:54:16 +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:
parent
6d18efdfc7
commit
e549c9303b
@ -9,7 +9,9 @@ namespace dxvk {
|
|||||||
D3D11Device* pDevice,
|
D3D11Device* pDevice,
|
||||||
D3D11ImmediateContext* pContext)
|
D3D11ImmediateContext* pContext)
|
||||||
: m_device(pDevice), m_context(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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -474,7 +474,9 @@ namespace dxvk {
|
|||||||
UINT* pHeight);
|
UINT* pHeight);
|
||||||
|
|
||||||
D3D10DeviceLock LockDevice() {
|
D3D10DeviceLock LockDevice() {
|
||||||
return D3D10DeviceLock(m_mutex);
|
return m_threadSafe
|
||||||
|
? D3D10DeviceLock(m_mutex)
|
||||||
|
: D3D10DeviceLock();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -483,6 +485,8 @@ namespace dxvk {
|
|||||||
D3D11Device* m_device;
|
D3D11Device* m_device;
|
||||||
D3D11ImmediateContext* m_context;
|
D3D11ImmediateContext* m_context;
|
||||||
|
|
||||||
|
bool m_threadSafe = true;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user