VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
makVrv::DtGlBufferMemoryTracker Class Reference

This class is used to track buffers' memory as they are created/deleted.

This class is also used to track when buffer handles are made resident/non-resident

The DtGlBuffer takes an abstract DtGlBufferListener that, if set, the buffer, will call DtGlBufferListener::bufferSizeChanged, DtGlBufferListener::bufferResidencyChanging and DtGlBufferListener::bufferDeleted when it resizes/handle residency changes/deleted

This class, since it implements DtGlBufferListener abstract class, will update the memory characteristics (DtBufferTypeProperties) for the buffers it is tracking.

Currently, in vrv, all DtGlBuffers are of type DtCoreGlBuffer (which in turn inherits from DtGlBuffer) DtCoreGlBuffers are created using DtCoreGlBufferCreator. In the DtCoreGlBufferCreator::create, just before it returns the buffer, we set an instance of this class as a listener.

Currently, we want to track all the buffers created on the vrv side, so in the creator we set the same instance of this class as the listener on those buffers. So in this sense this tracker is a singleton for the run of the vrv.

The class, since its updating the buffer numbers/types via the signals called from the buffers can be queried at any time using these functions: DtGlBufferMemoryTracker::properties -> all buffers

Currently, we have hooked up visualizing these properties to Imgui via F4. See DtImGuiLoaderStatsData::updateGpuStats

****Note**** If you wish to track multiple subsets of buffers you can create specific instances of this class for those buffers. Note however though, that a DtGlBuffer (for speed reasons) can have only one listener on it. So this organization into subsets is something that the client must externally do.

Inheritance diagram for makVrv::DtGlBufferMemoryTracker:
Inheritance graph
[legend]

Public Member Functions

 DtGlBufferMemoryTracker ()
 
virtual ~DtGlBufferMemoryTracker ()
 
 DtGlBufferMemoryTracker (const DtGlBufferMemoryTracker &)=delete
 
DtGlBufferMemoryTrackeroperator= (const DtGlBufferMemoryTracker &)=delete
 
virtual void bufferSizeChanged (unsigned int bufferId) override
 
virtual void bufferDeleted (unsigned int bufferId) override
 
virtual const
DtBufferTypeProperties
properties (void) const
 
virtual const
std::unordered_map< unsigned
int, int > & 
buffers (void) const
 
virtual std::string bufferName (unsigned int id) const
 

Protected Member Functions

virtual void printProperties ()
 

Protected Attributes

DtBufferTypeProperties myBufferProperties
 
std::unordered_map< unsigned
int, int
myTrackedBuffers
 

Constructor & Destructor Documentation

makVrv::DtGlBufferMemoryTracker::DtGlBufferMemoryTracker ( )

constructor

virtual makVrv::DtGlBufferMemoryTracker::~DtGlBufferMemoryTracker ( )
virtual

destructor

makVrv::DtGlBufferMemoryTracker::DtGlBufferMemoryTracker ( const DtGlBufferMemoryTracker )
delete

not allowed

Member Function Documentation

DtGlBufferMemoryTracker& makVrv::DtGlBufferMemoryTracker::operator= ( const DtGlBufferMemoryTracker )
delete

not allowed

virtual void makVrv::DtGlBufferMemoryTracker::bufferSizeChanged ( unsigned int  bufferId)
overridevirtual

signaled when buffer size changed

Implements makVrv::DtGlBufferListener.

virtual void makVrv::DtGlBufferMemoryTracker::bufferDeleted ( unsigned int  bufferId)
overridevirtual

buffer being deleted

Implements makVrv::DtGlBufferListener.

virtual const DtBufferTypeProperties& makVrv::DtGlBufferMemoryTracker::properties ( void  ) const
virtual

accessor for all buffers

virtual const std::unordered_map<unsigned int, int>& makVrv::DtGlBufferMemoryTracker::buffers ( void  ) const
virtual

access

virtual std::string makVrv::DtGlBufferMemoryTracker::bufferName ( unsigned int  id) const
virtual

get the name of the buffer

virtual void makVrv::DtGlBufferMemoryTracker::printProperties ( )
protectedvirtual

internal

Member Data Documentation

DtBufferTypeProperties makVrv::DtGlBufferMemoryTracker::myBufferProperties
protected

properties of the buffers being tracked

std::unordered_map<unsigned int, int> makVrv::DtGlBufferMemoryTracker::myTrackedBuffers
protected

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

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)