Rise
The Vieneo Province
Loading...
Searching...
No Matches
Rendering::FrameProfiler11 Class Reference

#include <FrameProfiler11.h>

Collaboration diagram for Rendering::FrameProfiler11:
[legend]

Classes

struct  GpuQueries
struct  Work
struct  Memory
struct  Event
struct  FrameData
struct  Frame
struct  OutputFrame
struct  ChatMarker
struct  CpuSample

Public Member Functions

 FrameProfiler11 ()
 ~FrameProfiler11 ()
 FrameProfiler11 (const FrameProfiler11 &)=delete
FrameProfiler11 & operator= (const FrameProfiler11 &)=delete
void Reset ()
void BeginFrame (ID3D11Device *native, ID3D11DeviceContext *immediate, UINT width, UINT height, UINT samples, bool vsync, double interval)
void Scene (int vehicle, double altitude, bool above, bool outside, int dock, int rain)
void FlightMotion (double verticalSpeedMps, bool valid)
void RecordChat (const wchar_t *message, unsigned channel)
void CloudClearance (float radiusKm)
void CloudScene (bool volume, float base, float top, float density)
void BillboardDecode (double milliseconds)
void GeometryDraw (UINT primitives)
void ConstantUpload (UINT bytes)
void BufferUpload (UINT64 bytes)
void TextureUpload (UINT64 bytes)
LONGLONG BeginShaderBind () const
void EndShaderBind (LONGLONG start)
CpuSample BeginAccumulatedCpu (const char *name)
void EndAccumulatedCpu (const CpuSample &sample)
bool Capturing () const
bool DisplayDetailActive () const
void EnterDisplayDetail ()
void LeaveDisplayDetail ()
int BeginCpu (const char *name, const char *detail=nullptr, bool displayOnly=false)
int Begin (const char *name, bool gpu=true, bool mergeCpu=false)
void End (int index)
void BeginGpu ()
void EndGpu ()
void EndFrame ()

Static Public Member Functions

static FrameProfiler11 & Get ()

Private Types

using Query = Microsoft::WRL::ComPtr<ID3D11Query>
using OutputQueue = BoundedSpscQueue<OutputFrame,WriterQueueSize>

Private Member Functions

double Ms (LONGLONG ticks) const
void ReadClientVersion ()
void WriteStatus (FILE *file, bool writerStopped)
void PersistStatus (bool writerStopped)
void SampleMemory ()
bool Initialize (ID3D11Device *native, ID3D11DeviceContext *immediate)
bool OpenOutput ()
void WriteFrame (const OutputFrame &frame)
void WriteMarker (const ChatMarker &marker)
void WriterLoop ()
bool StartWorker (ID3D11Device *native)
void Enqueue (Frame &frame)
void Poll ()

Static Private Member Functions

static Work Delta (const Work &a, const Work &b)
static void CopyName (Event &event, const char *name)
static LONGLONG Now ()
static bool HasFlag (const wchar_t *flag)
static void WriteJsonString (FILE *file, const wchar_t *value)

Private Attributes

std::unique_ptr< std::array< Frame, RingSize > > ring
Frame * current =nullptr
ID3D11Device * device =nullptr
ID3D11DeviceContext * context =nullptr
Microsoft::WRL::ComPtr< IDXGIAdapter3 > adapter
std::vector< DeviceMetadata > devices
char clientVersion [64] {}
bool versionRead =false
Memory memory
LONGLONG lastMemory =0
std::unique_ptr< OutputQueue > outputQueue
BoundedSpscQueue< ChatMarker, 64 > chatQueue
std::atomic< UINT64 > markersDropped {0}
double lastAltitude =0
std::thread writer
HANDLE wake =nullptr
std::atomic< bool > stopping {false}
std::atomic< bool > captureRequested {false}
std::atomic< bool > ioFailed {false}
std::mutex memoryMutex
Memory sampledMemory
FILE * output =nullptr
std::atomic< UINT64 > writerDropped {0}
unsigned pollNext =0
double pollMs =0
double enqueueMs =0
unsigned next =0
int parent =-1
int gpuFrame =-1
UINT64 sequence =0
std::atomic< UINT64 > dropped {0}
LONGLONG frequency =0
LONGLONG started =0
LONGLONG lastFlush =0
bool optedIn =false
bool autoCapture =false
bool failed =false
bool fileStarted =false
unsigned displayDepth =0

