diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 5a24bde05..71c68a12d 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -3159,7 +3159,7 @@ namespace dxvk { HRESULT STDMETHODCALLTYPE D3D9DeviceEx::CreateQuery(D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery) { InitReturnPtr(ppQuery); - HRESULT hr = D3D9Query::QuerySupported(Type); + HRESULT hr = D3D9Query::QuerySupported(this, Type); if (ppQuery == nullptr || hr != D3D_OK) return hr; diff --git a/src/d3d9/d3d9_query.cpp b/src/d3d9/d3d9_query.cpp index 301295ecc..8ebd2e3b3 100644 --- a/src/d3d9/d3d9_query.cpp +++ b/src/d3d9/d3d9_query.cpp @@ -13,9 +13,7 @@ namespace dxvk { Rc dxvkDevice = m_parent->GetDXVKDevice(); switch (m_queryType) { - case D3DQUERYTYPE_VCACHE: - if (!pDevice->GetOptions()->supportVCache) - throw DxvkError(str::format("D3D9Query: Unsupported query type ", m_queryType, " (from d3d9.supportVCache)")); + case D3DQUERYTYPE_VCACHE: break; case D3DQUERYTYPE_EVENT: @@ -293,9 +291,13 @@ namespace dxvk { } - HRESULT D3D9Query::QuerySupported(D3DQUERYTYPE QueryType) { + HRESULT D3D9Query::QuerySupported(D3D9DeviceEx* pDevice, D3DQUERYTYPE QueryType) { switch (QueryType) { case D3DQUERYTYPE_VCACHE: + if (!pDevice->GetOptions()->supportVCache) + return D3DERR_NOTAVAILABLE; + + return D3D_OK; case D3DQUERYTYPE_EVENT: case D3DQUERYTYPE_OCCLUSION: case D3DQUERYTYPE_TIMESTAMP: diff --git a/src/d3d9/d3d9_query.h b/src/d3d9/d3d9_query.h index b53d55316..ac6611e40 100644 --- a/src/d3d9/d3d9_query.h +++ b/src/d3d9/d3d9_query.h @@ -48,7 +48,7 @@ namespace dxvk { static bool QueryBeginnable(D3DQUERYTYPE QueryType); static bool QueryEndable(D3DQUERYTYPE QueryType); - static HRESULT QuerySupported(D3DQUERYTYPE QueryType); + static HRESULT QuerySupported(D3D9DeviceEx* pDevice, D3DQUERYTYPE QueryType); bool IsEvent() const { return m_queryType == D3DQUERYTYPE_EVENT;