![]() |
VR-Forces 5.0.1 Developer's Guide
|
This class is a component of the DtIndirectGeometry It inputs are: -> the instances registered with DtIndirectGeometry -> the viewing parameters (view matrix, projection matrix, etc) -> the indirect registrar (so that it can generate gpu data for -> the models of the instances from the interim data accessible -> via the registrar It outputs are: -> Tndirect command buffer -> The count of the indirect commands -> The input instances shuffled around/culled/lod'ed reflecting -> their order within the indirect command buffer generated -> It will also (optionally) do culling and lod.
Classes | |
| struct | InstancesOffsetAndNumOfInstances |
| struct | StateIdOffsetAndMaxCommands |
Public Types | |
| typedef std::vector < StateIdOffsetAndMaxCommands > | VectorStateIdOffsetAndMaxCommands |
| typedef std::map < osg::observer_ptr< const osg::Camera >, DtGlBuffer * > | CameraToBufferMap |
| typedef std::set < osg::observer_ptr< const osg::Camera > > | CameraSet |
Public Member Functions | |
| virtual | ~DtGpuCulling () |
| virtual void | setRegistrar (DtIndirectGeometryRegistrar *registrar) |
| virtual void | setRegistrarInvalid (void) |
| virtual void | setDebug (bool debug) |
| virtual const DtCullShaderConfig & | cullShaderConfig (void) const |
| virtual void | updateGpuBuffers (osg::RenderInfo &renderInfo) |
| virtual void | modelIdsToNumInstancesChanged (void) |
| virtual void | updatePerInstancePerGeomBuffers (const MapIntToInt &modelIdsToNumInstances, const osg::Camera *camera) |
| virtual void | doCulling (const DtIndirectViewParameters &viewParameters, const osg::FrameStamp *frameStamp, const DtGlBuffer *gpuLodVisibleBuffer, const DtGlBuffer *gpuDofTransformBuffer, const DtGlBuffer *gpuSwitchStateBuffer, const DtGlBuffer *gpuPerInstanceDataBuffer, const osg::Camera *camera, bool &outputInstanceBufferChanged) |
| virtual bool | bindGpuOutputInstanceBuffersWithAddressRange (const osg::Camera *camera) const |
| virtual bool | bindCommandBufferAndSsbos (const DtGlBuffer *gpuDofTransformBuffer, const DtGlBuffer *gpuDofModelScaleBuffer, const DtGlBuffer *gpuUvOffsetBuffer, const DtGlBuffer *gpuPerInstanceDataBuffer, const osg::Camera *camera) |
| virtual void | unbindCommandBufferAndSsbos (const osg::Camera *camera) |
| virtual void | bindGpuOutputInstanceBufferDebug (const osg::Camera *camera) const |
| virtual void | unbindGpuOutputInstanceBufferDebug (const osg::Camera *camera) const |
| virtual bool | bindIndirectThingsDebug (const DtGlBuffer *gpuDofTransformBuffer, const osg::Camera *camera) |
| virtual void | unbindIndirectThingsDebug (const osg::Camera *camera) |
| virtual bool | useInstanceCount (void) const |
| virtual int | numDrawCommands (const osg::Camera *camera) const |
| virtual void | releaseGLObjects (osg::State *state) const |
| virtual void | reloadShaders () const |
| virtual bool | buffersInitializedForCamera (const osg::Camera *camera) const |
| virtual unsigned int | maxNumInstances (void) const |
| virtual const VectorStateIdOffsetAndMaxCommands & | stateIdOffsetAndMaxCommands (void) const |
| virtual const std::vector < InstancesOffsetAndNumOfInstances > & | instancesOffsetAndNumInstances (void) const |
| virtual bool | readyToUpdateAndGpuBuffersNeedUpdate () const |
| virtual bool | gpuBuffersNeedUpdate () const |
| virtual bool | textureUpdateDirty () const |
| virtual void | setTextureUpdateDirty (bool flag) |
| virtual bool | perGeomInstanceDataDirty () const |
| virtual void | setPerGeomInstanceDataDirty (bool flag) |
| virtual bool | instancesInvalidatedDirty () const |
| virtual void | invalidateInstance (int instanceId, int offset, int size) |
| virtual const DtGlBuffer * | gpuInputPerGeomInstancesBuffer (void) const |
| virtual const DtGlBuffer * | gpuMaterialsBuffer () const |
| virtual void | fillOutputInstances (std::vector< DtVector4< int > > &outputInstances, const osg::Camera *camera) const |
| virtual const DtIndirectEffectTexturesTemplate & | currentEffectTexturesState () const |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name (void) const |
Static Public Member Functions | |
| static bool | setUpOutputFormatAndBindings () |
| static void | unsetUpOutputFormatAndBindings () |
Public Attributes | |
| friend | DtGpuCullingCreator |
Protected Member Functions | |
| DtGpuCulling (DtDe &de, DtInstanceContainer &container, const DtCullShaderConfig &) | |
| virtual void | updateGpuTexturesBuffer (const osg::RenderInfo &renderInfo) |
| virtual void | updateInstancesOffsetAndInstances (const MapIntToInt &modelIdsToNumInstances) |
| virtual void | updateInstancesOffsetAndInstancesBuffer (void) |
| virtual void | updateStateIdToMaxNumCommands (const MapIntToInt &modelIdsToNumInstances) |
| virtual void | updateStateIdToMaxNumCommandsBuffer (void) |
| virtual bool | checkSpecBuffersOk (void) const |
| virtual void | releaseCameraToBufferMap (DtGlDeleteObjectManager &deleteManager, const CameraToBufferMap &cameraToBufferMap, bool untrackResident=false) const |
| virtual void | deleteBuffers (void) |
| virtual void | deleteCameraToBufferMap (CameraToBufferMap &cameraToBufferMap) |
| virtual void | flushCameraSpecificBuffers () |
| virtual void | flushSingleCameraSpecificBufferMap (CameraToBufferMap &cameraToBufferMap) |
| virtual void | flushSingleCameraSet (CameraSet &cameraSet) |
| virtual void | addHandleToDelete (DtGlDeleteObjectManager &deleteManager, DtGlBuffer *buffer, bool untrackResident=false) const |
| virtual void | setTexture (GLuint64 &textureToSet, GLuint textureID) |
| virtual void | incrementUsersAndLoadIfNecessary (DtIndirectModelInfo *info) |
| virtual void | decrementUsersAndUnLoadIfNecessary () |
| virtual void | updateGpuInputPerGeomInstancesBufferByInvalidating () |
| virtual void | updateGpuGeometrySpecificationsBuffer () |
| virtual void | updateGpuMaterialsBuffer () |
| virtual void | updateGpuInputPerGeomInstancesBuffer () |
| virtual void | updateGpuLightPointBuffers () |
| virtual void | updateGpuIndirectBuffersInstanceCount (const MapIntToInt &modelIdsToNumInstances, const osg::Camera *camera) |
| virtual void | updateGpuIndirectBuffersNonInstanceCount (const MapIntToInt &modelIdsToNumInstances, const osg::Camera *camera) |
| virtual void | clearGpuIndirectBuffer (const osg::Camera *camera) |
| virtual void | clearStateIdCommandCountBuffer () |
| virtual void | clearLightSourceIndexOutputBuffer (const osg::Camera *osgCamera, unsigned int maxNumLightSources) |
Static Protected Attributes | |
| static const int | theGpuOutputInstanceBufferIndex |
| static const int | theGpuOutputInstanceOffsetInPerInstanceDataBufferIndex |
| static const int | theGpuOutputInstanceBufferDebugIndex |
Private Member Functions | |
| DtGpuCulling ()=delete | |
| DtGpuCulling (const DtGpuCulling &other)=delete | |
| DtGpuCulling & | operator= (const DtGpuCulling &other)=delete |
| typedef std::vector<StateIdOffsetAndMaxCommands> makVrv::DtGpuCulling::VectorStateIdOffsetAndMaxCommands |
| typedef std::map<osg::observer_ptr<const osg::Camera>, DtGlBuffer*> makVrv::DtGpuCulling::CameraToBufferMap |
| typedef std::set<osg::observer_ptr<const osg::Camera> > makVrv::DtGpuCulling::CameraSet |
|
virtual |
destructor
|
protected |
CTOR. only creator can create.
|
privatedelete |
not allowed
|
privatedelete |
not allowed
|
privatedelete |
not allowed
|
virtual |
set the registrar
|
virtual |
invalidate the registrar. happens for gs cells
|
virtual |
set the compute shader to debug
|
virtual |
get the compute shader config
|
virtual |
updateGpuBuffers outInstanceTransformsUpdated indicates whether instance transforms that were marked dirty were sent to the GPU. This may not always happen with a call to updateGpuBuffers.
|
virtual |
indicate to the culling that model ids to num instances changed so that internal maps get updated
|
virtual |
update the buffers that are needed to be correct every frame
|
virtual |
Do the culling (view frustum, lod, switch)
| outputInstanceBufferChanged | indicates whether output instance buffers that get get bound were determined to need resize and were resized, and because of that the gpu address also likely changed (which should trigger an external re-generation of the vao which uses these) |
|
static |
bind the output instance buffer
|
static |
unbind the output instance buffer format and bindings
|
virtual |
For bindless, bind the output buffers from the culling with buffer address range This is because in bindless, the main buffers are via indirect bindless call (which is internally a buffer address range bind). You can't mix and match regular buffer binds and vertex buffer unified memory style (buffer address range)
|
virtual |
bind the indirect command buffer and the count buffer returns false if handle is 0. Can happen if the buffer hasn't been re-created yet (e.g. when the context is deleted and recreated), depending on the job/frame syc this can happen a few frames later
|
virtual |
unbind the indirect command buffer and the count buffer
|
virtual |
Bind the buffer containing the output instances of the cull shader with debugging. This is the buffer representing the non-switched otu & non-loded out instances (all non view frustum culled instances).
|
virtual |
Unbind the buffer containing the output instances of the cull shader with debugging.
|
virtual |
bind the debug indirect command buffer, dof transform buffer and the specs buffer This allows us to draw all instances that are not switched out, lod'ed out (all non view frustum culled instances)
|
virtual |
unbind the debug indirect command buffer, dof transform buffer and the specs buffer
|
virtual |
whether we are optimizing for shared models (useInstanceCount()=true) or unique models (useInstanceCount()=false), across instances
|
virtual |
The number of draw commands generated. Is a value between [0, DtIndirectGeoUtils::getMaxDrawCountNoCullingNoLod()], inclusive.
|
virtual |
release the GL objects for the GpuCulling compute shader
|
virtual |
destroy the cull program and shader if they exists so they can be recreated next frame.
|
virtual |
check to see if the buffers for this camera have been initialized.
get the max number of instances that can possibly be rendered if none are culled out.
|
virtual |
get the map of the state id to their offset/number
|
virtual |
access the instances offset and num of instances map
|
virtual |
helper function to decide if a job should be launched
|
virtual |
is anything in the buffers dirty?
|
virtual |
are there textures that still need updating.
|
virtual |
inform that textures are dirty
|
virtual |
is per geom instance data dirty?
|
virtual |
set the per geom instance data dirty
|
virtual |
were any instances invalidated?
|
virtual |
invalidate an instance
|
virtual |
Accessor for the gpu per geom instances buffer.
|
virtual |
Accessor for the gpu materials buffer.
|
virtual |
For debugging. Get the values of the output instances computed by the compute shader.
|
virtual |
get the current effect texture state as it was after the last time the textures were sent down
|
virtual |
set a name on this (useful for debugging)
|
virtual |
get the name on this (useful for debugging)
|
protectedvirtual |
update the various buffers that are fed to the cull shader -> if new models came in -> if textures became available (they can be asynchronously available, e.g. via osg ico) -> if the number of instances changed
|
protectedvirtual |
update the various buffers that are fed to the cull shader -> if new models came in -> if textures became available (they can be asynchronously available, e.g. via osg ico) -> if the number of instances changed
|
protectedvirtual |
update the various buffers that are fed to the cull shader -> if new models came in -> if textures became available (they can be asynchronously available, e.g. via osg ico) -> if the number of instances changed
|
protectedvirtual |
update the various buffers that are fed to the cull shader -> if new models came in -> if textures became available (they can be asynchronously available, e.g. via osg ico) -> if the number of instances changed
|
protectedvirtual |
update the various buffers that are fed to the cull shader -> if new models came in -> if textures became available (they can be asynchronously available, e.g. via osg ico) -> if the number of instances changed
|
protectedvirtual |
update the various buffers that are fed to the cull shader -> if new models came in -> if textures became available (they can be asynchronously available, e.g. via osg ico) -> if the number of instances changed
|
protectedvirtual |
update the various buffers that are fed to the cull shader -> if new models came in -> if textures became available (they can be asynchronously available, e.g. via osg ico) -> if the number of instances changed
|
protectedvirtual |
update the various buffers that are fed to the cull shader -> if new models came in -> if textures became available (they can be asynchronously available, e.g. via osg ico) -> if the number of instances changed
|
protectedvirtual |
update the various buffers that are fed to the cull shader -> if new models came in -> if textures became available (they can be asynchronously available, e.g. via osg ico) -> if the number of instances changed
|
protectedvirtual |
update the various buffers that are fed to the cull shader -> if new models came in -> if textures became available (they can be asynchronously available, e.g. via osg ico) -> if the number of instances changed
|
protectedvirtual |
The buffer containing the bindless textures' addresses of the model textures.
|
protectedvirtual |
update the myInstancesOffsetAndNumInstances vector so it is ready to be used
|
protectedvirtual |
update the myGpuInstancesOffsetAndNumInstancesBuffer
|
protectedvirtual |
update the myStateIdToMaxNumCommands with the correct max state instances for each state
|
protectedvirtual |
update the myGpuStateIdToMaxNumCommandsBuffer with the correct max state instances for each state
|
protectedvirtual |
check a few of the buffers to make sure they are not null
|
protectedvirtual |
release the resources for all the buffers in a camera to buffer map
|
protectedvirtual |
delete buffers
|
protectedvirtual |
delete all the buffers in a camera to buffer map
|
protectedvirtual |
flush any buffers from the maps of cameras to buffers that no longer have a valid camera.
|
protectedvirtual |
flush a single camera to buffer map
|
protectedvirtual |
flush a single camera set.
|
protectedvirtual |
add to delete manager, and indicate whether the tracker should be told that something is becoming non-resident
|
protectedvirtual |
given a gl texture, set the value of the address in textureToSet if the texture is resident else, set the value to 0
|
protectedvirtual |
for partially unloadable registrars (gt), increment the users (this gpu culling) and load buffers, textures if needed
|
protectedvirtual |
for partially unloadable registrars (gt), decrements the users (this gpu culling) and unload buffers, textures if needed
| friend makVrv::DtGpuCulling::DtGpuCullingCreator |
|
protected |
|
protected |
|
protected |
|
protected |
contains switch states/ lod info
|
protected |
|
protected |
|
mutableprotected |
c++ buffer that holds the same info
|
protected |
The spec buffer containing GeometrySpecifications for all the models/lods of the passed in instances.
|
mutableprotected |
the bindless vertex and index buffers
|
protected |
The gpu buffer holding the same above info.
|
protected |
The spec buffer containing Materials for all the models/lods of the passed in instances.
|
protected |
c++ buffer that holds the same info
|
protected |
|
mutableprotected |
the buffer into which the commands are generated
|
mutableprotected |
The re-distributed switched/lod'ed instances but not culled out via cull shader for debugging.
|
protected |
The indirect command buffer for debugging culling.
|
protected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
Keep track of the first model and what index to start using bindless textures.
|
protected |
|
protected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
The re-distributed/culled/switched/lod'ed instances (a subset of the input instances)
|
mutableprotected |
The re-distributed/culled/switched/lod'ed instances' offset into the per instance data buffer, so that per instance data can be accessed.
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
mutableprotected |
|
protected |