Static Private Attributes

static constexpr unsigned RingSize =8
static constexpr unsigned MaxEvents =1024
static constexpr unsigned MaxGpuEvents =192
static constexpr unsigned WriterQueueSize =32
static constexpr unsigned OutputBufferBytes =1024*1024

Detailed Description

Definition at line 37 of file FrameProfiler11.h.

Member Typedef Documentation

◆ OutputQueue

◆ Query

using Rendering::FrameProfiler11::Query = Microsoft::WRL::ComPtr<ID3D11Query>
private

Definition at line 41 of file FrameProfiler11.h.

Constructor & Destructor Documentation

◆ FrameProfiler11() [1/2]

Rendering::FrameProfiler11::FrameProfiler11 ( )
inline

Definition at line 488 of file FrameProfiler11.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~FrameProfiler11()

Rendering::FrameProfiler11::~FrameProfiler11 ( )
inline

Definition at line 496 of file FrameProfiler11.h.

Here is the call graph for this function:

◆ FrameProfiler11() [2/2]

Rendering::FrameProfiler11::FrameProfiler11 ( const FrameProfiler11 & )
delete
Here is the call graph for this function:

Member Function Documentation

◆ Begin()

int Rendering::FrameProfiler11::Begin ( const char * name,
bool gpu = true,
bool mergeCpu = false )
inline

Definition at line 634 of file FrameProfiler11.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BeginAccumulatedCpu()

CpuSample Rendering::FrameProfiler11::BeginAccumulatedCpu ( const char * name)
inline

Definition at line 594 of file FrameProfiler11.h.

Here is the call graph for this function:

◆ BeginCpu()

int Rendering::FrameProfiler11::BeginCpu ( const char * name,
const char * detail = nullptr,
bool displayOnly = false )
inline

Definition at line 625 of file FrameProfiler11.h.

Here is the call graph for this function:

◆ BeginFrame()

void Rendering::FrameProfiler11::BeginFrame ( ID3D11Device * native,
ID3D11DeviceContext * immediate,
UINT width,
UINT height,
UINT samples,
bool vsync,
double interval )
inline

Definition at line 517 of file FrameProfiler11.h.

Here is the call graph for this function:

◆ BeginGpu()

void Rendering::FrameProfiler11::BeginGpu ( )
inline

Definition at line 671 of file FrameProfiler11.h.

Here is the call graph for this function:

◆ BeginShaderBind()

LONGLONG Rendering::FrameProfiler11::BeginShaderBind ( ) const
inline

Definition at line 589 of file FrameProfiler11.h.

Here is the call graph for this function:

◆ BillboardDecode()

void Rendering::FrameProfiler11::BillboardDecode ( double milliseconds)
inline

Definition at line 581 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ BufferUpload()

void Rendering::FrameProfiler11::BufferUpload ( UINT64 bytes)
inline

Definition at line 587 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ Capturing()

bool Rendering::FrameProfiler11::Capturing ( ) const
inline

Definition at line 621 of file FrameProfiler11.h.

◆ CloudClearance()

void Rendering::FrameProfiler11::CloudClearance ( float radiusKm)
inline

Definition at line 576 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ CloudScene()

void Rendering::FrameProfiler11::CloudScene ( bool volume,
float base,
float top,
float density )
inline

Definition at line 577 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ ConstantUpload()

void Rendering::FrameProfiler11::ConstantUpload ( UINT bytes)
inline

Definition at line 586 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ CopyName()

void Rendering::FrameProfiler11::CopyName ( Event & event,
const char * name )
inlinestaticprivate

Definition at line 157 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ Delta()

