From c804d99db7db110228e4f233f079c7dac377e5d7 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 12 Jan 2019 15:22:34 +0100 Subject: [PATCH] [d3d11] Fix log spam in SetEvictionPriority stubs --- src/d3d11/d3d11_buffer.cpp | 6 ++++-- src/d3d11/d3d11_texture.cpp | 18 ++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/d3d11/d3d11_buffer.cpp b/src/d3d11/d3d11_buffer.cpp index 9df745d6..28699931 100644 --- a/src/d3d11/d3d11_buffer.cpp +++ b/src/d3d11/d3d11_buffer.cpp @@ -142,13 +142,15 @@ namespace dxvk { UINT STDMETHODCALLTYPE D3D11Buffer::GetEvictionPriority() { - Logger::warn("D3D11Buffer::GetEvictionPriority: Stub"); return DXGI_RESOURCE_PRIORITY_NORMAL; } void STDMETHODCALLTYPE D3D11Buffer::SetEvictionPriority(UINT EvictionPriority) { - Logger::warn("D3D11Buffer::SetEvictionPriority: Stub"); + static bool s_errorShown = false; + + if (!std::exchange(s_errorShown, true)) + Logger::warn("D3D11Buffer::SetEvictionPriority: Stub"); } diff --git a/src/d3d11/d3d11_texture.cpp b/src/d3d11/d3d11_texture.cpp index 22779398..058dbef2 100644 --- a/src/d3d11/d3d11_texture.cpp +++ b/src/d3d11/d3d11_texture.cpp @@ -598,13 +598,15 @@ namespace dxvk { UINT STDMETHODCALLTYPE D3D11Texture1D::GetEvictionPriority() { - Logger::warn("D3D11Texture1D::GetEvictionPriority: Stub"); return DXGI_RESOURCE_PRIORITY_NORMAL; } void STDMETHODCALLTYPE D3D11Texture1D::SetEvictionPriority(UINT EvictionPriority) { - Logger::warn("D3D11Texture1D::SetEvictionPriority: Stub"); + static bool s_errorShown = false; + + if (!std::exchange(s_errorShown, true)) + Logger::warn("D3D11Texture1D::SetEvictionPriority: Stub"); } @@ -677,13 +679,15 @@ namespace dxvk { UINT STDMETHODCALLTYPE D3D11Texture2D::GetEvictionPriority() { - Logger::warn("D3D11Texture2D::GetEvictionPriority: Stub"); return DXGI_RESOURCE_PRIORITY_NORMAL; } void STDMETHODCALLTYPE D3D11Texture2D::SetEvictionPriority(UINT EvictionPriority) { - Logger::warn("D3D11Texture2D::SetEvictionPriority: Stub"); + static bool s_errorShown = false; + + if (!std::exchange(s_errorShown, true)) + Logger::warn("D3D11Texture2D::SetEvictionPriority: Stub"); } @@ -758,13 +762,15 @@ namespace dxvk { UINT STDMETHODCALLTYPE D3D11Texture3D::GetEvictionPriority() { - Logger::warn("D3D11Texture3D::GetEvictionPriority: Stub"); return DXGI_RESOURCE_PRIORITY_NORMAL; } void STDMETHODCALLTYPE D3D11Texture3D::SetEvictionPriority(UINT EvictionPriority) { - Logger::warn("D3D11Texture3D::SetEvictionPriority: Stub"); + static bool s_errorShown = false; + + if (!std::exchange(s_errorShown, true)) + Logger::warn("D3D11Texture3D::SetEvictionPriority: Stub"); }