Files
Seele/src/Engine/Graphics/RenderTarget.cpp
T

85 lines
2.5 KiB
C++
Raw Normal View History

2023-10-26 18:37:29 +02:00
#include "RenderTarget.h"
using namespace Seele;
using namespace Seele::Gfx;
2023-11-15 00:06:00 +01:00
RenderTargetAttachment::RenderTargetAttachment(PTexture2D texture,
2023-11-15 17:42:57 +01:00
SeAttachmentLoadOp loadOp,
SeAttachmentStoreOp storeOp,
SeAttachmentLoadOp stencilLoadOp,
SeAttachmentStoreOp stencilStoreOp)
2023-11-15 00:06:00 +01:00
: clear()
, componentFlags(0)
, loadOp(loadOp)
, storeOp(storeOp)
, stencilLoadOp(stencilLoadOp)
, stencilStoreOp(stencilStoreOp)
, texture(texture)
{
}
RenderTargetAttachment::~RenderTargetAttachment()
{
}
SwapchainAttachment::SwapchainAttachment(PWindow owner,
2023-11-15 17:42:57 +01:00
SeAttachmentLoadOp loadOp,
SeAttachmentStoreOp storeOp,
SeAttachmentLoadOp stencilLoadOp,
SeAttachmentStoreOp stencilStoreOp)
2023-11-15 00:06:00 +01:00
: RenderTargetAttachment(nullptr, loadOp, storeOp, stencilLoadOp, stencilStoreOp), owner(owner)
{
clear.color.float32[0] = 0.0f;
clear.color.float32[1] = 0.0f;
clear.color.float32[2] = 0.0f;
clear.color.float32[3] = 1.0f;
componentFlags = SE_COLOR_COMPONENT_R_BIT | SE_COLOR_COMPONENT_G_BIT | SE_COLOR_COMPONENT_B_BIT | SE_COLOR_COMPONENT_A_BIT;
}
SwapchainAttachment::~SwapchainAttachment()
{
}
RenderTargetLayout::RenderTargetLayout()
: inputAttachments()
, colorAttachments()
, depthAttachment()
, width(0)
, height(0)
{
}
RenderTargetLayout::RenderTargetLayout(PRenderTargetAttachment depthAttachment)
: inputAttachments()
, colorAttachments()
, depthAttachment(depthAttachment)
, width(depthAttachment->getTexture()->getWidth())
, height(depthAttachment->getTexture()->getHeight())
{
}
RenderTargetLayout::RenderTargetLayout(PRenderTargetAttachment colorAttachment, PRenderTargetAttachment depthAttachment)
: inputAttachments()
, depthAttachment(depthAttachment)
, width(depthAttachment->getTexture()->getWidth())
, height(depthAttachment->getTexture()->getHeight())
{
colorAttachments.add(colorAttachment);
}
RenderTargetLayout::RenderTargetLayout(Array<PRenderTargetAttachment> colorAttachments, PRenderTargetAttachment depthAttachment)
: inputAttachments()
, colorAttachments(colorAttachments)
, depthAttachment(depthAttachment)
, width(depthAttachment->getTexture()->getWidth())
, height(depthAttachment->getTexture()->getHeight())
{
}
RenderTargetLayout::RenderTargetLayout(Array<PRenderTargetAttachment> inputAttachments, Array<PRenderTargetAttachment> colorAttachments, PRenderTargetAttachment depthAttachment)
: inputAttachments(inputAttachments)
, colorAttachments(colorAttachments)
, depthAttachment(depthAttachment)
, width(depthAttachment->getTexture()->getWidth())
, height(depthAttachment->getTexture()->getHeight())
{
}