1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-11 01:24:12 +01:00

Merge pull request #30 from libcg/stadium2

[d3d11] mock D3D11_QUERY_TIMESTAMP
This commit is contained in:
Philip Rebohle 2018-01-23 09:24:29 +01:00 committed by GitHub
commit eff07dcf3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<UINT64*>(pData) = 1;
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:
*static_cast<BOOL*>(pData) = TRUE;
return S_OK;