1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[d3d11] Fallout 4: Force Flush on GetData calls

This commit is contained in:
Philip Rebohle 2018-05-14 02:40:17 +02:00
parent a90c2843a7
commit 26b319b29b
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 18 additions and 2 deletions

View File

@ -203,9 +203,9 @@ namespace dxvk {
void STDMETHODCALLTYPE D3D11DeviceContext::End(ID3D11Asynchronous *pAsync) {
if (pAsync == nullptr)
return;
Com<ID3D11Query> query;
if (SUCCEEDED(pAsync->QueryInterface(__uuidof(ID3D11Query), reinterpret_cast<void**>(&query)))) {
Com<D3D11Query> queryPtr = static_cast<D3D11Query*>(query.ptr());
@ -242,6 +242,12 @@ namespace dxvk {
return E_INVALIDARG;
}
// Fallout 4 never actually calls this function without
// D3D11_ASYNC_GETDATA_DONOTFLUSH set, which may cause
// the game to freeze in certain situations.
if (m_parent->TestOption(D3D11Option::DisableGetDataFlagDoNotFlush))
GetDataFlags &= ~D3D11_ASYNC_GETDATA_DONOTFLUSH;
// Flush in order to make sure the query commands get dispatched
if ((GetDataFlags & D3D11_ASYNC_GETDATA_DONOTFLUSH) == 0)
Flush();

View File

@ -6,6 +6,7 @@ namespace dxvk {
const static std::unordered_map<std::string, D3D11OptionSet> g_d3d11AppOptions = {{
{ "Dishonored2.exe", D3D11OptionSet(D3D11Option::AllowMapFlagNoWait) },
{ "Fallout4.exe", D3D11OptionSet(D3D11Option::DisableGetDataFlagDoNotFlush) },
}};

View File

@ -14,6 +14,15 @@ namespace dxvk {
* operation succeeds when that flag is set.
*/
AllowMapFlagNoWait = 0,
/**
* \brief Ignore D3D11_ASYNC_GETDATA_DONOTFLUSH
*
* This can cause significant slowdowns, but some games
* expect the implementation to flush the context even
* when passing the \c DONOTFLUSH flag.
*/
DisableGetDataFlagDoNotFlush = 1,
};
using D3D11OptionSet = Flags<D3D11Option>;