From fc43b836239257704fef1bbae79421abc7c2b820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Gu=C3=A9rin?= Date: Sat, 13 Jan 2018 23:35:33 -0800 Subject: [PATCH] [d3d11] move supported query check to d3d11_query it's better to have everything in one place. --- src/d3d11/d3d11_device.cpp | 8 +------- src/d3d11/d3d11_query.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index 2a1bc686d..38ffbc318 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -1063,15 +1063,9 @@ namespace dxvk { HRESULT STDMETHODCALLTYPE D3D11Device::CreateQuery( const D3D11_QUERY_DESC* pQueryDesc, ID3D11Query** ppQuery) { - // Other query types are currently unsupported - if (pQueryDesc->Query != D3D11_QUERY_OCCLUSION - && pQueryDesc->Query != D3D11_QUERY_OCCLUSION_PREDICATE) { - Logger::warn(str::format("D3D11Device: Unsupported query type: ", pQueryDesc->Query)); - } - if (ppQuery == nullptr) return S_FALSE; - + try { *ppQuery = ref(new D3D11Query(this, *pQueryDesc)); return S_OK; diff --git a/src/d3d11/d3d11_query.cpp b/src/d3d11/d3d11_query.cpp index 411394069..c7e53e7d2 100644 --- a/src/d3d11/d3d11_query.cpp +++ b/src/d3d11/d3d11_query.cpp @@ -7,7 +7,15 @@ namespace dxvk { D3D11Device* device, const D3D11_QUERY_DESC& desc) : m_device(device), m_desc(desc) { - Logger::warn("D3D11Query: Stub"); + switch (desc.Query) { + // Other query types are currently unsupported + case D3D11_QUERY_OCCLUSION: + case D3D11_QUERY_OCCLUSION_PREDICATE: + break; + + default: + Logger::warn(str::format("D3D11Query: Unsupported query type ", desc.Query)); + } }