1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-01 16:24:12 +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:
Philip Rebohle 2019-11-02 13:29:53 +01:00
parent 0924bb469c
commit d96c22be05
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 11 additions and 4 deletions

View File

@ -77,10 +77,6 @@ namespace dxvk {
// DataSize is 0, but we should ignore that pointer
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
auto query = static_cast<D3D11Query*>(pAsync);
HRESULT hr = query->GetData(pData, GetDataFlags);

View File

@ -214,6 +214,8 @@ namespace dxvk {
if (unlikely(m_predicate != nullptr))
ctx->writePredicate(DxvkBufferSlice(m_predicate), m_query[0]);
m_resetCtr -= 1;
}
@ -230,6 +232,7 @@ namespace dxvk {
return false;
m_state = D3D11_VK_QUERY_ENDED;
m_resetCtr += 1;
return true;
}
@ -237,6 +240,12 @@ namespace dxvk {
HRESULT STDMETHODCALLTYPE D3D11Query::GetData(
void* pData,
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) {
DxvkGpuEventStatus status = m_event[0]->test();

View File

@ -114,6 +114,8 @@ namespace dxvk {
uint32_t m_stallMask = 0;
bool m_stallFlag = false;
std::atomic<uint32_t> m_resetCtr = { 0u };
UINT64 GetTimestampQueryFrequency() const;
Rc<DxvkBuffer> CreatePredicateBuffer();