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

[dxvk] Introduce new 'Created' state for queries

New initial state for queries. D3D11 returns an error when trying to
retrieve data from a query in this state, rather than S_FALSE or S_OK.
This commit is contained in:
Philip Rebohle 2018-09-10 23:07:51 +02:00
parent d7441f274b
commit ea9e812798
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 15 additions and 8 deletions

View File

@ -201,9 +201,15 @@ namespace dxvk {
} else {
DxvkQueryData queryData = {};
if (m_query != nullptr
&& m_query->getData(queryData) != DxvkQueryStatus::Available)
return S_FALSE;
if (m_query != nullptr) {
DxvkQueryStatus status = m_query->getData(queryData);
if (status == DxvkQueryStatus::Created)
return DXGI_ERROR_INVALID_CALL;
if (status != DxvkQueryStatus::Available)
return S_FALSE;
}
if (pData == nullptr)
return S_OK;

View File

@ -13,10 +13,11 @@ namespace dxvk {
* the current status of the query.
*/
enum class DxvkQueryStatus : uint32_t {
Reset = 0, ///< Query is reset
Active = 1, ///< Query is being recorded
Pending = 2, ///< Query has been recorded
Available = 3, ///< Query results can be retrieved
Created = 0, ///< Query was just created
Reset = 1, ///< Query is reset
Active = 2, ///< Query is being recorded
Pending = 3, ///< Query has been recorded
Available = 4, ///< Query results can be retrieved
};
/**
@ -190,7 +191,7 @@ namespace dxvk {
std::mutex m_mutex;
DxvkQueryStatus m_status = DxvkQueryStatus::Reset;
DxvkQueryStatus m_status = DxvkQueryStatus::Created;
DxvkQueryData m_data = {};
DxvkQueryHandle m_handle;