mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[d3d11] Flush implicitly when GetData returns S_FALSE
Keeps the GPU busy when spinning on a query and ensures that we're flushing at some point. Replaces the Fallout 4 hang workaround.
This commit is contained in:
parent
a2df1ea4c9
commit
d4cb5115e7
@ -73,16 +73,26 @@ namespace dxvk {
|
|||||||
if ((GetDataFlags & D3D11_ASYNC_GETDATA_DONOTFLUSH) == 0)
|
if ((GetDataFlags & D3D11_ASYNC_GETDATA_DONOTFLUSH) == 0)
|
||||||
Flush();
|
Flush();
|
||||||
|
|
||||||
// This method handles various different but incompatible interfaces,
|
// Default error return for unsupported interfaces
|
||||||
|
HRESULT hr = E_INVALIDARG;
|
||||||
|
|
||||||
|
// This method can handle various incompatible interfaces,
|
||||||
// so we have to find out what we are actually dealing with
|
// so we have to find out what we are actually dealing with
|
||||||
Com<ID3D11Query> query;
|
Com<ID3D11Query> query;
|
||||||
|
|
||||||
if (SUCCEEDED(pAsync->QueryInterface(__uuidof(ID3D11Query), reinterpret_cast<void**>(&query))))
|
if (SUCCEEDED(pAsync->QueryInterface(__uuidof(ID3D11Query), reinterpret_cast<void**>(&query))))
|
||||||
return static_cast<D3D11Query*>(query.ptr())->GetData(pData, GetDataFlags);
|
hr = static_cast<D3D11Query*>(query.ptr())->GetData(pData, GetDataFlags);
|
||||||
|
|
||||||
// The interface is not supported
|
// If we're likely going to spin on the asynchronous object,
|
||||||
Logger::err("D3D11: GetData: Unsupported Async type");
|
// flush the context so that we're keeping the GPU busy
|
||||||
return E_INVALIDARG;
|
if (hr == S_FALSE)
|
||||||
|
FlushImplicit();
|
||||||
|
|
||||||
|
// The requested interface is not supported
|
||||||
|
if (FAILED(hr))
|
||||||
|
Logger::err("D3D11: GetData: Unsupported Async type");
|
||||||
|
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -103,10 +113,11 @@ namespace dxvk {
|
|||||||
|
|
||||||
FlushCsChunk();
|
FlushCsChunk();
|
||||||
|
|
||||||
// Reset optimization info
|
|
||||||
m_csIsBusy = false;
|
|
||||||
m_lastFlush = std::chrono::high_resolution_clock::now();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset optimization info
|
||||||
|
m_csIsBusy = false;
|
||||||
|
m_lastFlush = std::chrono::high_resolution_clock::now();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user