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

Contains the per Model info which the indirect module needs These objects are owned by the Indirect geometry registrar. The vertex and index buffers GPU uploads are slpit into chucks to improve GPU driver interaction and avoid stalls.

Classes

struct  GpuBufferUploadInfo
 

Public Member Functions

virtual ~DtIndirectModelInfo ()
 
 DtIndirectModelInfo ()=delete
 
 DtIndirectModelInfo (const DtIndirectModelInfo &)=delete
 
DtIndirectModelInfooperator= (const DtIndirectModelInfo &)=delete
 
virtual void unloadBuffers ()
 
virtual bool buffersUploadedToGpu () const
 
virtual bool processGpuBufferUploads (unsigned int &uploadedMemory)
 
virtual void texturesSet (std::map< const DtIndirectTexturePrototype *, int > &texturesSet) const
 
virtual void addUser (const DtGpuCulling *user)
 
virtual void removeUser (const DtGpuCulling *user)
 
virtual void computeMaxTextureResolution (const DtIndirectLimitTextureStrategy &limitStrategy)
 
virtual const BindlessPtrNV & vertexBufferBindless (int index) const
 
virtual const BindlessPtrNV & additionalBufferBindless (int index) const
 
virtual const BindlessPtrNV & indexBufferBindless (int index) const
 
virtual int numSubGeometries () const
 
virtual int maxCoords (int index) const
 
virtual int numVertices (int index) const
 
virtual int numIndices (int index) const
 
virtual void addSubGeometry (DtIndirectModelSubGeometry *modelSubGeometry)
 
virtual
DtIndirectModelSubGeometry
subGeometry (int index) const
 
virtual void promoteDataFromSubGeosToMe ()
 

Public Attributes

friend DtIndirectModelInfoCreator
 
std::string myModelName
 
std::string myModelDefName
 
int myModelID
 
DtGeometrySpecVector myGeometrySpecifications
 
DtIndirectMaterialVector myMaterials
 
std::vector
< DtIndirectGeometryTextures
myTextures
 
DtPerGeomInstances myPerGeomInstancesTemplate
 
DtIndirectUvOffsetManager::AnnotationToUvOffsetMap myAnnotationToUvOffsetIdMap
 
DtIndirectUvOffsetManager::ScrollableUvOffsetIdsAndMultipliers myScrollableUvOffsetIdsAndMultipliers
 
DtIndirectSwitchManager::DequeNodeSwitchInfoPairsArray mySwitchPaths
 
DtIndirectLodManager::DequeIndirectLodInfoArray myLodStacks
 
DtIndirectDofManager::DequeNodeDofInfoPairs myDofPaths
 
int myNumLightSources
 
DtVector2< intmyMaxTextureResolutionInXandY
 

Protected Member Functions

 DtIndirectModelInfo (DtDe &de)
 
virtual void resetGpuUploads ()
 
virtual bool isDefaultTexture (const DtIndirectTexturePrototype *texture) const
 
virtual bool glBuffersContainAnyData () const
 
virtual void releaseGLObjects (osg::State *state)
 
virtual void createIndirectBuffers ()
 
virtual void deleteIndirectBuffers ()
 
virtual void computeChunkUploadSize (unsigned int &desiredUploadSize, unsigned int &maxUploadSize) const
 
virtual void prepareToUploadGpuDataForBuffer (DtGlBuffer &buffer, std::vector< uint8_t > &stagingData)
 
virtual void prepareToUploadGpuData ()
 
virtual void updateBindlessPointers ()
 

Protected Attributes

DtDemyDe
 
DtGlDeleteObjectManagermyGlDeleteObjectManager
 
std::vector< GpuBufferUploadInfomyGpuBufferUploads
 
std::unordered_set< const
DtGpuCulling * > 
myUsers
 
boost::mutex myUserMutex
 
DtGlBuffermyVertexAndAttributesBuffer = nullptr
 
DtGlBuffermyIndexBuffer = nullptr
 
bool myBuffersUploadedToGpu
 
std::vector< uint8_t > myVertexBufferData
 
std::vector< uint8_t > myIndexBufferData
 
std::vector
< DtIndirectModelSubGeoProps
mySubGeoPropsVec
 
std::vector
< DtIndirectSubGeoBindlessBuffers
mySubGeoBindlessBuffersVec
 
std::vector
< DtIndirectModelSubGeometry * > 
myVectorModelSubGeometries
 

Static Protected Attributes

static const BindlessPtrNV theInvalidBindless
 

Constructor & Destructor Documentation

virtual makVrv::DtIndirectModelInfo::~DtIndirectModelInfo ( )
virtual

destructor

makVrv::DtIndirectModelInfo::DtIndirectModelInfo ( )
delete

