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

#include <RenderTarget.h>

+ Inheritance diagram for Divide::RenderTarget:

Public Types

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

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

 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
 

Protected Attributes

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
 

Additional Inherited Members

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

Detailed Description

Definition at line 60 of file RenderTarget.h.

Member Enumeration Documentation

◆ Usage

enum class Divide::RenderTarget::Usage : U8
strong
Enumerator
RT_READ_WRITE 
RT_READ_ONLY 
RT_WRITE_ONLY 

Definition at line 62 of file RenderTarget.h.

Constructor & Destructor Documentation

◆ RenderTarget()

Divide::RenderTarget::RenderTarget ( GFXDevice context,
const RenderTargetDescriptor descriptor 
)
explicitprotected

Definition at line 29 of file RenderTarget.cpp.

Member Function Documentation

◆ autoResolveAttachment()

bool Divide::RenderTarget::autoResolveAttachment ( RTAttachment att) const
protected

Definition at line 39 of file RenderTarget.cpp.

◆ create()

bool Divide::RenderTarget::create ( )
virtual

Init all attachments. Returns false if already called.

Reimplemented in Divide::glFramebuffer, and Divide::vkRenderTarget.

Definition at line 49 of file RenderTarget.cpp.

◆ depthClearValue()

F32 & Divide::RenderTarget::depthClearValue ( )
noexcept

Definition at line 240 of file RenderTarget.cpp.

◆ getAttachment()

RTAttachment * Divide::RenderTarget::getAttachment ( RTAttachmentType  type,
RTColourAttachmentSlot  slot = RTColourAttachmentSlot::SLOT_0 
) const

Definition at line 179 of file RenderTarget.cpp.

◆ getAttachmentCount()

U8 Divide::RenderTarget::getAttachmentCount ( RTAttachmentType  type) const
noexcept

Definition at line 194 of file RenderTarget.cpp.

◆ getHeight()

U16 Divide::RenderTarget::getHeight ( ) const
noexcept

Definition at line 225 of file RenderTarget.cpp.

◆ getResolution()

vec2< U16 > Divide::RenderTarget::getResolution ( ) const
noexcept

Definition at line 230 of file RenderTarget.cpp.

◆ getSampleCount()

U8 Divide::RenderTarget::getSampleCount ( ) const
noexcept

Definition at line 256 of file RenderTarget.cpp.

◆ getWidth()

U16 Divide::RenderTarget::getWidth ( ) const
noexcept

Definition at line 220 of file RenderTarget.cpp.

◆ hasAttachment()

bool Divide::RenderTarget::hasAttachment ( RTAttachmentType  type,
RTColourAttachmentSlot  slot = RTColourAttachmentSlot::SLOT_0 
) const

Definition at line 169 of file RenderTarget.cpp.

◆ initAttachment()

bool Divide::RenderTarget::initAttachment ( RTAttachment att,
RTAttachmentType  type,
RTColourAttachmentSlot  slot 
)
protectedvirtual

Reimplemented in Divide::glFramebuffer.

Definition at line 274 of file RenderTarget.cpp.

◆ name()

const Str< 64 > & Divide::RenderTarget::name ( ) const
noexcept

Definition at line 235 of file RenderTarget.cpp.

◆ resize()

bool Divide::RenderTarget::resize ( U16  width,
U16  height 
)

Resize all attachments.

Definition at line 245 of file RenderTarget.cpp.

◆ updateSampleCount()

bool Divide::RenderTarget::updateSampleCount ( U8  newSampleCount)

Change msaa sampel count for all attachments.

Definition at line 261 of file RenderTarget.cpp.

◆ usesAttachment()

bool Divide::RenderTarget::usesAttachment ( RTAttachmentType  type,
RTColourAttachmentSlot  slot = RTColourAttachmentSlot::SLOT_0 
) const

Definition at line 174 of file RenderTarget.cpp.

Member Data Documentation

◆ _attachments

RTAttachment_uptr Divide::RenderTarget::_attachments[RT_MAX_ATTACHMENT_COUNT] {}
protected

Definition at line 102 of file RenderTarget.h.

◆ _attachmentsAutoResolve

bool Divide::RenderTarget::_attachmentsAutoResolve[RT_MAX_ATTACHMENT_COUNT] = {}
protected

Definition at line 104 of file RenderTarget.h.

◆ _attachmentsUsed

bool Divide::RenderTarget::_attachmentsUsed[RT_MAX_ATTACHMENT_COUNT] = {}
protected

Definition at line 103 of file RenderTarget.h.

◆ _descriptor

RenderTargetDescriptor Divide::RenderTarget::_descriptor
protected

Definition at line 100 of file RenderTarget.h.


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