1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-13 16:08:50 +01:00

[d3d11] mock D3D11_QUERY_TIMESTAMP

Trackmania was freezing on this query when clicking on "Connect".
This commit is contained in:
Clément Guérin 2018-01-22 21:39:54 -08:00
parent 0900dfd0e3
commit 781ebc4732

View File

@ -10,6 +10,8 @@ namespace dxvk {
switch (desc.Query) { switch (desc.Query) {
// Other query types are currently unsupported // Other query types are currently unsupported
case D3D11_QUERY_OCCLUSION: case D3D11_QUERY_OCCLUSION:
case D3D11_QUERY_TIMESTAMP:
case D3D11_QUERY_TIMESTAMP_DISJOINT:
case D3D11_QUERY_OCCLUSION_PREDICATE: case D3D11_QUERY_OCCLUSION_PREDICATE:
break; break;
@ -89,6 +91,7 @@ namespace dxvk {
void* pData, void* pData,
UINT GetDataFlags) { UINT GetDataFlags) {
static bool errorShown = false; static bool errorShown = false;
static UINT64 fakeTimestamp = 0;
if (!std::exchange(errorShown, true)) if (!std::exchange(errorShown, true))
Logger::warn("D3D11Query::GetData: Stub"); Logger::warn("D3D11Query::GetData: Stub");
@ -101,6 +104,15 @@ namespace dxvk {
*static_cast<UINT64*>(pData) = 1; *static_cast<UINT64*>(pData) = 1;
return S_OK; return S_OK;
case D3D11_QUERY_TIMESTAMP:
*static_cast<UINT64*>(pData) = fakeTimestamp++;
return S_OK;
case D3D11_QUERY_TIMESTAMP_DISJOINT:
static_cast<D3D11_QUERY_DATA_TIMESTAMP_DISJOINT*>(pData)->Frequency = 1000;
static_cast<D3D11_QUERY_DATA_TIMESTAMP_DISJOINT*>(pData)->Disjoint = FALSE;
return S_OK;
case D3D11_QUERY_OCCLUSION_PREDICATE: case D3D11_QUERY_OCCLUSION_PREDICATE:
*static_cast<BOOL*>(pData) = TRUE; *static_cast<BOOL*>(pData) = TRUE;
return S_OK; return S_OK;