From 781ebc4732e8044438c22d7c88e46f22cc722d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Gu=C3=A9rin?= Date: Mon, 22 Jan 2018 21:39:54 -0800 Subject: [PATCH] [d3d11] mock D3D11_QUERY_TIMESTAMP Trackmania was freezing on this query when clicking on "Connect". --- src/d3d11/d3d11_query.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/d3d11/d3d11_query.cpp b/src/d3d11/d3d11_query.cpp index c7e53e7d..eebfbf63 100644 --- a/src/d3d11/d3d11_query.cpp +++ b/src/d3d11/d3d11_query.cpp @@ -10,6 +10,8 @@ namespace dxvk { switch (desc.Query) { // Other query types are currently unsupported case D3D11_QUERY_OCCLUSION: + case D3D11_QUERY_TIMESTAMP: + case D3D11_QUERY_TIMESTAMP_DISJOINT: case D3D11_QUERY_OCCLUSION_PREDICATE: break; @@ -89,6 +91,7 @@ namespace dxvk { void* pData, UINT GetDataFlags) { static bool errorShown = false; + static UINT64 fakeTimestamp = 0; if (!std::exchange(errorShown, true)) Logger::warn("D3D11Query::GetData: Stub"); @@ -100,7 +103,16 @@ namespace dxvk { case D3D11_QUERY_OCCLUSION: *static_cast(pData) = 1; return S_OK; - + + case D3D11_QUERY_TIMESTAMP: + *static_cast(pData) = fakeTimestamp++; + return S_OK; + + case D3D11_QUERY_TIMESTAMP_DISJOINT: + static_cast(pData)->Frequency = 1000; + static_cast(pData)->Disjoint = FALSE; + return S_OK; + case D3D11_QUERY_OCCLUSION_PREDICATE: *static_cast(pData) = TRUE; return S_OK;