Go to the documentation of this file.
47 template <
typename EngineImplTraits>
48 class FramebufferBase :
public DeviceObjectBase<typename EngineImplTraits::FramebufferInterface, typename EngineImplTraits::RenderDeviceImplType, FramebufferDesc>
67 bool bIsDeviceInternal =
false) :
73 if (this->
m_Desc.
Width == 0 || this->m_Desc.Height == 0 || this->m_Desc.NumArraySlices == 0)
77 auto*
const pAttachment = Desc.ppAttachments[i];
78 if (pAttachment ==
nullptr)
81 const auto& ViewDesc = pAttachment->GetDesc();
82 const auto& TexDesc = pAttachment->GetTexture()->GetDesc();
99 LOG_ERROR_AND_THROW(
"The framebuffer width is zero and can't be automatically determined as there are no non-null attachments");
101 LOG_ERROR_AND_THROW(
"The framebuffer height is zero and can't be automatically determined as there are no non-null attachments");
103 LOG_ERROR_AND_THROW(
"The framebuffer array slice count is zero and can't be automatically determined as there are no non-null attachments");
112 if (Desc.ppAttachments[i] ==
nullptr)
115 m_ppAttachments[i] = Desc.ppAttachments[i];
116 m_ppAttachments[i]->
AddRef();
120 Desc.pRenderPass->AddRef();
typename EngineGLImplTraits ::RenderDeviceImplType RenderDeviceImplType
Definition: FramebufferBase.hpp:55
Base interface for a reference counter object that stores the number of strong and weak references an...
Definition: ReferenceCounters.h:44
Uint32 AttachmentCount
The number of attachments.
Definition: Framebuffer.h:52
virtual ReferenceCounterValueType Release()=0
Decrements the number of strong references by 1 and destroys the object when the counter reaches zero...
#define LOG_ERROR_AND_THROW(...)
Definition: Errors.hpp:101
~FramebufferBase()
Definition: FramebufferBase.hpp:123
FramebufferDesc m_Desc
Object description.
Definition: DeviceObjectBase.hpp:182
Texture view interface.
Definition: TextureView.h:202
DeviceObjectBase< BaseInterface, RenderDeviceImplType, FramebufferDesc > TDeviceObjectBase
Definition: FramebufferBase.hpp:57
Template class implementing base functionality of the framebuffer object.
Definition: FramebufferBase.hpp:48
virtual ReferenceCounterValueType AddRef()=0
Increments the number of strong references by 1.
IMemoryAllocator & GetRawAllocator()
Returns raw memory allocator.
Definition: EngineMemory.cpp:51
#define IMPLEMENT_QUERY_INTERFACE_IN_PLACE(InterfaceID, ParentClassName)
Definition: ObjectBase.hpp:59
Template class that implements reference counting.
Definition: RefCntAutoPtr.hpp:73
uint32_t Uint32
32-bit unsigned integer
Definition: BasicTypes.h:51
Uint32 NumArraySlices
The number of array slices in the framebuffer.
Definition: Framebuffer.h:64
Uint32 Width
Width of the framebuffer.
Definition: Framebuffer.h:58
struct FramebufferDesc FramebufferDesc
Definition: Framebuffer.h:66
MipLevelProperties GetMipLevelProperties(const TextureDesc &TexDesc, Uint32 MipLevel)
Definition: GraphicsAccessories.cpp:1339
#define VERIFY_EXPR(...)
Definition: DebugUtilities.hpp:79
Uint32 Height
Height of the framebuffer.
Definition: Framebuffer.h:61
Framebuffer description.
Definition: Framebuffer.h:46
FramebufferBase(IReferenceCounters *pRefCounters, RenderDeviceImplType *pDevice, const FramebufferDesc &Desc, bool bIsDeviceInternal=false)
Definition: FramebufferBase.hpp:64
void ValidateFramebufferDesc(const FramebufferDesc &Desc) noexcept(false)
Definition: FramebufferBase.cpp:34
ITextureView *const * ppAttachments
Pointer to the array of attachments.
Definition: Framebuffer.h:55
#define ALLOCATE(Allocator, Desc, Type, Count)
Definition: EngineMemory.h:47
IRenderPass * pRenderPass
Render pass that the framebuffer will be compatible with.
Definition: Framebuffer.h:49
virtual void Free(void *Ptr)=0
Releases memory.
typename EngineGLImplTraits ::FramebufferInterface BaseInterface
Definition: FramebufferBase.hpp:52
Template class implementing base functionality of the device object.
Definition: DeviceObjectBase.hpp:45
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37