mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 05:52:11 +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)
|
||||
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
|
||||
Com<ID3D11Query> 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
|
||||
Logger::err("D3D11: GetData: Unsupported Async type");
|
||||
return E_INVALIDARG;
|
||||
// If we're likely going to spin on the asynchronous object,
|
||||
// flush the context so that we're keeping the GPU busy
|
||||
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();
|
||||
|
||||
// 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