VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtGlBufferMemoryTracker.h
Go to the documentation of this file.
1 /*****************************************************************************
2 * Copyright (c) 2021 MAK Technologies, Inc.
3 * All rights reserved.
4 *****************************************************************************/
5 
9 
10 #pragma once
12 
15 
16 #include <map>
17 #include <unordered_set>
18 #include <unordered_map>
19 
20 namespace makVrv
21 {
22  class DtDe;
23  class DtGlBuffer;
24 
31  {
32  public:
35 
37  virtual ~DtBufferTypeProperties();
38  public:
40  DtBufferTypeProperties& operator+=(const DtBufferTypeProperties& rhs);
41  public:
45  uint64_t myBuffersSize;
46 
50 
53  uint64_t myMaxBuffersSize;
54  };
55 
106  {
107  public:
110 
112  virtual ~DtGlBufferMemoryTracker();
113 
116 
118  DtGlBufferMemoryTracker& operator=(const DtGlBufferMemoryTracker&) = delete;
119  public:
121  virtual void bufferSizeChanged(DtGlBuffer* buffer) override;
122 
124  virtual void bufferResidencyChanging(DtGlBuffer* buffer, bool resident) override;
125 
127  virtual void bufferDeleted(DtGlBuffer* buffer) override;
128 
130  const std::map<DtBufferType, DtBufferTypeProperties>& properties(void) const;
131 
133  const std::map<DtBufferType, DtBufferTypeProperties>& propertiesBindless(void) const;
134 
135  protected:
137  virtual void printMap(std::map<DtBufferType, DtBufferTypeProperties>& aMap);
138 
140  std::string bufferName(unsigned int id) const;
141 
142  protected:
144  std::map<DtBufferType, DtBufferTypeProperties> myMapBuffersToProperties;
145 
147  std::map<DtBufferType, DtBufferTypeProperties> myMapBuffersToPropertiesBindless;
148 
149  std::unordered_map<unsigned int, int> myTrackedBuffers;
150 
151  std::unordered_map<unsigned int, int> myTrackedBuffersBindless;
152  };
153 
154 }
Dll export defines.
std::unordered_map< unsigned int, int > myTrackedBuffersBindless
Definition: DtGlBufferMemoryTracker.h:151
uint64_t myMaxBuffersSize
all time max size of buffers (in bytes) of this type This is the maximum value myBuffersSize has ever...
Definition: DtGlBufferMemoryTracker.h:53
std::map< DtBufferType, DtBufferTypeProperties > myMapBuffersToProperties
memory for specific buffer types, whether they are bindless or not
Definition: DtGlBufferMemoryTracker.h:144
These properties are used in conjunction with DtGlBufferMemoryTracker for each buffer type...
Definition: DtGlBufferMemoryTracker.h:30
std::map< DtBufferType, DtBufferTypeProperties > myMapBuffersToPropertiesBindless
memory for specific buffer types, bindless
Definition: DtGlBufferMemoryTracker.h:147
std::unordered_map< unsigned int, int > myTrackedBuffers
Definition: DtGlBufferMemoryTracker.h:149
int myMaxNumBuffers
All time number of buffers of this type. This is the maximum value myNumBuffers has ever attained dur...
Definition: DtGlBufferMemoryTracker.h:49
DtGlBufferMemoryTracker class is used to track memory for buffers to which it is added as a listener...
Definition: DtGlBufferMemoryTracker.h:105
uint64_t myBuffersSize
size of buffers (in bytes) of this type at a given point
Definition: DtGlBufferMemoryTracker.h:45
An abstract class to track a DtGlBuffer and its properties (size, residency, etc) Each DtGlBuffer can...
Definition: DtGlBufferListener.h:31
A generic OpenGL buffer. This can be: -&gt; a vertex buffer -&gt; an index buffer -&gt; a shader storage buffe...
Definition: DtGlBuffer.h:29
Buffer Type enums.
int myNumBuffers
number of buffers of this type at a given point
Definition: DtGlBufferMemoryTracker.h:43
#define DT_DLL_VRVGRAPHICSUTILS
Definition: vrvGraphicsUtils.h:18
Contains makVrv::DtGlBufferListener class.

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)