Support Forum       G3D Web Page     
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Friends | List of all members
G3D::Milestone Class Reference


Used to set a marker in the GPU instruction stream that the CPU can later query or block on. More...

Inherits G3D::ReferenceCountedObject.

Public Member Functions

 ~Milestone ()
 
bool completed () const
 Returns true if this milestone has completed execution. More...
 
const Stringname () const
 
bool wait (float timeout=finf())
 
Stalls the CPU until the GPU has finished the milestone. More...
 

Static Public Member Functions

static shared_ptr< Milestonecreate (const String &name)
 
Create a new Milestone (GL fence) and insert it into the GPU execution queue. More...
 

Static Protected Member Functions

template<class T , class ... ArgTypes>
static shared_ptr< T > createShared (ArgTypes &&... args)
 Like std::make_shared, but works for protected constructors. More...
 

Friends

class RenderDevice
 

Detailed Description


Used to set a marker in the GPU instruction stream that the CPU can later query or block on.

Abstracts the OpenGL ARB_sync/OpenGL 3.2 API (http://www.opengl.org/registry/specs/ARB/sync.txt) that replaced the older NV_fence (http://oss.sgi.com/projects/ogl-sample/registry/NV/fence.txt) API.

G3D names this class 'milestone' instead of 'fence' to clarify that it is not a barrier–the CPU and GPU can both pass a milestone without blocking unless the CPU explicitly requests a block.

Constructor & Destructor Documentation

◆ ~Milestone()

G3D::Milestone::~Milestone ( )

Member Function Documentation

◆ completed()

bool G3D::Milestone::completed ( ) const

Returns true if this milestone has completed execution.

See also
wait

◆ create()

static shared_ptr<Milestone> G3D::Milestone::create ( const String name)
inlinestatic


Create a new Milestone (GL fence) and insert it into the GPU execution queue.

This must be called on a thread that has the current OpenGL Context

◆ createShared()

template<class T , class ... ArgTypes>
static shared_ptr<T> G3D::ReferenceCountedObject::createShared ( ArgTypes &&...  args)
inlinestaticprotectedinherited

Like std::make_shared, but works for protected constructors.

Call as createShared<myclass>.

◆ name()

const String& G3D::Milestone::name ( ) const
inline

Referenced by create().

◆ wait()

bool G3D::Milestone::wait ( float  timeout = finf())


Stalls the CPU until the GPU has finished the milestone.

Returns
false if timed out, true if the milestone completed.
See also
completed

Friends And Related Function Documentation

◆ RenderDevice

friend class RenderDevice
friend

documentation generated on Wed Nov 24 2021 08:01:58 using doxygen 1.8.15