From cc78276897455845f7f64d7521b1f3f7e795b3cb Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 1 Mar 2023 13:13:16 +0100 Subject: [PATCH] [d3d11] Only log QueryInterface errors once --- src/d3d11/d3d11_blend.cpp | 7 +++++-- src/d3d11/d3d11_buffer.cpp | 7 +++++-- src/d3d11/d3d11_class_linkage.cpp | 7 +++++-- src/d3d11/d3d11_cmdlist.cpp | 7 +++++-- src/d3d11/d3d11_context.cpp | 7 +++++-- src/d3d11/d3d11_depth_stencil.cpp | 7 +++++-- src/d3d11/d3d11_device.cpp | 7 +++++-- src/d3d11/d3d11_fence.cpp | 7 +++++-- src/d3d11/d3d11_input_layout.cpp | 7 +++++-- src/d3d11/d3d11_query.cpp | 7 +++++-- src/d3d11/d3d11_rasterizer.cpp | 7 +++++-- src/d3d11/d3d11_sampler.cpp | 7 +++++-- src/d3d11/d3d11_shader.h | 6 ++++-- src/d3d11/d3d11_state_object.cpp | 7 +++++-- src/d3d11/d3d11_swapchain.cpp | 6 +++++- src/d3d11/d3d11_texture.cpp | 21 +++++++++++++++------ src/d3d11/d3d11_video.cpp | 28 ++++++++++++++++++++-------- src/d3d11/d3d11_view_dsv.cpp | 7 +++++-- src/d3d11/d3d11_view_rtv.cpp | 7 +++++-- src/d3d11/d3d11_view_srv.cpp | 7 +++++-- src/d3d11/d3d11_view_uav.cpp | 7 +++++-- 21 files changed, 129 insertions(+), 51 deletions(-) diff --git a/src/d3d11/d3d11_blend.cpp b/src/d3d11/d3d11_blend.cpp index 38752b69..441d35a7 100644 --- a/src/d3d11/d3d11_blend.cpp +++ b/src/d3d11/d3d11_blend.cpp @@ -58,8 +58,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11BlendState::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11BlendState), riid)) { + Logger::warn("D3D11BlendState::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_buffer.cpp b/src/d3d11/d3d11_buffer.cpp index 8296f6d6..6695fd05 100644 --- a/src/d3d11/d3d11_buffer.cpp +++ b/src/d3d11/d3d11_buffer.cpp @@ -138,8 +138,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11Buffer::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11Buffer), riid)) { + Logger::warn("D3D11Buffer::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_class_linkage.cpp b/src/d3d11/d3d11_class_linkage.cpp index 8070b660..d2bc7588 100644 --- a/src/d3d11/d3d11_class_linkage.cpp +++ b/src/d3d11/d3d11_class_linkage.cpp @@ -28,8 +28,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11ClassLinkage::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11ClassLinkage), riid)) { + Logger::warn("D3D11ClassLinkage::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_cmdlist.cpp b/src/d3d11/d3d11_cmdlist.cpp index e15f322a..31ed4376 100644 --- a/src/d3d11/d3d11_cmdlist.cpp +++ b/src/d3d11/d3d11_cmdlist.cpp @@ -30,8 +30,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11CommandList::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11CommandList), riid)) { + Logger::warn("D3D11CommandList::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index e13342da..d2440135 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -61,8 +61,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11DeviceContext::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11DeviceContext), riid)) { + Logger::warn("D3D11DeviceContext::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_depth_stencil.cpp b/src/d3d11/d3d11_depth_stencil.cpp index ded08d02..65416c9d 100644 --- a/src/d3d11/d3d11_depth_stencil.cpp +++ b/src/d3d11/d3d11_depth_stencil.cpp @@ -41,8 +41,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11DepthStencilState::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11DepthStencilState), riid)) { + Logger::warn("D3D11DepthStencilState::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index a69a0164..1398fa70 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -3153,8 +3153,11 @@ namespace dxvk { if (riid == GUID{0xd56e2a4c,0x5127,0x8437,{0x65,0x8a,0x98,0xc5,0xbb,0x78,0x94,0x98}}) return E_NOINTERFACE; - Logger::warn("D3D11DXGIDevice::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(IDXGIDXVKDevice), riid)) { + Logger::warn("D3D11DXGIDevice::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_fence.cpp b/src/d3d11/d3d11_fence.cpp index 8c37a5f3..3eeb6946 100644 --- a/src/d3d11/d3d11_fence.cpp +++ b/src/d3d11/d3d11_fence.cpp @@ -48,8 +48,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11Fence: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11Fence), riid)) { + Logger::warn("D3D11Fence: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_input_layout.cpp b/src/d3d11/d3d11_input_layout.cpp index 257e38a7..3b42e0a4 100644 --- a/src/d3d11/d3d11_input_layout.cpp +++ b/src/d3d11/d3d11_input_layout.cpp @@ -46,8 +46,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11InputLayout::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11InputLayout), riid)) { + Logger::warn("D3D11InputLayout::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_query.cpp b/src/d3d11/d3d11_query.cpp index b7145739..6629cd56 100644 --- a/src/d3d11/d3d11_query.cpp +++ b/src/d3d11/d3d11_query.cpp @@ -120,8 +120,11 @@ namespace dxvk { } } - Logger::warn("D3D11Query: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11Query), riid)) { + Logger::warn("D3D11Query: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_rasterizer.cpp b/src/d3d11/d3d11_rasterizer.cpp index 169ce3b5..4a441f70 100644 --- a/src/d3d11/d3d11_rasterizer.cpp +++ b/src/d3d11/d3d11_rasterizer.cpp @@ -74,8 +74,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11RasterizerState::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11RasterizerState), riid)) { + Logger::warn("D3D11RasterizerState::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_sampler.cpp b/src/d3d11/d3d11_sampler.cpp index f0cd292f..a80c9180 100644 --- a/src/d3d11/d3d11_sampler.cpp +++ b/src/d3d11/d3d11_sampler.cpp @@ -86,8 +86,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11SamplerState::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11SamplerState), riid)) { + Logger::warn("D3D11SamplerState::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_shader.h b/src/d3d11/d3d11_shader.h index fe499bc1..8d6e1125 100644 --- a/src/d3d11/d3d11_shader.h +++ b/src/d3d11/d3d11_shader.h @@ -134,8 +134,10 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11Shader::QueryInterface: Unknown interface query"); - return E_NOINTERFACE; + if (logQueryInterfaceError(__uuidof(D3D11Interface), riid)) { + Logger::warn("D3D11Shader::QueryInterface: Unknown interface query"); + return E_NOINTERFACE; + } } const D3D11CommonShader* GetCommonShader() const { diff --git a/src/d3d11/d3d11_state_object.cpp b/src/d3d11/d3d11_state_object.cpp index 33cc8a33..3a8f2d84 100644 --- a/src/d3d11/d3d11_state_object.cpp +++ b/src/d3d11/d3d11_state_object.cpp @@ -29,8 +29,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11DeviceContextState::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3DDeviceContextState), riid)) { + Logger::warn("D3D11DeviceContextState::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_swapchain.cpp b/src/d3d11/d3d11_swapchain.cpp index 98cbc4df..fbe78a5b 100644 --- a/src/d3d11/d3d11_swapchain.cpp +++ b/src/d3d11/d3d11_swapchain.cpp @@ -103,7 +103,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11SwapChain::QueryInterface: Unknown interface query"); + if (logQueryInterfaceError(__uuidof(IDXGIVkSwapChain), riid)) { + Logger::warn("D3D11SwapChain::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_texture.cpp b/src/d3d11/d3d11_texture.cpp index 26e6c270..15579edd 100644 --- a/src/d3d11/d3d11_texture.cpp +++ b/src/d3d11/d3d11_texture.cpp @@ -1086,8 +1086,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11Texture1D::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D10Texture1D), riid)) { + Logger::warn("D3D11Texture1D::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } @@ -1243,8 +1246,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11Texture2D::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D10Texture2D), riid)) { + Logger::warn("D3D11Texture2D::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } @@ -1350,8 +1356,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11Texture3D::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D10Texture3D), riid)) { + Logger::warn("D3D11Texture3D::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_video.cpp b/src/d3d11/d3d11_video.cpp index 47179394..3851a498 100644 --- a/src/d3d11/d3d11_video.cpp +++ b/src/d3d11/d3d11_video.cpp @@ -32,8 +32,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11VideoProcessorEnumerator::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11VideoProcessorEnumerator), riid)) { + Logger::warn("D3D11VideoProcessorEnumerator::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } @@ -136,8 +139,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11VideoProcessor::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11VideoProcessor), riid)) { + Logger::warn("D3D11VideoProcessor::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } @@ -247,8 +253,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11VideoProcessorInputView::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11VideoProcessorInputView), riid)) { + Logger::warn("D3D11VideoProcessorInputView::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } @@ -326,8 +335,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11VideoProcessorOutputView::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11VideoProcessorOutputView), riid)) { + Logger::warn("D3D11VideoProcessorOutputView::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_view_dsv.cpp b/src/d3d11/d3d11_view_dsv.cpp index 62e79fed..c9a861f9 100644 --- a/src/d3d11/d3d11_view_dsv.cpp +++ b/src/d3d11/d3d11_view_dsv.cpp @@ -130,8 +130,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11DepthStencilView::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11DepthStencilView), riid)) { + Logger::warn("D3D11DepthStencilView::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_view_rtv.cpp b/src/d3d11/d3d11_view_rtv.cpp index 09153d0a..eeb8787c 100644 --- a/src/d3d11/d3d11_view_rtv.cpp +++ b/src/d3d11/d3d11_view_rtv.cpp @@ -141,8 +141,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11RenderTargetView::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11RenderTargetView), riid)) { + Logger::warn("D3D11RenderTargetView::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_view_srv.cpp b/src/d3d11/d3d11_view_srv.cpp index 73c179b0..4d1bd048 100644 --- a/src/d3d11/d3d11_view_srv.cpp +++ b/src/d3d11/d3d11_view_srv.cpp @@ -209,8 +209,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11ShaderResourceView::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11ShaderResourceView), riid)) { + Logger::warn("D3D11ShaderResourceView::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; } diff --git a/src/d3d11/d3d11_view_uav.cpp b/src/d3d11/d3d11_view_uav.cpp index f21fe053..94faf88d 100644 --- a/src/d3d11/d3d11_view_uav.cpp +++ b/src/d3d11/d3d11_view_uav.cpp @@ -147,8 +147,11 @@ namespace dxvk { return S_OK; } - Logger::warn("D3D11UnorderedAccessView::QueryInterface: Unknown interface query"); - Logger::warn(str::format(riid)); + if (logQueryInterfaceError(__uuidof(ID3D11UnorderedAccessView), riid)) { + Logger::warn("D3D11UnorderedAccessView::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + } + return E_NOINTERFACE; }