mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
VideoBackends:Metal: Implement PerfQuery
This commit is contained in:
@ -3,6 +3,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
|
||||
#include "VideoCommon/PerfQueryBase.h"
|
||||
|
||||
namespace Metal
|
||||
@ -10,11 +13,22 @@ namespace Metal
|
||||
class PerfQuery final : public PerfQueryBase
|
||||
{
|
||||
public:
|
||||
void EnableQuery(PerfQueryGroup type) override {}
|
||||
void DisableQuery(PerfQueryGroup type) override {}
|
||||
void ResetQuery() override {}
|
||||
u32 GetQueryResult(PerfQueryType type) override { return 0; }
|
||||
void FlushResults() override {}
|
||||
bool IsFlushed() const override { return true; }
|
||||
void EnableQuery(PerfQueryGroup type) override;
|
||||
void DisableQuery(PerfQueryGroup type) override;
|
||||
void ResetQuery() override;
|
||||
u32 GetQueryResult(PerfQueryType type) override;
|
||||
void FlushResults() override;
|
||||
bool IsFlushed() const override;
|
||||
|
||||
/// Notify PerfQuery of a new pending encoder
|
||||
/// One call to ReturnResults should be made for every call to IncCount
|
||||
void IncCount() { m_query_count.fetch_add(1, std::memory_order_relaxed); }
|
||||
/// May be called from any thread
|
||||
void ReturnResults(const u64* data, const PerfQueryGroup* groups, size_t count, u32 query_id);
|
||||
|
||||
private:
|
||||
u32 m_current_query = 0;
|
||||
std::mutex m_results_mtx;
|
||||
std::condition_variable m_cv;
|
||||
};
|
||||
} // namespace Metal
|
||||
|
Reference in New Issue
Block a user