Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::glFramebuffer Class Referencefinal

#include <glFramebuffer.h>

+ Inheritance diagram for Divide::glFramebuffer:

Classes

struct  BindingState
 
struct  ColourBufferState
 

Public Types

enum class  AttachmentState : U8 { STATE_DISABLED = 0 , STATE_ENABLED , COUNT }
 
- Public Types inherited from Divide::RenderTarget
enum class  Usage : U8 { RT_READ_WRITE = 0 , RT_READ_ONLY = 1 , RT_WRITE_ONLY = 2 }
 
- Public Types inherited from Divide::GraphicsResource
enum class  Type : U8 {
  RENDER_TARGET , SHADER_BUFFER , BUFFER , SHADER ,
  SHADER_PROGRAM , TEXTURE , COUNT
}
 

Public Member Functions

 glFramebuffer (GFXDevice &context, const RenderTargetDescriptor &descriptor)
 
 ~glFramebuffer () override
 
void setMipLevel (U16 writeLevel)
 
void blitFrom (RenderTarget *source, const RTBlitParams &params)
 
bool create () override
 Bake in all settings and attachments to Prepare it for rendering.
 
- Public Member Functions inherited from Divide::RenderTarget
virtual bool create ()
 Init all attachments. Returns false if already called.
 
bool hasAttachment (RTAttachmentType type, RTColourAttachmentSlot slot=RTColourAttachmentSlot::SLOT_0) const
 
bool usesAttachment (RTAttachmentType type, RTColourAttachmentSlot slot=RTColourAttachmentSlot::SLOT_0) const
 
RTAttachmentgetAttachment (RTAttachmentType type, RTColourAttachmentSlot slot=RTColourAttachmentSlot::SLOT_0) const
 
U8 getAttachmentCount (RTAttachmentType type) const noexcept
 
U8 getSampleCount () const noexcept
 
bool resize (U16 width, U16 height)
 Resize all attachments.
 
bool updateSampleCount (U8 newSampleCount)
 Change msaa sampel count for all attachments.
 
U16 getWidth () const noexcept
 
U16 getHeight () const noexcept
 
vec2< U16getResolution () const noexcept
 
F32depthClearValue () noexcept
 
const Str< 64 > & name () const noexcept
 
- Public Member Functions inherited from Divide::GUIDWrapper
 GUIDWrapper () noexcept
 
 GUIDWrapper (const GUIDWrapper &old) noexcept
 
 GUIDWrapper (GUIDWrapper &&old) noexcept
 
virtual ~GUIDWrapper ()=default
 
FORCE_INLINE I64 getGUID () const noexcept
 
GUIDWrapperoperator= (const GUIDWrapper &old)=delete
 
GUIDWrapperoperator= (GUIDWrapper &&other)=delete
 
- Public Member Functions inherited from Divide::GraphicsResource
virtual ~GraphicsResource ()
 
GFXDevicecontext () const noexcept
 
U64 nameHash () const noexcept
 
- Public Member Functions inherited from Divide::NonCopyable
 NonCopyable (const NonCopyable &)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 
 NonCopyable (NonCopyable &&)=default
 
NonCopyableoperator= (NonCopyable &&)=default
 
- Public Member Functions inherited from Divide::NonMovable
 NonMovable (NonMovable &&)=delete
 
NonMovableoperator= (NonMovable &&)=delete
 
 NonMovable (const NonMovable &)=default
 
NonMovableoperator= (const NonMovable &)=default
 

Protected Member Functions

bool checkStatus ()
 
bool checkStatusInternal (gl46core::GLuint handle)
 
void prepareBuffers (const RTDrawDescriptor &drawPolicy)
 
bool initAttachment (RTAttachment *att, RTAttachmentType type, RTColourAttachmentSlot slot) override
 
bool toggleAttachment (U8 attachmentIdx, AttachmentState state, U16 levelOffset, DrawLayerEntry layerOffset, bool layeredRendering)
 
void clear (const RTClearDescriptor &descriptor)
 
void begin (const RTDrawDescriptor &drawPolicy, const RTClearDescriptor &clearPolicy)
 
void end (const RTTransitionMask &mask)
 
 PROPERTY_R_IW (Str< 128 >, debugMessage, "")
 
 PROPERTY_R_IW (gl46core::GLuint, framebufferHandle, GL_NULL_HANDLE)
 
