Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
DebugViewer Class Reference

Provide helper GUI to display the content of textures and mesh infos. This can be useful to validate the content rendered to a specific texture when debugging. More...

#include <DebugViewer.hpp>

Classes

struct  MarkerCategoryInfos
 
struct  MarkerInfos
 
struct  MeshInfos
 
struct  StateInfos
 
struct  TextureInfos
 

Public Member Functions

 DebugViewer ()
 
void track (const Texture *tex)
 
void track (const Mesh *mesh)
 
void trackState (const std::string &name)
 
void untrack (const Texture *tex)
 
void untrack (const Mesh *mesh)
 
void pushMarker (const std::string &category, const std::string &label, const glm::vec4 &color)
 
void insertMarker (const std::string &category, const std::string &label, const glm::vec4 &color)
 
void popMarker (const std::string &category)
 
void nextFrame ()
 
void interface ()
 
 ~DebugViewer ()=default
 
 DebugViewer (const DebugViewer &)=delete
 
DebugVieweroperator= (const DebugViewer &)=delete
 
 DebugViewer (DebugViewer &&)=delete
 
DebugVieweroperator= (DebugViewer &&)=delete
 

Static Public Member Functions

static void setDefault (DebugViewer *viewer)
 
static void trackDefault (const Texture *tex)
 
static void trackDefault (const Mesh *mesh)
 
static void trackStateDefault (const std::string &name)
 
static void untrackDefault (const Texture *tex)
 
static void untrackDefault (const Mesh *mesh)
 
static void pushMarkerDefault (const std::string &category, const std::string &label, const glm::vec4 &color)
 
static void insertMarkerDefault (const std::string &category, const std::string &label, const glm::vec4 &color)
 
static void popMarkerDefault (const std::string &category)
 

Private Member Functions

void displayMetrics ()
 
void displayMarker (const MarkerInfos &marker)
 
void displayMarkers (const std::string &name, MarkerCategoryInfos &category)
 
void displayState (const std::string &name, StateInfos &infos)
 
void displayMesh (MeshInfos &mesh)
 
void registerTexture (const std::string &name, const Texture *tex, TextureInfos &infos)
 
void displayTexture (const std::string &prefix, TextureInfos &tex)
 
void updateDisplay (const TextureInfos &tex)
 

Private Attributes

std::vector< TextureInfos_textures
 The registered textures.
 
std::vector< TextureInfos_drawables
 The registered drawable textures.
 
std::vector< MeshInfos_meshes
 The registered meshes.
 
std::unordered_map< std::string, StateInfos_states
 GPU states currently tracked.
 
std::unordered_map< std::string, MarkerCategoryInfos_markers
 The registered markers.
 
Program_texDisplay
 Texture display shader.
 
uint64_t _frameCounter = 0
 Frame counter.
 
uint _textureId = 0
 Default texture name counter.
 
uint _drawableId = 0
 Default drawable name counter.
 
uint _meshId = 0
 Default mesh name counter.
 
uint _winId = 0
 Internal window counter.
 
uint _markerId = 0
 Internal marker counter.
 

Static Private Attributes

static DebugViewer_shared = nullptr
 Optional shared debug viewer.
 

Detailed Description

Provide helper GUI to display the content of textures and mesh infos. This can be useful to validate the content rendered to a specific texture when debugging.

Constructor & Destructor Documentation

◆ DebugViewer() [1/3]

DebugViewer::DebugViewer ( )
explicit

Constructor.

◆ ~DebugViewer()

DebugViewer::~DebugViewer ( )
default

Destructor

◆ DebugViewer() [2/3]

DebugViewer::DebugViewer ( const DebugViewer )
delete

Copy constructor.

◆ DebugViewer() [3/3]

DebugViewer::DebugViewer ( DebugViewer &&  )
delete

Move constructor.

Member Function Documentation

◆ displayMarker()

void DebugViewer::displayMarker ( const MarkerInfos marker)
private

Display GPU marker and its children

Parameters
markerthe marker to display

◆ displayMarkers()

void DebugViewer::displayMarkers ( const std::string &  name,
MarkerCategoryInfos category 
)
private

Display a hierarchy of GPU markers

Parameters
namethe name of the category
categorythe category of markers to display

◆ displayMesh()

void DebugViewer::displayMesh ( MeshInfos mesh)
private

Display a mesh information in a panel.

Parameters
meshthe mesh to display

◆ displayMetrics()

void DebugViewer::displayMetrics ( )
private

Display GPU metrics for the last completed frame in a panel.

◆ displayState()