Work Rendering::FrameProfiler11::Delta ( const Work & a,
const Work & b )
inlinestaticprivate

Definition at line 49 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ DisplayDetailActive()

bool Rendering::FrameProfiler11::DisplayDetailActive ( ) const
inline

Definition at line 622 of file FrameProfiler11.h.

◆ End()

void Rendering::FrameProfiler11::End ( int index)
inline

Definition at line 659 of file FrameProfiler11.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EndAccumulatedCpu()

void Rendering::FrameProfiler11::EndAccumulatedCpu ( const CpuSample & sample)
inline

Definition at line 610 of file FrameProfiler11.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EndFrame()

void Rendering::FrameProfiler11::EndFrame ( )
inline

Definition at line 682 of file FrameProfiler11.h.

Here is the call graph for this function:

◆ EndGpu()

void Rendering::FrameProfiler11::EndGpu ( )
inline

Definition at line 677 of file FrameProfiler11.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EndShaderBind()

void Rendering::FrameProfiler11::EndShaderBind ( LONGLONG start)
inline

Definition at line 590 of file FrameProfiler11.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Enqueue()

void Rendering::FrameProfiler11::Enqueue ( Frame & frame)
inlineprivate

Definition at line 429 of file FrameProfiler11.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EnterDisplayDetail()

void Rendering::FrameProfiler11::EnterDisplayDetail ( )
inline

Definition at line 623 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ FlightMotion()

void Rendering::FrameProfiler11::FlightMotion ( double verticalSpeedMps,
bool valid )
inline

Definition at line 553 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ GeometryDraw()

void Rendering::FrameProfiler11::GeometryDraw ( UINT primitives)
inline

Definition at line 585 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ Get()

FrameProfiler11 & Rendering::FrameProfiler11::Get ( )
inlinestatic

Definition at line 499 of file FrameProfiler11.h.

Here is the call graph for this function:

◆ HasFlag()

bool Rendering::FrameProfiler11::HasFlag ( const wchar_t * flag)
inlinestaticprivate

Definition at line 166 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ Initialize()

bool Rendering::FrameProfiler11::Initialize ( ID3D11Device * native,
ID3D11DeviceContext * immediate )
inlineprivate

Definition at line 260 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ LeaveDisplayDetail()

void Rendering::FrameProfiler11::LeaveDisplayDetail ( )
inline

Definition at line 624 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ Ms()

double Rendering::FrameProfiler11::Ms ( LONGLONG ticks) const
inlineprivate

Definition at line 174 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ Now()

LONGLONG Rendering::FrameProfiler11::Now ( )
inlinestaticprivate

Definition at line 165 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ OpenOutput()

bool Rendering::FrameProfiler11::OpenOutput ( )
inlineprivate

Definition at line 274 of file FrameProfiler11.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

FrameProfiler11 & Rendering::FrameProfiler11::operator= ( const FrameProfiler11 & )
delete
Here is the call graph for this function:

◆ PersistStatus()

void Rendering::FrameProfiler11::PersistStatus ( bool writerStopped)
inlineprivate

Definition at line 223 of file FrameProfiler11.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Poll()

void Rendering::FrameProfiler11::Poll ( )
inlineprivate

Definition at line 442 of file FrameProfiler11.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadClientVersion()

void Rendering::FrameProfiler11::ReadClientVersion ( )
inlineprivate

Definition at line 175 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ RecordChat()

void Rendering::FrameProfiler11::RecordChat ( const wchar_t * message,
unsigned channel )
inline

Definition at line 561 of file FrameProfiler11.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Reset()

void Rendering::FrameProfiler11::Reset ( )
inline

Definition at line 504 of file FrameProfiler11.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SampleMemory()

void Rendering::FrameProfiler11::SampleMemory ( )
inlineprivate

Definition at line 239 of file FrameProfiler11.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Scene()

void Rendering::FrameProfiler11::Scene ( int vehicle,
double altitude,
bool above,
bool outside,
int dock,
int rain )
inline

