mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
D3D12: Implement perf query support
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <d3d12.h>
|
||||
|
||||
#include "VideoCommon/PerfQueryBase.h"
|
||||
|
||||
@ -27,20 +28,33 @@ public:
|
||||
private:
|
||||
struct ActiveQuery
|
||||
{
|
||||
//ID3D11Query* query;
|
||||
PerfQueryGroup query_type;
|
||||
UINT64 fence_value;
|
||||
};
|
||||
|
||||
void WeakFlush();
|
||||
|
||||
// Find the last fence value of all pending queries.
|
||||
UINT64 FindLastPendingFenceValue() const;
|
||||
|
||||
// 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;
|
||||
static void QueueFenceCallback(void* owning_object, UINT64 fence_value);
|
||||
void QueueFence(UINT64 fence_value);
|
||||
|
||||
std::array<ActiveQuery, s_perf_query_buffer_size> m_query_buffer;
|
||||
// when testing in SMS: 64 was too small, 128 was ok
|
||||
static constexpr size_t PERF_QUERY_BUFFER_SIZE = 512;
|
||||
static constexpr size_t QUERY_READBACK_BUFFER_SIZE = PERF_QUERY_BUFFER_SIZE * sizeof(UINT64);
|
||||
|
||||
std::array<ActiveQuery, PERF_QUERY_BUFFER_SIZE> m_query_buffer;
|
||||
int m_query_read_pos = 0;
|
||||
|
||||
ID3D12QueryHeap* m_query_heap = nullptr;
|
||||
ID3D12Resource* m_query_readback_buffer = nullptr;
|
||||
|
||||
ID3D12Fence* m_tracking_fence = nullptr;
|
||||
UINT64 m_next_fence_value = 0;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
Reference in New Issue
Block a user