not allowed

makVrv::DtIndirectModelInfo::DtIndirectModelInfo ( const DtIndirectModelInfo )
delete

not allowed

makVrv::DtIndirectModelInfo::DtIndirectModelInfo ( DtDe de)
protected

CTOR. only creator can create.

Member Function Documentation

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

not allowed

virtual void makVrv::DtIndirectModelInfo::unloadBuffers ( )
virtual

unload gl buffers make gl buffers non-resident and add them to the delete manager

virtual bool makVrv::DtIndirectModelInfo::buffersUploadedToGpu ( ) const
virtual

Is all buffer data completely uploaded to the GPU?

virtual bool makVrv::DtIndirectModelInfo::processGpuBufferUploads ( unsigned int uploadedMemory)
virtual

Processes any remaining gpu buffer uploads. Returns true if the model data is still in the process of being uploaded to the gpu.

Parameters
uploadedMemoryThe amount of memory uploaded to the GPU. (modified by this function)
virtual void makVrv::DtIndirectModelInfo::texturesSet ( std::map< const DtIndirectTexturePrototype *, int > &  texturesSet) const
virtual

get the set of textures (diffuse + effect textures) that this model refers to

virtual void makVrv::DtIndirectModelInfo::addUser ( const DtGpuCulling user)
virtual

gpu culling is the only 'user' of the model info since it uses the bindless address of the buffers and textures of the model multiple gpu cullings (and hence indirect geometries) can refer to the same model info

virtual void makVrv::DtIndirectModelInfo::removeUser ( const DtGpuCulling user)
virtual

gpu culling is the only 'user' of the model info since it uses the bindless address of the buffers and textures of the model multiple gpu cullings (and hence indirect geometries) can refer to the same model info

virtual void makVrv::DtIndirectModelInfo::computeMaxTextureResolution ( const DtIndirectLimitTextureStrategy limitStrategy)
virtual

update the max texture resolution in x and y for all textures of a given model should be done when the model is finalized. Also, excludes the excluded textures from the max computation, per the specified strategy

virtual const BindlessPtrNV& makVrv::DtIndirectModelInfo::vertexBufferBindless ( int  index) const
virtual

bindless vertex buffer

virtual const BindlessPtrNV& makVrv::DtIndirectModelInfo::additionalBufferBindless ( int  index) const
virtual

bindless additional attributes buffer

virtual const BindlessPtrNV& makVrv::DtIndirectModelInfo::indexBufferBindless ( int  index) const
virtual

bindless index buffer

virtual int makVrv::DtIndirectModelInfo::numSubGeometries ( ) const
virtual

number of sub goes

virtual int makVrv::DtIndirectModelInfo::maxCoords ( int  index) const
virtual

The max texture coordinates unit/number of the texture coordinate sets.

virtual int makVrv::DtIndirectModelInfo::numVertices ( int  index) const
virtual

The num of vertices.

virtual int makVrv::DtIndirectModelInfo::numIndices ( int  index) const
virtual

The num of indices.

virtual void makVrv::DtIndirectModelInfo::addSubGeometry ( DtIndirectModelSubGeometry modelSubGeometry)
virtual

Don't use directly Added only by aggregator. This will transfer ownership of the sub geo/ (ie, the model info will handle the lifetime/deletion of this subgeo)

virtual DtIndirectModelSubGeometry* makVrv::DtIndirectModelInfo::subGeometry ( int  index) const
virtual

Don't use directly. Used only by DtIndirectModelInfoContainer::copyData to copy data: sub geo <- osg.

virtual void makVrv::DtIndirectModelInfo::promoteDataFromSubGeosToMe ( )
virtual

Don't use directly. Used only by DtIndirectModelInfoContainer. Promote data from sub geos into me. The sub geos can then be deleted.

virtual void makVrv::DtIndirectModelInfo::resetGpuUploads ( )
protectedvirtual

Resets information associated with gpu uploads. Marks the state of the model buffers as not uploaded to gpu.

virtual bool makVrv::DtIndirectModelInfo::isDefaultTexture ( const DtIndirectTexturePrototype texture) const
protectedvirtual

whether a texture is the default white texture

virtual bool makVrv::DtIndirectModelInfo::glBuffersContainAnyData ( ) const
protectedvirtual

Returns true if any gl buffer data has been loaded partially or fully.

virtual void makVrv::DtIndirectModelInfo::releaseGLObjects ( osg::State *  state)
protectedvirtual

release gl objects

virtual void makVrv::DtIndirectModelInfo::createIndirectBuffers ( )
protectedvirtual

internal. create the indirect buffers