void resolve (const RTTransitionMask &mask)
 
bool setMipLevelInternal (U8 attachmentIdx, U16 writeLevel)
 
- Protected Member Functions inherited from Divide::RenderTarget
 RenderTarget (GFXDevice &context, const RenderTargetDescriptor &descriptor)
 
virtual bool initAttachment (RTAttachment *att, RTAttachmentType type, RTColourAttachmentSlot slot)
 
bool autoResolveAttachment (RTAttachment *att) const
 
- Protected Member Functions inherited from Divide::GraphicsResource
 GraphicsResource (GFXDevice &context, Type type, I64 GUID, U64 nameHash)
 
- Protected Member Functions inherited from Divide::NonCopyable
 NonCopyable ()=default
 
 ~NonCopyable ()=default
 
- Protected Member Functions inherited from Divide::NonMovable
 NonMovable ()=default
 
 ~NonMovable ()=default
 

Static Protected Member Functions

static void QueueMipMapsRecomputation (const RTAttachment_uptr &attachment)
 

Protected Attributes

gl46core::GLuint _framebufferResolveHandle {GL_NULL_HANDLE}
 
RTDrawDescriptor _previousPolicy
 
std::array< DrawLayerEntry, RT_MAX_ATTACHMENT_COUNT_previousDrawLayers
 
struct Divide::glFramebuffer::ColourBufferState _colourBuffers
 
gl46core::GLenum _activeReadBuffer = gl46core::GL_NONE
 
eastl::fixed_vector< BindingState, 8+2, true > _attachmentState
 
bool _isLayeredDepth = false
 
bool _statusCheckQueued = false
 
bool _activeDepthBuffer = false
 
- Protected Attributes inherited from Divide::RenderTarget
RenderTargetDescriptor _descriptor
 
RTAttachment_uptr _attachments [RT_MAX_ATTACHMENT_COUNT] {}
 
bool _attachmentsUsed [RT_MAX_ATTACHMENT_COUNT] = {}
 
bool _attachmentsAutoResolve [RT_MAX_ATTACHMENT_COUNT] = {}
 
- Protected Attributes inherited from Divide::GUIDWrapper
const I64 _guid
 
- Protected Attributes inherited from Divide::GraphicsResource
GFXDevice_context
 

Friends

class Attorney::GLAPIRenderTarget
 
class Attorney::CEGUIRenderTarget
 

Additional Inherited Members

- Static Public Member Functions inherited from Divide::GUIDWrapper
static I64 generateGUID () noexcept
 

Detailed Description

Definition at line 54 of file glFramebuffer.h.

Member Enumeration Documentation

◆ AttachmentState

Enumerator
STATE_DISABLED 
STATE_ENABLED 
COUNT 

Definition at line 60 of file glFramebuffer.h.

Constructor & Destructor Documentation

◆ glFramebuffer()

Divide::glFramebuffer::glFramebuffer ( GFXDevice context,
const RenderTargetDescriptor descriptor 
)
explicit

Definition at line 19 of file glFramebuffer.cpp.

◆ ~glFramebuffer()

Divide::glFramebuffer::~glFramebuffer ( )
override

Definition at line 41 of file glFramebuffer.cpp.

Member Function Documentation

◆ begin()

void Divide::glFramebuffer::begin ( const RTDrawDescriptor drawPolicy,
const RTClearDescriptor clearPolicy 
)
protected

Definition at line 436 of file glFramebuffer.cpp.

◆ blitFrom()

void Divide::glFramebuffer::blitFrom ( RenderTarget source,
const RTBlitParams params 
)

Definition at line 224 of file glFramebuffer.cpp.

◆ checkStatus()

bool Divide::glFramebuffer::checkStatus ( )
protected

Definition at line 691 of file glFramebuffer.cpp.

◆ checkStatusInternal()

bool Divide::glFramebuffer::checkStatusInternal ( gl46core::GLuint  handle)
protected

Definition at line 706 of file glFramebuffer.cpp.

◆ clear()

void Divide::glFramebuffer::clear ( const RTClearDescriptor descriptor)
protected

Definition at line 561 of file glFramebuffer.cpp.

◆ create()

bool Divide::glFramebuffer::create ( )
overridevirtual

Bake in all settings and attachments to Prepare it for rendering.

