mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-23 10:54:14 +01:00
[d3d9,d3d11] Adjust flush heuristic on tiling GPUs
Probably needs work, just disable most of the heuristic for the time being.
This commit is contained in:
parent
00299b264b
commit
80fb7e2294
@ -18,7 +18,7 @@ namespace dxvk {
|
||||
: D3D11CommonContext<D3D11ImmediateContext>(pParent, Device, 0, DxvkCsChunkFlag::SingleUse),
|
||||
m_csThread(Device, Device->createContext()),
|
||||
m_submissionFence(new sync::CallbackFence()),
|
||||
m_flushTracker(pParent->GetOptions()->reproducibleCommandStream),
|
||||
m_flushTracker(GetMaxFlushType(pParent, Device)),
|
||||
m_stagingBufferFence(new sync::Fence(0)),
|
||||
m_multithread(this, false, pParent->GetOptions()->enableContextLock),
|
||||
m_videoContext(this, Device) {
|
||||
@ -1074,4 +1074,16 @@ namespace dxvk {
|
||||
return stats;
|
||||
}
|
||||
|
||||
|
||||
GpuFlushType D3D11ImmediateContext::GetMaxFlushType(
|
||||
D3D11Device* pParent,
|
||||
const Rc<DxvkDevice>& Device) {
|
||||
if (pParent->GetOptions()->reproducibleCommandStream)
|
||||
return GpuFlushType::ExplicitFlush;
|
||||
else if (Device->perfHints().preferRenderPassOps)
|
||||
return GpuFlushType::ImplicitStrongHint;
|
||||
else
|
||||
return GpuFlushType::ImplicitWeakHint;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -208,6 +208,10 @@ namespace dxvk {
|
||||
|
||||
DxvkStagingBufferStats GetStagingMemoryStatistics();
|
||||
|
||||
static GpuFlushType GetMaxFlushType(
|
||||
D3D11Device* pParent,
|
||||
const Rc<DxvkDevice>& Device);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ namespace dxvk {
|
||||
, m_csThread ( dxvkDevice, dxvkDevice->createContext() )
|
||||
, m_csChunk ( AllocCsChunk() )
|
||||
, m_submissionFence ( new sync::Fence() )
|
||||
, m_flushTracker ( m_d3d9Options.reproducibleCommandStream )
|
||||
, m_flushTracker ( GetMaxFlushType() )
|
||||
, m_d3d9Interop ( this )
|
||||
, m_d3d9On12 ( this )
|
||||
, m_d3d8Bridge ( this ) {
|
||||
@ -8731,4 +8731,14 @@ namespace dxvk {
|
||||
m_flags.clr(D3D9DeviceFlag::DirtySpecializationEntries);
|
||||
}
|
||||
|
||||
|
||||
GpuFlushType D3D9DeviceEx::GetMaxFlushType() const {
|
||||
if (m_d3d9Options.reproducibleCommandStream)
|
||||
return GpuFlushType::ExplicitFlush;
|
||||
else if (m_dxvkDevice->perfHints().preferRenderPassOps)
|
||||
return GpuFlushType::ImplicitStrongHint;
|
||||
else
|
||||
return GpuFlushType::ImplicitWeakHint;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1397,6 +1397,8 @@ namespace dxvk {
|
||||
&& !m_state.renderTargets[Index]->IsNull();
|
||||
}
|
||||
|
||||
GpuFlushType GetMaxFlushType() const;
|
||||
|
||||
Com<D3D9InterfaceEx> m_parent;
|
||||
D3DDEVTYPE m_deviceType;
|
||||
HWND m_window;
|
||||
|
@ -2,9 +2,8 @@
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
GpuFlushTracker::GpuFlushTracker(
|
||||
bool ensureReproducibleHeuristic)
|
||||
: m_ensureReproducibleHeuristic(ensureReproducibleHeuristic) {
|
||||
GpuFlushTracker::GpuFlushTracker(GpuFlushType maxType)
|
||||
: m_maxType(maxType) {
|
||||
|
||||
}
|
||||
|
||||
@ -23,7 +22,7 @@ namespace dxvk {
|
||||
if (!chunkCount)
|
||||
return false;
|
||||
|
||||
if (m_ensureReproducibleHeuristic && flushType != GpuFlushType::ExplicitFlush)
|
||||
if (flushType > m_maxType)
|
||||
return false;
|
||||
|
||||
// Take any earlier missed flush with a stronger hint into account, so
|
||||
|
@ -34,7 +34,7 @@ namespace dxvk {
|
||||
|
||||
public:
|
||||
|
||||
GpuFlushTracker(bool ensureReproducibleHeuristic);
|
||||
GpuFlushTracker(GpuFlushType maxAllowed);
|
||||
|
||||
/**
|
||||
* \brief Checks whether a context flush should be performed
|
||||
@ -63,8 +63,7 @@ namespace dxvk {
|
||||
|
||||
private:
|
||||
|
||||
bool m_ensureReproducibleHeuristic;
|
||||
|
||||
GpuFlushType m_maxType = GpuFlushType::ImplicitWeakHint;
|
||||
GpuFlushType m_lastMissedType = GpuFlushType::ImplicitWeakHint;
|
||||
|
||||
uint64_t m_lastFlushChunkId = 0ull;
|
||||
|
Loading…
x
Reference in New Issue
Block a user