virtual void makVrv::DtIndirectModelInfo::deleteIndirectBuffers ( )
protectedvirtual

internal. delete the indirect buffers

virtual void makVrv::DtIndirectModelInfo::computeChunkUploadSize ( unsigned int desiredUploadSize,
unsigned int maxUploadSize 
) const
protectedvirtual

internal. computes the the desired upload size for each chunk of data that is uploaded to the GPU. Rather than updating the entire buffer at once, the buffer updates are split into chunks to improve GPU driver interaction.

Parameters
desiredUploadSizethe chunk size
maxUploadSizethe maximum chunk size
virtual void makVrv::DtIndirectModelInfo::prepareToUploadGpuDataForBuffer ( DtGlBuffer buffer,
std::vector< uint8_t > &  stagingData 
)
protectedvirtual

internal. prepares information about chunks of data that will be uploaded to the gpu for a given buffer

virtual void makVrv::DtIndirectModelInfo::prepareToUploadGpuData ( )
protectedvirtual

internal. prepares information about chunks of data that will be uploaded to the gpu for all buffers

virtual void makVrv::DtIndirectModelInfo::updateBindlessPointers ( )
protectedvirtual

internal. update the bindless pointers with current buffer data

Member Data Documentation

friend makVrv::DtIndirectModelInfo::DtIndirectModelInfoCreator
std::string makVrv::DtIndirectModelInfo::myModelName

the model name

std::string makVrv::DtIndirectModelInfo::myModelDefName
int makVrv::DtIndirectModelInfo::myModelID

the model id

DtGeometrySpecVector makVrv::DtIndirectModelInfo::myGeometrySpecifications

the vector of all geometry specs

DtIndirectMaterialVector makVrv::DtIndirectModelInfo::myMaterials

vector of the materials in this model

std::vector<DtIndirectGeometryTextures> makVrv::DtIndirectModelInfo::myTextures

vector of the textures in this model

DtPerGeomInstances makVrv::DtIndirectModelInfo::myPerGeomInstancesTemplate

vector of the per geom instances

DtIndirectUvOffsetManager::AnnotationToUvOffsetMap makVrv::DtIndirectModelInfo::myAnnotationToUvOffsetIdMap

annotation to uv offset map

DtIndirectUvOffsetManager::ScrollableUvOffsetIdsAndMultipliers makVrv::DtIndirectModelInfo::myScrollableUvOffsetIdsAndMultipliers

uv offset ids and multipliers

DtIndirectSwitchManager::DequeNodeSwitchInfoPairsArray makVrv::DtIndirectModelInfo::mySwitchPaths

switch paths

DtIndirectLodManager::DequeIndirectLodInfoArray makVrv::DtIndirectModelInfo::myLodStacks

lod paths

DtIndirectDofManager::DequeNodeDofInfoPairs makVrv::DtIndirectModelInfo::myDofPaths
int makVrv::DtIndirectModelInfo::myNumLightSources

the number of light sources

DtVector2<int> makVrv::DtIndirectModelInfo::myMaxTextureResolutionInXandY
const BindlessPtrNV makVrv::DtIndirectModelInfo::theInvalidBindless
staticprotected
DtDe& makVrv::DtIndirectModelInfo::myDe
protected
DtGlDeleteObjectManager& makVrv::DtIndirectModelInfo::myGlDeleteObjectManager
protected
std::vector<GpuBufferUploadInfo> makVrv::DtIndirectModelInfo::myGpuBufferUploads
protected
std::unordered_set<const DtGpuCulling*> makVrv::DtIndirectModelInfo::myUsers
protected
boost::mutex makVrv::DtIndirectModelInfo::myUserMutex
protected
DtGlBuffer* makVrv::DtIndirectModelInfo::myVertexAndAttributesBuffer = nullptr
protected
DtGlBuffer* makVrv::DtIndirectModelInfo::myIndexBuffer = nullptr
protected
bool makVrv::DtIndirectModelInfo::myBuffersUploadedToGpu
protected

Are the model data buffers completely uploaded to the gpu.

std::vector<uint8_t> makVrv::DtIndirectModelInfo::myVertexBufferData
protected
std::vector<uint8_t> makVrv::DtIndirectModelInfo::myIndexBufferData
protected
std::vector<DtIndirectModelSubGeoProps> makVrv::DtIndirectModelInfo::mySubGeoPropsVec
protected
std::vector<DtIndirectSubGeoBindlessBuffers> makVrv::DtIndirectModelInfo::mySubGeoBindlessBuffersVec
protected
std::vector<DtIndirectModelSubGeometry*> makVrv::DtIndirectModelInfo::myVectorModelSubGeometries
protected

the same size as the spec vector above 1 sub-geometry for each spec


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

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)