VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtIndirectGlTextureObject.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2023 VT-MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 #include <vrvOsg/vrvOsg.h>
12 
13 #include <set>
14 #include <unordered_set>
15 
16 #include <boost/thread/mutex.hpp>
17 
18 #include <thread>
19 
20 namespace makVrv
21 {
22  class DtDe;
23 
24  class DtIndirectGlTextureObjectManager;
25  class DtIndirectGlTextureObjectTracker;
26  class DtOsgToGlContextTracker;
27  class DtIndirectLog;
28 
29  class DtGpuCulling;
30 
37  {
38  public:
40  DtIndirectGlTextureObject(DtDe& de, unsigned int textureId);
41 
44 
46  DtIndirectGlTextureObject() = delete;
51 
52  public:
56  virtual bool isResident(const void* glContext) const;
57 
59  virtual void makeResident();
60 
62  virtual void makeNonResident();
63 
66  virtual int numOfContextsResidentIn(void) const;
67 
71  virtual uint64_t textureAddress(void) const;
72 
79  virtual void addGpuCullingUser(const DtGpuCulling* culling);
80 
87  virtual void removeGpuCullingUser(const DtGpuCulling* culling);
88 
90  virtual unsigned int textureId(void) const;
91 
93  virtual int incrementNumUsers();
94 
96  virtual int decrementNumUsers();
97 
98  protected:
100  unsigned int myGlTextureId;
101 
102  std::uint64_t myTextureAddress;
103  std::string myTextureName;
104 
105  std::unordered_set<const void*> myContextsInWhichResident;
106 
107  std::unordered_set<const DtGpuCulling*> myUsers;
108  boost::mutex myUserMutex;
109 
113 
115 
116  std::atomic<int> myNumUsers;
117 
118  static std::thread::id theMainThreadId;
119  };
120 }
DtIndirectGlTextureObjectManager & myParent
Definition: DtIndirectGlTextureObject.h:110
Encapsulate an OpenGL texture object that is created/used in indirect rendering.
Definition: DtIndirectGlTextureObject.h:36
virtual int numOfContextsResidentIn(void) const
how many contexts is this resident in? This function does not need a valid gl context while calling...
virtual void removeGpuCullingUser(const DtGpuCulling *culling)
Currently, DtIndirectGeometry(and in reality DtGpuCulling inside of it) are the only &#39;users&#39; of bindl...
virtual int incrementNumUsers()
ref counting tracking for when DtIndirectGlTextureObject is used directly
virtual ~DtIndirectGlTextureObject()
destructor
This manager manages the lifetime of the actual gl texture objects (gl unsigned ints) in the indirect...
Definition: DtIndirectGlTextureObjectManager.h:60
This class is a component of the DtIndirectGeometry It inputs are: -&gt; the instances registered with Dt...
Definition: DtGpuCulling.h:88
virtual int decrementNumUsers()
ref counting tracking for when DtIndirectGlTextureObject is used directly
std::uint64_t myTextureAddress
Definition: DtIndirectGlTextureObject.h:102
DtIndirectLog & myIndirectLog
Definition: DtIndirectGlTextureObject.h:112
std::unordered_set< const void * > myContextsInWhichResident
Definition: DtIndirectGlTextureObject.h:105
DtDe & myDe
Definition: DtIndirectGlTextureObject.h:114
virtual void addGpuCullingUser(const DtGpuCulling *culling)
Currently, DtIndirectGeometry(and in reality DtGpuCulling inside of it) are the only &#39;users&#39; of bindl...
static std::thread::id theMainThreadId
Definition: DtIndirectGlTextureObject.h:118
virtual unsigned int textureId(void) const
the actual gl texture object id
virtual bool isResident(const void *glContext) const
Whether resident in this context. This function does not need a valid gl context while calling...
std::string myTextureName
Definition: DtIndirectGlTextureObject.h:103
DtIndirectGlTextureObject()=delete
not allowed
This class tracks all the texture objects created on the vrv side. It is primarily used for stats of ...
Definition: DtIndirectGlTextureObjectTracker.h:50
This class is specifically used by the indirect system It&#39;s separate so that it doesn&#39;t interfere wit...
Definition: DtIndirectLog.h:30
boost::mutex myUserMutex
Definition: DtIndirectGlTextureObject.h:108
std::atomic< int > myNumUsers
Definition: DtIndirectGlTextureObject.h:116
virtual void makeResident()
This function needs a valid gl context during the call.
virtual void makeNonResident()
This function needs a valid gl context during the call.
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
std::unordered_set< const DtGpuCulling * > myUsers
Definition: DtIndirectGlTextureObject.h:107
DtIndirectGlTextureObjectTracker & myIndirectGlTextureObjectTracker
Definition: DtIndirectGlTextureObject.h:111
DtIndirectGlTextureObject & operator=(DtIndirectGlTextureObject &rhs)=delete
not allowed
unsigned int myGlTextureId
the gl texture id
Definition: DtIndirectGlTextureObject.h:100
virtual uint64_t textureAddress(void) const
This does not change for the lifetime of the DtIndirectGlTextureObject (gl texture object) This addre...

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)