From 4aaa3512258c343e61a4f7afa54485089234e1ce Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 29 Jan 2018 17:04:07 +0100 Subject: [PATCH] [d3d11] Fixed query-related logging Log messages in GetData did not take into account that writing back data is actually optional. --- src/d3d11/d3d11_context.cpp | 4 ++-- src/d3d11/d3d11_query.cpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index d79bcf27..bdbd6ab1 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -164,8 +164,8 @@ namespace dxvk { void* pData, UINT DataSize, UINT GetDataFlags) { - if (pAsync->GetDataSize() != DataSize) { - Logger::err("D3D11DeviceContext: GetData: Data size mismatch"); + if (pData != nullptr && pAsync->GetDataSize() != DataSize) { + Logger::err(str::format("D3D11DeviceContext: GetData: Data size mismatch: ", pAsync->GetDataSize(), ",", DataSize)); return E_INVALIDARG; } diff --git a/src/d3d11/d3d11_query.cpp b/src/d3d11/d3d11_query.cpp index eebfbf63..7f08fbdb 100644 --- a/src/d3d11/d3d11_query.cpp +++ b/src/d3d11/d3d11_query.cpp @@ -16,7 +16,9 @@ namespace dxvk { break; default: - Logger::warn(str::format("D3D11Query: Unsupported query type ", desc.Query)); + static bool errorShown = false; + if (!std::exchange(errorShown, true)) + Logger::warn(str::format("D3D11Query: Unsupported query type ", desc.Query)); } }