mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[d3d11] Do not synchronize with CS thread in GetData
Instead, use a counter to determine whether there are any pending operation for the query on the CS thread.
This commit is contained in:
parent
0924bb469c
commit
d96c22be05
@ -77,10 +77,6 @@ namespace dxvk {
|
|||||||
// DataSize is 0, but we should ignore that pointer
|
// DataSize is 0, but we should ignore that pointer
|
||||||
pData = DataSize ? pData : nullptr;
|
pData = DataSize ? pData : nullptr;
|
||||||
|
|
||||||
// Ensure that all query commands actually get
|
|
||||||
// executed before trying to access the query
|
|
||||||
SynchronizeCsThread();
|
|
||||||
|
|
||||||
// Get query status directly from the query object
|
// Get query status directly from the query object
|
||||||
auto query = static_cast<D3D11Query*>(pAsync);
|
auto query = static_cast<D3D11Query*>(pAsync);
|
||||||
HRESULT hr = query->GetData(pData, GetDataFlags);
|
HRESULT hr = query->GetData(pData, GetDataFlags);
|
||||||
|
@ -214,6 +214,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
if (unlikely(m_predicate != nullptr))
|
if (unlikely(m_predicate != nullptr))
|
||||||
ctx->writePredicate(DxvkBufferSlice(m_predicate), m_query[0]);
|
ctx->writePredicate(DxvkBufferSlice(m_predicate), m_query[0]);
|
||||||
|
|
||||||
|
m_resetCtr -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -230,6 +232,7 @@ namespace dxvk {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_state = D3D11_VK_QUERY_ENDED;
|
m_state = D3D11_VK_QUERY_ENDED;
|
||||||
|
m_resetCtr += 1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,6 +240,12 @@ namespace dxvk {
|
|||||||
HRESULT STDMETHODCALLTYPE D3D11Query::GetData(
|
HRESULT STDMETHODCALLTYPE D3D11Query::GetData(
|
||||||
void* pData,
|
void* pData,
|
||||||
UINT GetDataFlags) {
|
UINT GetDataFlags) {
|
||||||
|
if (m_state != D3D11_VK_QUERY_ENDED)
|
||||||
|
return DXGI_ERROR_INVALID_CALL;
|
||||||
|
|
||||||
|
if (m_resetCtr != 0u)
|
||||||
|
return S_FALSE;
|
||||||
|
|
||||||
if (m_desc.Query == D3D11_QUERY_EVENT) {
|
if (m_desc.Query == D3D11_QUERY_EVENT) {
|
||||||
DxvkGpuEventStatus status = m_event[0]->test();
|
DxvkGpuEventStatus status = m_event[0]->test();
|
||||||
|
|
||||||
|
@ -114,6 +114,8 @@ namespace dxvk {
|
|||||||
uint32_t m_stallMask = 0;
|
uint32_t m_stallMask = 0;
|
||||||
bool m_stallFlag = false;
|
bool m_stallFlag = false;
|
||||||
|
|
||||||
|
std::atomic<uint32_t> m_resetCtr = { 0u };
|
||||||
|
|
||||||
UINT64 GetTimestampQueryFrequency() const;
|
UINT64 GetTimestampQueryFrequency() const;
|
||||||
|
|
||||||
Rc<DxvkBuffer> CreatePredicateBuffer();
|
Rc<DxvkBuffer> CreatePredicateBuffer();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user