HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HdRenderBuffer Class Referenceabstract

#include <renderBuffer.h>

+ Inheritance diagram for HdRenderBuffer:

Public Types

enum  DirtyBits : HdDirtyBits { Clean = 0, DirtyDescription = 1 << 0, AllDirty = (DirtyDescription) }
 

Public Member Functions

HD_API HdRenderBuffer (SdfPath const &id)
 
virtual HD_API ~HdRenderBuffer ()
 
Prim API
virtual HD_API HdDirtyBits GetInitialDirtyBitsMask () const override
 Get initial invalidation state. More...
 
virtual HD_API void Sync (HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits) override
 Get allocation information from the scene delegate. More...
 
virtual HD_API void Finalize (HdRenderParam *renderParam) override
 Deallocate before deletion. More...
 
- Public Member Functions inherited from HdBprim
HD_API HdBprim (SdfPath const &id)
 
virtual HD_API ~HdBprim ()
 
SdfPath constGetId () const
 

Renderbuffer API

virtual bool Allocate (GfVec3i const &dimensions, HdFormat format, bool multiSampled)=0
 
virtual unsigned int GetWidth () const =0
 Get the buffer's width. More...
 
virtual unsigned int GetHeight () const =0
 Get the buffer's height. More...
 
virtual unsigned int GetDepth () const =0
 Get the buffer's depth. More...
 
virtual HdFormat GetFormat () const =0
 Get the buffer's per-pixel format. More...
 
virtual bool IsMultiSampled () const =0
 Get whether the buffer is multisampled. More...
 
virtual voidMap ()=0
 Map the buffer for reading. More...
 
virtual void Unmap ()=0
 Unmap the buffer. It is no longer safe to read from the buffer. More...
 
virtual bool IsMapped () const =0
 Return whether the buffer is currently mapped by anybody. More...
 
virtual void Resolve ()=0
 
virtual bool IsConverged () const =0
 
virtual VtValue GetResource (bool multiSampled) const
 
virtual void _Deallocate ()=0
 Deallocate the buffer, freeing any owned resources. More...
 

Detailed Description

A render buffer is a handle to a data resource that can be rendered into, such as a 2d image for a draw target or auxiliary rendering output.

The render buffer can be used as an indexed prim, in which case it communicates with the scene delegate to get buffer properties, or it can be created out of band and supplied directly with allocation parameters.

Render buffers can be targeted by render passes. They also contain mapping functionality for reading and writing buffer data.

Definition at line 51 of file renderBuffer.h.

Member Enumeration Documentation

Enumerator
Clean 
DirtyDescription 
AllDirty 

Definition at line 54 of file renderBuffer.h.

Constructor & Destructor Documentation

HD_API HdRenderBuffer::HdRenderBuffer ( SdfPath const id)
virtual HD_API HdRenderBuffer::~HdRenderBuffer ( )
virtual

Member Function Documentation

virtual void HdRenderBuffer::_Deallocate ( )
protectedpure virtual

Deallocate the buffer, freeing any owned resources.

Implemented in HdStRenderBuffer.

virtual bool HdRenderBuffer::Allocate ( GfVec3i const dimensions,
HdFormat  format,
bool  multiSampled 
)
pure virtual

Allocate a buffer. Can be called from Sync(), or directly. If the buffer has already been allocated, calling Allocate() again will destroy the old buffer and allocate a new one.

A negative dimension or invalid format will cause an allocation error. If the requested buffer can't be allocated, the function will return false.

Implemented in HdStRenderBuffer.

virtual HD_API void HdRenderBuffer::Finalize ( HdRenderParam renderParam)
overridevirtual

Deallocate before deletion.

Reimplemented from HdBprim.

virtual unsigned int HdRenderBuffer::GetDepth ( ) const
pure virtual

Get the buffer's depth.

Implemented in HdStRenderBuffer.

virtual HdFormat HdRenderBuffer::GetFormat ( ) const
pure virtual

Get the buffer's per-pixel format.

Implemented in HdStRenderBuffer.

virtual unsigned int HdRenderBuffer::GetHeight ( ) const
pure virtual

Get the buffer's height.

Implemented in HdStRenderBuffer.

virtual HD_API HdDirtyBits HdRenderBuffer::GetInitialDirtyBitsMask ( ) const
overridevirtual

Get initial invalidation state.

Implements HdBprim.

virtual VtValue HdRenderBuffer::GetResource ( bool  multiSampled) const
inlinevirtual

This optional API returns a (type-erased) resource that backs this render buffer. For example, a render buffer implementation may allocate a gpu texture that holds the data of the buffer. This function allows other parts of Hydra, such as a HdTask to get access to this resource.

Reimplemented in HdStRenderBuffer.

Definition at line 131 of file renderBuffer.h.

virtual unsigned int HdRenderBuffer::GetWidth ( ) const
pure virtual

Get the buffer's width.

Implemented in HdStRenderBuffer.

virtual bool HdRenderBuffer::IsConverged ( ) const
pure virtual

Return whether the buffer is converged (whether the renderer is still adding samples or not).

Implemented in HdStRenderBuffer.

virtual bool HdRenderBuffer::IsMapped ( ) const
pure virtual

Return whether the buffer is currently mapped by anybody.

Implemented in HdStRenderBuffer.

virtual bool HdRenderBuffer::IsMultiSampled ( ) const
pure virtual

Get whether the buffer is multisampled.

Implemented in HdStRenderBuffer.

virtual void* HdRenderBuffer::Map ( )
pure virtual

Map the buffer for reading.

Implemented in HdStRenderBuffer.

virtual void HdRenderBuffer::Resolve ( )
pure virtual

Resolve the buffer so that reads reflect the latest writes.

Some buffer implementations may defer final processing of writes until a buffer is read, for efficiency; examples include OpenGL MSAA or multi-sampled raytraced buffers.

Implemented in HdStRenderBuffer.

virtual HD_API void HdRenderBuffer::Sync ( HdSceneDelegate sceneDelegate,
HdRenderParam renderParam,
HdDirtyBits dirtyBits 
)
overridevirtual

Get allocation information from the scene delegate.

Implements HdBprim.

virtual void HdRenderBuffer::Unmap ( )
pure virtual

Unmap the buffer. It is no longer safe to read from the buffer.

Implemented in HdStRenderBuffer.


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