diff options
| author | JMC47 <JMC4789@gmail.com> | 2022-12-19 03:15:48 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-19 03:15:48 -0500 |
| commit | fb8aa9744e9dacf63dc95b01b8ec915c357c29d0 (patch) | |
| tree | 65f56c38a94954089c8df86b05d188834b89716a /Source/Core/VideoBackends/D3D12/D3D12PerfQuery.cpp | |
| parent | 9f4d9994bcb2f68831a5963845a67d711e5d6034 (diff) | |
| parent | 35a6d16d9e2ac4a6924ffdea0184a92da5e6bf60 (diff) | |
Merge pull request #11286 from K0bin/vk-query-fix
VideoBackends: Query fixes and cleanups
Diffstat (limited to 'Source/Core/VideoBackends/D3D12/D3D12PerfQuery.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D12/D3D12PerfQuery.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/Core/VideoBackends/D3D12/D3D12PerfQuery.cpp b/Source/Core/VideoBackends/D3D12/D3D12PerfQuery.cpp index 9b69a70ca2..06f6f9dbcc 100644 --- a/Source/Core/VideoBackends/D3D12/D3D12PerfQuery.cpp +++ b/Source/Core/VideoBackends/D3D12/D3D12PerfQuery.cpp @@ -48,7 +48,7 @@ bool PerfQuery::Initialize() return true; } -void PerfQuery::EnableQuery(PerfQueryGroup type) +void PerfQuery::EnableQuery(PerfQueryGroup group) { // Block if there are no free slots. // Otherwise, try to keep half of them available. @@ -66,20 +66,21 @@ void PerfQuery::EnableQuery(PerfQueryGroup type) // this assumes that the caller has bound all required state prior to enabling the query. Renderer::GetInstance()->ApplyState(); - if (type == PQG_ZCOMP_ZCOMPLOC || type == PQG_ZCOMP) + if (group == PQG_ZCOMP_ZCOMPLOC || group == PQG_ZCOMP) { ActiveQuery& entry = m_query_buffer[m_query_next_pos]; ASSERT(!entry.has_value && !entry.resolved); entry.has_value = true; + entry.query_group = group; g_dx_context->GetCommandList()->BeginQuery(m_query_heap.Get(), D3D12_QUERY_TYPE_OCCLUSION, m_query_next_pos); } } -void PerfQuery::DisableQuery(PerfQueryGroup type) +void PerfQuery::DisableQuery(PerfQueryGroup group) { - if (type == PQG_ZCOMP_ZCOMPLOC || type == PQG_ZCOMP) + if (group == PQG_ZCOMP_ZCOMPLOC || group == PQG_ZCOMP) { g_dx_context->GetCommandList()->EndQuery(m_query_heap.Get(), D3D12_QUERY_TYPE_OCCLUSION, m_query_next_pos); @@ -245,8 +246,8 @@ void PerfQuery::AccumulateQueriesFromBuffer(u32 query_count) const u64 native_res_result = static_cast<u64>(result) * EFB_WIDTH / g_renderer->GetTargetWidth() * EFB_HEIGHT / g_renderer->GetTargetHeight(); - m_results[entry.query_type].fetch_add(static_cast<u32>(native_res_result), - std::memory_order_relaxed); + m_results[entry.query_group].fetch_add(static_cast<u32>(native_res_result), + std::memory_order_relaxed); } constexpr D3D12_RANGE write_range = {0, 0}; |
