1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-29 19:24:10 +01:00

[d3d11] Silence some errors about invalid API usage on deferred contexts

Halo MCC apparently spams calls to GetData on deferred contexts, which
is obviously illegal.
This commit is contained in:
Philip Rebohle 2019-12-04 20:15:28 +01:00
parent e6503188d8
commit 07c2de62be
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -29,7 +29,11 @@ namespace dxvk {
void* pData, void* pData,
UINT DataSize, UINT DataSize,
UINT GetDataFlags) { UINT GetDataFlags) {
Logger::err("D3D11: GetData called on a deferred context"); static bool s_errorShown = false;
if (!std::exchange(s_errorShown, true))
Logger::warn("D3D11: GetData called on a deferred context");
return DXGI_ERROR_INVALID_CALL; return DXGI_ERROR_INVALID_CALL;
} }
@ -92,21 +96,31 @@ namespace dxvk {
void STDMETHODCALLTYPE D3D11DeferredContext::Flush() { void STDMETHODCALLTYPE D3D11DeferredContext::Flush() {
Logger::err("D3D11: Flush called on a deferred context"); static bool s_errorShown = false;
if (!std::exchange(s_errorShown, true))
Logger::warn("D3D11: Flush called on a deferred context");
} }
void STDMETHODCALLTYPE D3D11DeferredContext::Flush1( void STDMETHODCALLTYPE D3D11DeferredContext::Flush1(
D3D11_CONTEXT_TYPE ContextType, D3D11_CONTEXT_TYPE ContextType,
HANDLE hEvent) { HANDLE hEvent) {
Logger::err("D3D11: Flush1 called on a deferred context"); static bool s_errorShown = false;
if (!std::exchange(s_errorShown, true))
Logger::warn("D3D11: Flush1 called on a deferred context");
} }
HRESULT STDMETHODCALLTYPE D3D11DeferredContext::Signal( HRESULT STDMETHODCALLTYPE D3D11DeferredContext::Signal(
ID3D11Fence* pFence, ID3D11Fence* pFence,
UINT64 Value) { UINT64 Value) {
Logger::err("D3D11: Signal called on a deferred context"); static bool s_errorShown = false;
if (!std::exchange(s_errorShown, true))
Logger::warn("D3D11: Signal called on a deferred context");
return DXGI_ERROR_INVALID_CALL; return DXGI_ERROR_INVALID_CALL;
} }
@ -114,7 +128,11 @@ namespace dxvk {
HRESULT STDMETHODCALLTYPE D3D11DeferredContext::Wait( HRESULT STDMETHODCALLTYPE D3D11DeferredContext::Wait(
ID3D11Fence* pFence, ID3D11Fence* pFence,
UINT64 Value) { UINT64 Value) {
Logger::err("D3D11: Wait called on a deferred context"); static bool s_errorShown = false;
if (!std::exchange(s_errorShown, true))
Logger::warn("D3D11: Wait called on a deferred context");
return DXGI_ERROR_INVALID_CALL; return DXGI_ERROR_INVALID_CALL;
} }
@ -228,7 +246,10 @@ namespace dxvk {
void STDMETHODCALLTYPE D3D11DeferredContext::SwapDeviceContextState( void STDMETHODCALLTYPE D3D11DeferredContext::SwapDeviceContextState(
ID3DDeviceContextState* pState, ID3DDeviceContextState* pState,
ID3DDeviceContextState** ppPreviousState) { ID3DDeviceContextState** ppPreviousState) {
Logger::err("D3D11: SwapDeviceContextState called on a deferred context"); static bool s_errorShown = false;
if (!std::exchange(s_errorShown, true))
Logger::warn("D3D11: SwapDeviceContextState called on a deferred context");
} }