void DebugViewer::displayState ( const std::string &  name,
StateInfos infos 
)
private

Display GPU state in a panel.

Parameters
namename of the state
infosthe state to display

◆ displayTexture()

void DebugViewer::displayTexture ( const std::string &  prefix,
TextureInfos tex 
)
private

Display a texture with some helper GUI.

Parameters
prefixthe display name of the texture
texthe texture information to display

◆ insertMarker()

void DebugViewer::insertMarker ( const std::string &  category,
const std::string &  label,
const glm::vec4 &  color 
)

Register a punctual marker

Parameters
categorythe marker category
labelthe marker name
colorthe marker color

◆ insertMarkerDefault()

void DebugViewer::insertMarkerDefault ( const std::string &  category,
const std::string &  label,
const glm::vec4 &  color 
)
static

Register a punctual marker

Parameters
categorythe marker category
labelthe marker name
colorthe marker color

◆ interface()

void DebugViewer::interface ( )

Display interface and monitored data.

◆ nextFrame()

void DebugViewer::nextFrame ( )

Move to the next frame

◆ operator=() [1/2]

DebugViewer & DebugViewer::operator= ( const DebugViewer )
delete

Copy assignment.

Returns
a reference to the object assigned to

◆ operator=() [2/2]

DebugViewer & DebugViewer::operator= ( DebugViewer &&  )
delete

Move assignment.

Returns
a reference to the object assigned to

◆ popMarker()

void DebugViewer::popMarker ( const std::string &  category)

Notify of the end of a scoped marker

Parameters
categorythe category to which the marker belonged

◆ popMarkerDefault()

void DebugViewer::popMarkerDefault ( const std::string &  category)
static

Notify of the end of a scoped marker

Parameters
categorythe category to which the marker belonged

◆ pushMarker()

void DebugViewer::pushMarker ( const std::string &  category,
const std::string &  label,
const glm::vec4 &  color 
)

Register a scoped marker

Parameters
categorythe marker category
labelthe marker name
colorthe marker color

◆ pushMarkerDefault()

void DebugViewer::pushMarkerDefault ( const std::string &  category,
const std::string &  label,
const glm::vec4 &  color 
)
static

Register a scoped marker

Parameters
categorythe marker category
labelthe marker name
colorthe marker color

◆ registerTexture()

void DebugViewer::registerTexture ( const std::string &  name,
const Texture tex,
TextureInfos infos 
)
private

Populate texture information based on an input texture.

Parameters
namethe name of the texture
texthe texture to monitor
infosthe information that should be populated

◆ setDefault()

void DebugViewer::setDefault ( DebugViewer viewer)
static

Register a default debug viewer.

Parameters
viewerthe viewer to use as default

◆ track() [1/2]

void DebugViewer::track ( const Mesh mesh)

Register a mesh for debug.

Parameters
meshthe mesh to monitor

◆ track() [2/2]

void DebugViewer::track ( const Texture tex)

Register a texture for debug.

Parameters
texthe texture to monitor

◆ trackDefault() [1/2]

void DebugViewer::trackDefault ( const Mesh mesh)
static

Register a mesh for debug.

Parameters
meshthe mesh to monitor

◆ trackDefault() [2/2]

void DebugViewer::trackDefault ( const Texture tex)
static

Register a texture for debug.

Parameters
texthe texture to monitor

◆ trackState()

void DebugViewer::trackState ( const std::string &  name)

Track the GPU state at the moment of the call. Can be called at each frame to track varying state.

Parameters
namethe display name of the state

◆ trackStateDefault()

void DebugViewer::trackStateDefault ( const std::string &  name)
static

Register current GPU state for debug;

Parameters
namehow to name the state in the list

◆ untrack() [1/2]

void DebugViewer::untrack ( const Mesh mesh)

Stop monitoring a mesh.

Parameters
meshthe mesh to stop tracking

◆ untrack() [2/2]

void DebugViewer::untrack ( const Texture tex)

Stop monitoring a texture.

Parameters
texthe texture to stop tracking

◆ untrackDefault() [1/2]

void DebugViewer::untrackDefault ( const Mesh mesh)
static

Stop monitoring a mesh.

Parameters
meshthe mesh to stop tracking

◆ untrackDefault() [2/2]

void DebugViewer::untrackDefault ( const Texture tex)
static

Stop monitoring a texture.

Parameters
texthe texture to stop tracking

◆ updateDisplay()

void DebugViewer::updateDisplay ( const TextureInfos tex)
private

Update the visualization associated to a texture/

Parameters
texthe texture to update the display of

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