1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

[d3d11] Report correct timer frequency for TIMESTAMP_DISJOINT queries

This commit is contained in:
Philip Rebohle 2018-06-13 14:29:58 +02:00
parent 48e0b6d684
commit c93f2b980e
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 12 additions and 2 deletions

View File

@ -208,9 +208,8 @@ namespace dxvk {
return S_OK; return S_OK;
case D3D11_QUERY_TIMESTAMP_DISJOINT: { case D3D11_QUERY_TIMESTAMP_DISJOINT: {
// FIXME return correct frequency
auto data = static_cast<D3D11_QUERY_DATA_TIMESTAMP_DISJOINT*>(pData); auto data = static_cast<D3D11_QUERY_DATA_TIMESTAMP_DISJOINT*>(pData);
data->Frequency = 1000; data->Frequency = GetTimestampQueryFrequency();
data->Disjoint = FALSE; data->Disjoint = FALSE;
} return S_OK; } return S_OK;
@ -236,4 +235,13 @@ namespace dxvk {
} }
} }
UINT64 D3D11Query::GetTimestampQueryFrequency() const {
Rc<DxvkDevice> device = m_device->GetDXVKDevice();
Rc<DxvkAdapter> adapter = device->adapter();
VkPhysicalDeviceLimits limits = adapter->deviceProperties().limits;
return uint64_t(1'000'000'000.0f / limits.timestampPeriod);
}
} }

View File

@ -53,6 +53,8 @@ namespace dxvk {
uint32_t m_revision = 0; uint32_t m_revision = 0;
UINT64 GetTimestampQueryFrequency() const;
}; };
} }