Definition at line 544 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ StartWorker()

bool Rendering::FrameProfiler11::StartWorker ( ID3D11Device * native)
inlineprivate

Definition at line 408 of file FrameProfiler11.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TextureUpload()

void Rendering::FrameProfiler11::TextureUpload ( UINT64 bytes)
inline

Definition at line 588 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ WriteFrame()

void Rendering::FrameProfiler11::WriteFrame ( const OutputFrame & frame)
inlineprivate

Definition at line 286 of file FrameProfiler11.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteJsonString()

void Rendering::FrameProfiler11::WriteJsonString ( FILE * file,
const wchar_t * value )
inlinestaticprivate

Definition at line 192 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ WriteMarker()

void Rendering::FrameProfiler11::WriteMarker ( const ChatMarker & marker)
inlineprivate

Definition at line 314 of file FrameProfiler11.h.

Here is the caller graph for this function:

◆ WriterLoop()

void Rendering::FrameProfiler11::WriterLoop ( )
inlineprivate

Definition at line 345 of file FrameProfiler11.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteStatus()

void Rendering::FrameProfiler11::WriteStatus ( FILE * file,
bool writerStopped )
inlineprivate

Definition at line 203 of file FrameProfiler11.h.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ adapter

Microsoft::WRL::ComPtr<IDXGIAdapter3> Rendering::FrameProfiler11::adapter
private

Definition at line 118 of file FrameProfiler11.h.

◆ autoCapture

bool Rendering::FrameProfiler11::autoCapture =false
private

Definition at line 154 of file FrameProfiler11.h.

◆ captureRequested

std::atomic<bool> Rendering::FrameProfiler11::captureRequested {false}
private

Definition at line 142 of file FrameProfiler11.h.

◆ chatQueue

BoundedSpscQueue<ChatMarker,64> Rendering::FrameProfiler11::chatQueue
private

Definition at line 137 of file FrameProfiler11.h.

◆ clientVersion

char Rendering::FrameProfiler11::clientVersion[64] {}
private

Definition at line 127 of file FrameProfiler11.h.

◆ context

ID3D11DeviceContext* Rendering::FrameProfiler11::context =nullptr
private

Definition at line 117 of file FrameProfiler11.h.

◆ current

Frame* Rendering::FrameProfiler11::current =nullptr
private

Definition at line 115 of file FrameProfiler11.h.

◆ device

ID3D11Device* Rendering::FrameProfiler11::device =nullptr
private

Definition at line 116 of file FrameProfiler11.h.

◆ devices

std::vector<DeviceMetadata> Rendering::FrameProfiler11::devices
private

Definition at line 126 of file FrameProfiler11.h.

◆ displayDepth

unsigned Rendering::FrameProfiler11::displayDepth =0
private

Definition at line 155 of file FrameProfiler11.h.

◆ dropped

std::atomic<UINT64> Rendering::FrameProfiler11::dropped {0}
private

Definition at line 152 of file FrameProfiler11.h.

◆ enqueueMs

double Rendering::FrameProfiler11::enqueueMs =0
private

Definition at line 148 of file FrameProfiler11.h.

◆ failed

bool Rendering::FrameProfiler11::failed =false
private

Definition at line 154 of file FrameProfiler11.h.

◆ fileStarted

bool Rendering::FrameProfiler11::fileStarted =false
private

Definition at line 154 of file FrameProfiler11.h.

◆ frequency

LONGLONG Rendering::FrameProfiler11::frequency =0
private

Definition at line 153 of file FrameProfiler11.h.

◆ gpuFrame

int Rendering::FrameProfiler11::gpuFrame =-1
private

Definition at line 150 of file FrameProfiler11.h.

◆ ioFailed

std::atomic<bool> Rendering::FrameProfiler11::ioFailed {false}
private

Definition at line 142 of file FrameProfiler11.h.

◆ lastAltitude

double Rendering::FrameProfiler11::lastAltitude =0
private

Definition at line 139 of file FrameProfiler11.h.