Reimplemented from Divide::RenderTarget.

Definition at line 170 of file glFramebuffer.cpp.

◆ end()

void Divide::glFramebuffer::end ( const RTTransitionMask mask)
protected

Definition at line 480 of file glFramebuffer.cpp.

◆ initAttachment()

bool Divide::glFramebuffer::initAttachment ( RTAttachment att,
RTAttachmentType  type,
RTColourAttachmentSlot  slot 
)
overrideprotectedvirtual

Reimplemented from Divide::RenderTarget.

Definition at line 57 of file glFramebuffer.cpp.

◆ prepareBuffers()

void Divide::glFramebuffer::prepareBuffers ( const RTDrawDescriptor drawPolicy)
protected

Definition at line 384 of file glFramebuffer.cpp.

◆ PROPERTY_R_IW() [1/2]

Divide::glFramebuffer::PROPERTY_R_IW ( gl46core::GLuint  ,
framebufferHandle  ,
GL_NULL_HANDLE   
)
protected

◆ PROPERTY_R_IW() [2/2]

Divide::glFramebuffer::PROPERTY_R_IW ( Str< 128 >  ,
debugMessage  ,
""   
)
protected

◆ QueueMipMapsRecomputation()

void Divide::glFramebuffer::QueueMipMapsRecomputation ( const RTAttachment_uptr &  attachment)
staticprotected

Definition at line 545 of file glFramebuffer.cpp.

◆ resolve()

void Divide::glFramebuffer::resolve ( const RTTransitionMask mask)
protected

Definition at line 493 of file glFramebuffer.cpp.

◆ setMipLevel()

void Divide::glFramebuffer::setMipLevel ( U16  writeLevel)

Definition at line 659 of file glFramebuffer.cpp.

◆ setMipLevelInternal()

bool Divide::glFramebuffer::setMipLevelInternal ( U8  attachmentIdx,
U16  writeLevel 
)
protected

Definition at line 646 of file glFramebuffer.cpp.

◆ toggleAttachment()

bool Divide::glFramebuffer::toggleAttachment ( U8  attachmentIdx,
AttachmentState  state,
U16  levelOffset,
DrawLayerEntry  layerOffset,
bool  layeredRendering 
)
protected

Definition at line 85 of file glFramebuffer.cpp.

Friends And Related Function Documentation

◆ Attorney::CEGUIRenderTarget

friend class Attorney::CEGUIRenderTarget
friend

Definition at line 57 of file glFramebuffer.h.

◆ Attorney::GLAPIRenderTarget

friend class Attorney::GLAPIRenderTarget
friend

Definition at line 56 of file glFramebuffer.h.

Member Data Documentation

◆ _activeDepthBuffer

bool Divide::glFramebuffer::_activeDepthBuffer = false
protected

Definition at line 129 of file glFramebuffer.h.

◆ _activeReadBuffer

gl46core::GLenum Divide::glFramebuffer::_activeReadBuffer = gl46core::GL_NONE
protected

Definition at line 123 of file glFramebuffer.h.

◆ _attachmentState

eastl::fixed_vector<BindingState, 8 + 2, true> Divide::glFramebuffer::_attachmentState
protected

Definition at line 125 of file glFramebuffer.h.

◆ _colourBuffers

struct Divide::glFramebuffer::ColourBufferState Divide::glFramebuffer::_colourBuffers
protected

◆ _framebufferResolveHandle

gl46core::GLuint Divide::glFramebuffer::_framebufferResolveHandle {GL_NULL_HANDLE}
protected

Definition at line 112 of file glFramebuffer.h.

◆ _isLayeredDepth

bool Divide::glFramebuffer::_isLayeredDepth = false
protected

Definition at line 127 of file glFramebuffer.h.

◆ _previousDrawLayers

std::array<DrawLayerEntry, RT_MAX_ATTACHMENT_COUNT> Divide::glFramebuffer::_previousDrawLayers
protected

Definition at line 115 of file glFramebuffer.h.

◆ _previousPolicy

RTDrawDescriptor Divide::glFramebuffer::_previousPolicy
protected

Definition at line 114 of file glFramebuffer.h.

◆ _statusCheckQueued

bool Divide::glFramebuffer::_statusCheckQueued = false
protected

Definition at line 128 of file glFramebuffer.h.


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