mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
D3D12: Initial commit for D3D12 backend implementation.
This commit is contained in:
46
Source/Core/VideoBackends/D3D12/PerfQuery.h
Normal file
46
Source/Core/VideoBackends/D3D12/PerfQuery.h
Normal file
@ -0,0 +1,46 @@
|
||||
// Copyright 2012 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
|
||||
#include "VideoCommon/PerfQueryBase.h"
|
||||
|
||||
namespace DX12
|
||||
{
|
||||
|
||||
class PerfQuery final : public PerfQueryBase
|
||||
{
|
||||
public:
|
||||
PerfQuery();
|
||||
~PerfQuery();
|
||||
|
||||
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;
|
||||
|
||||
private:
|
||||
struct ActiveQuery
|
||||
{
|
||||
ID3D11Query* query;
|
||||
PerfQueryGroup query_type;
|
||||
};
|
||||
|
||||
void WeakFlush();
|
||||
|
||||
// Only use when non-empty
|
||||
void FlushOne();
|
||||
|
||||
// when testing in SMS: 64 was too small, 128 was ok
|
||||
static const int s_perf_query_buffer_size = 512;
|
||||
|
||||
std::array<ActiveQuery, s_perf_query_buffer_size> m_query_buffer;
|
||||
int m_query_read_pos = 0;
|
||||
};
|
||||
|
||||
} // namespace
|
Reference in New Issue
Block a user