◆ lastFlush

LONGLONG Rendering::FrameProfiler11::lastFlush =0
private

Definition at line 153 of file FrameProfiler11.h.

◆ lastMemory

LONGLONG Rendering::FrameProfiler11::lastMemory =0
private

Definition at line 130 of file FrameProfiler11.h.

◆ markersDropped

std::atomic<UINT64> Rendering::FrameProfiler11::markersDropped {0}
private

Definition at line 138 of file FrameProfiler11.h.

◆ MaxEvents

unsigned Rendering::FrameProfiler11::MaxEvents =1024
staticprivate

Definition at line 39 of file FrameProfiler11.h.

◆ MaxGpuEvents

unsigned Rendering::FrameProfiler11::MaxGpuEvents =192
staticprivate

Definition at line 39 of file FrameProfiler11.h.

◆ memory

Memory Rendering::FrameProfiler11::memory
private

Definition at line 129 of file FrameProfiler11.h.

◆ memoryMutex

std::mutex Rendering::FrameProfiler11::memoryMutex
private

Definition at line 143 of file FrameProfiler11.h.

◆ next

unsigned Rendering::FrameProfiler11::next =0
private

Definition at line 149 of file FrameProfiler11.h.

◆ optedIn

bool Rendering::FrameProfiler11::optedIn =false
private

Definition at line 154 of file FrameProfiler11.h.

◆ output

FILE* Rendering::FrameProfiler11::output =nullptr
private

Definition at line 145 of file FrameProfiler11.h.

◆ OutputBufferBytes

unsigned Rendering::FrameProfiler11::OutputBufferBytes =1024*1024
staticprivate

Definition at line 40 of file FrameProfiler11.h.

◆ outputQueue

std::unique_ptr<OutputQueue> Rendering::FrameProfiler11::outputQueue
private

Definition at line 134 of file FrameProfiler11.h.

◆ parent

int Rendering::FrameProfiler11::parent =-1
private

Definition at line 150 of file FrameProfiler11.h.

◆ pollMs

double Rendering::FrameProfiler11::pollMs =0
private

Definition at line 148 of file FrameProfiler11.h.

◆ pollNext

unsigned Rendering::FrameProfiler11::pollNext =0
private

Definition at line 147 of file FrameProfiler11.h.

◆ ring

std::unique_ptr<std::array<Frame,RingSize> > Rendering::FrameProfiler11::ring
private

Definition at line 114 of file FrameProfiler11.h.

◆ RingSize

unsigned Rendering::FrameProfiler11::RingSize =8
staticconstexprprivate

Definition at line 39 of file FrameProfiler11.h.

◆ sampledMemory

Memory Rendering::FrameProfiler11::sampledMemory
private

Definition at line 144 of file FrameProfiler11.h.

◆ sequence

UINT64 Rendering::FrameProfiler11::sequence =0
private

Definition at line 151 of file FrameProfiler11.h.

◆ started

LONGLONG Rendering::FrameProfiler11::started =0
private

Definition at line 153 of file FrameProfiler11.h.

◆ stopping

std::atomic<bool> Rendering::FrameProfiler11::stopping {false}
private

Definition at line 142 of file FrameProfiler11.h.

◆ versionRead

bool Rendering::FrameProfiler11::versionRead =false
private

Definition at line 128 of file FrameProfiler11.h.

◆ wake

HANDLE Rendering::FrameProfiler11::wake =nullptr
private

Definition at line 141 of file FrameProfiler11.h.

◆ writer

std::thread Rendering::FrameProfiler11::writer
private

Definition at line 140 of file FrameProfiler11.h.

◆ writerDropped

std::atomic<UINT64> Rendering::FrameProfiler11::writerDropped {0}
private

Definition at line 146 of file FrameProfiler11.h.

◆ WriterQueueSize

unsigned Rendering::FrameProfiler11::WriterQueueSize =32
staticconstexprprivate

Definition at line 40 of file FrameProfiler11.h.


The documentation for this class was generated from the following file: