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:
parent
d7441f274b
commit
ea9e812798
@ -201,9 +201,15 @@ namespace dxvk {
|
||||
} else {
|
||||
DxvkQueryData queryData = {};
|
||||
|
||||
if (m_query != nullptr
|
||||
&& m_query->getData(queryData) != DxvkQueryStatus::Available)
|
||||
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;
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user