#include <render_target.h>
Classes | |
struct | AttachmentConfig |
struct | AttachmentConfigMSAA |
Public Member Functions | |
RenderTarget () | |
~RenderTarget () | |
bool | IsValid () const |
void | SetupDepthStencilAttachments (const Context &context, Allocator &allocator, ISize size, bool msaa, std::string_view label="Offscreen", RenderTarget::AttachmentConfig stencil_attachment_config=RenderTarget::kDefaultStencilAttachmentConfig, const std::shared_ptr< Texture > &depth_stencil_texture=nullptr) |
SampleCount | GetSampleCount () const |
bool | HasColorAttachment (size_t index) const |
ISize | GetRenderTargetSize () const |
std::shared_ptr< Texture > | GetRenderTargetTexture () const |
PixelFormat | GetRenderTargetPixelFormat () const |
std::optional< ISize > | GetColorAttachmentSize (size_t index) const |
RenderTarget & | SetColorAttachment (const ColorAttachment &attachment, size_t index) |
ColorAttachment | GetColorAttachment (size_t index) const |
Get the color attachment at [index]. More... | |
RenderTarget & | SetDepthAttachment (std::optional< DepthAttachment > attachment) |
RenderTarget & | SetStencilAttachment (std::optional< StencilAttachment > attachment) |
size_t | GetMaxColorAttacmentBindIndex () const |
const std::optional< DepthAttachment > & | GetDepthAttachment () const |
const std::optional< StencilAttachment > & | GetStencilAttachment () const |
size_t | GetTotalAttachmentCount () const |
bool | IterateAllColorAttachments (const std::function< bool(size_t index, const ColorAttachment &attachment)> &iterator) const |
void | IterateAllAttachments (const std::function< bool(const Attachment &attachment)> &iterator) const |
std::string | ToString () const |
RenderTargetConfig | ToConfig () const |
Static Public Attributes | |
static constexpr AttachmentConfig | kDefaultColorAttachmentConfig |
static constexpr AttachmentConfigMSAA | kDefaultColorAttachmentConfigMSAA |
static constexpr AttachmentConfig | kDefaultStencilAttachmentConfig |
Definition at line 38 of file render_target.h.
|
default |
|
default |
ColorAttachment impeller::RenderTarget::GetColorAttachment | ( | size_t | index | ) | const |
Get the color attachment at [index].
This function does not validate whether or not the attachment was previously defined and will return a default constructed attachment if none is set.
Definition at line 233 of file render_target.cc.
Referenced by impeller::EntityPassTarget::Flip(), impeller::InlinePassContext::GetRenderPass(), impeller::Playground::OpenPlaygroundHere(), and impeller::testing::TEST_P().
std::optional< ISize > impeller::RenderTarget::GetColorAttachmentSize | ( | size_t | index | ) | const |
Definition at line 155 of file render_target.cc.
Referenced by GetRenderTargetSize(), and impeller::Surface::Surface().
const std::optional< DepthAttachment > & impeller::RenderTarget::GetDepthAttachment | ( | ) | const |
Definition at line 247 of file render_target.cc.
Referenced by impeller::InlinePassContext::GetRenderPass(), impeller::GetVKClearValues(), impeller::ContextVK::InitializeCommonlyUsedShadersIfNeeded(), impeller::testing::TEST_P(), and impeller::ToMTLRenderPassDescriptor().
size_t impeller::RenderTarget::GetMaxColorAttacmentBindIndex | ( | ) | const |
Definition at line 191 of file render_target.cc.
PixelFormat impeller::RenderTarget::GetRenderTargetPixelFormat | ( | ) | const |
Definition at line 183 of file render_target.cc.
References GetRenderTargetTexture(), and impeller::kUnknown.
ISize impeller::RenderTarget::GetRenderTargetSize | ( | ) | const |
Definition at line 171 of file render_target.cc.
References GetColorAttachmentSize().
Referenced by impeller::Canvas::GetLocalCoverageLimit(), impeller::AiksPlayground::OpenPlaygroundHere(), and impeller::DlPlayground::OpenPlaygroundHere().
std::shared_ptr< Texture > impeller::RenderTarget::GetRenderTargetTexture | ( | ) | const |
Definition at line 176 of file render_target.cc.
Referenced by impeller::DisplayListToTexture(), impeller::InlinePassContext::EndPass(), impeller::EntityPassTarget::Flip(), GetRenderTargetPixelFormat(), impeller::InlinePassContext::GetTexture(), and impeller::ContentContext::MakeSubpass().
SampleCount impeller::RenderTarget::GetSampleCount | ( | ) | const |
const std::optional< StencilAttachment > & impeller::RenderTarget::GetStencilAttachment | ( | ) | const |
Definition at line 251 of file render_target.cc.
Referenced by impeller::InlinePassContext::GetRenderPass(), impeller::GetVKClearValues(), impeller::ContextVK::InitializeCommonlyUsedShadersIfNeeded(), and impeller::ToMTLRenderPassDescriptor().
size_t impeller::RenderTarget::GetTotalAttachmentCount | ( | ) | const |
Definition at line 256 of file render_target.cc.
bool impeller::RenderTarget::HasColorAttachment | ( | size_t | index | ) | const |
bool impeller::RenderTarget::IsValid | ( | ) | const |
Definition at line 23 of file render_target.cc.
References HasColorAttachment(), IterateAllAttachments(), impeller::TextureTypeToString(), ToString(), and VALIDATION_LOG.
Referenced by impeller::RenderTargetCache::CreateOffscreen(), impeller::RenderTargetCache::CreateOffscreenMSAA(), impeller::DisplayListToTexture(), impeller::EntityPassTarget::IsValid(), and impeller::testing::TEST_P().
void impeller::RenderTarget::IterateAllAttachments | ( | const std::function< bool(const Attachment &attachment)> & | iterator | ) | const |
bool impeller::RenderTarget::IterateAllColorAttachments | ( | const std::function< bool(size_t index, const ColorAttachment &attachment)> & | iterator | ) | const |
Definition at line 96 of file render_target.cc.
Referenced by impeller::GetVKClearValues(), impeller::ContextVK::InitializeCommonlyUsedShadersIfNeeded(), and impeller::ToMTLRenderPassDescriptor().
RenderTarget & impeller::RenderTarget::SetColorAttachment | ( | const ColorAttachment & | attachment, |
size_t | index | ||
) |
Definition at line 199 of file render_target.cc.
References impeller::Attachment::IsValid().
Referenced by impeller::RenderTargetAllocator::CreateOffscreen(), impeller::RenderTargetAllocator::CreateOffscreenMSAA(), impeller::testing::CreateTestCanvas(), impeller::EntityPassTarget::Flip(), impeller::InlinePassContext::GetRenderPass(), impeller::Playground::OpenPlaygroundHere(), impeller::testing::TEST_P(), impeller::SurfaceGLES::WrapFBO(), impeller::SurfaceVK::WrapSwapchainImage(), and impeller::WrapTextureWithRenderTarget().
RenderTarget & impeller::RenderTarget::SetDepthAttachment | ( | std::optional< DepthAttachment > | attachment | ) |
Definition at line 213 of file render_target.cc.
Referenced by impeller::RenderTargetAllocator::CreateOffscreen(), impeller::RenderTargetAllocator::CreateOffscreenMSAA(), impeller::InlinePassContext::GetRenderPass(), impeller::Playground::OpenPlaygroundHere(), SetupDepthStencilAttachments(), impeller::testing::TEST_P(), impeller::SurfaceGLES::WrapFBO(), and impeller::WrapTextureWithRenderTarget().
RenderTarget & impeller::RenderTarget::SetStencilAttachment | ( | std::optional< StencilAttachment > | attachment | ) |
Definition at line 223 of file render_target.cc.
Referenced by impeller::RenderTargetAllocator::CreateOffscreen(), impeller::RenderTargetAllocator::CreateOffscreenMSAA(), impeller::InlinePassContext::GetRenderPass(), impeller::Playground::OpenPlaygroundHere(), SetupDepthStencilAttachments(), impeller::testing::TEST_P(), impeller::SurfaceGLES::WrapFBO(), and impeller::WrapTextureWithRenderTarget().
void impeller::RenderTarget::SetupDepthStencilAttachments | ( | const Context & | context, |
Allocator & | allocator, | ||
ISize | size, | ||
bool | msaa, | ||
std::string_view | label = "Offscreen" , |
||
RenderTarget::AttachmentConfig | stencil_attachment_config = RenderTarget::kDefaultStencilAttachmentConfig , |
||
const std::shared_ptr< Texture > & | depth_stencil_texture = nullptr |
||
) |
Definition at line 475 of file render_target.cc.
References impeller::DepthAttachment::clear_depth, impeller::StencilAttachment::clear_stencil, impeller::Allocator::CreateTexture(), impeller::TextureDescriptor::format, impeller::Context::GetCapabilities(), impeller::kCount4, impeller::kRenderTarget, impeller::kTexture2DMultisample, impeller::Attachment::load_action, impeller::RenderTarget::AttachmentConfig::load_action, impeller::TextureDescriptor::sample_count, SetDepthAttachment(), SetStencilAttachment(), impeller::TextureDescriptor::size, impeller::TextureDescriptor::storage_mode, impeller::RenderTarget::AttachmentConfig::storage_mode, impeller::Attachment::store_action, impeller::RenderTarget::AttachmentConfig::store_action, impeller::Attachment::texture, impeller::TextureDescriptor::type, and impeller::TextureDescriptor::usage.
Referenced by impeller::RenderTargetAllocator::CreateOffscreen(), impeller::RenderTargetAllocator::CreateOffscreenMSAA(), and impeller::SurfaceVK::WrapSwapchainImage().
RenderTargetConfig impeller::RenderTarget::ToConfig | ( | ) | const |
std::string impeller::RenderTarget::ToString | ( | ) | const |
Definition at line 278 of file render_target.cc.
References impeller::ColorAttachmentToString(), impeller::DepthAttachmentToString(), impeller::SPrintF(), and impeller::StencilAttachmentToString().
Referenced by IsValid().
|
staticconstexpr |
Definition at line 55 of file render_target.h.
Referenced by impeller::ContentContext::MakeSubpass(), and impeller::testing::TEST_P().
|
staticconstexpr |
Definition at line 61 of file render_target.h.
Referenced by impeller::ContentContext::MakeSubpass().
|
staticconstexpr |
Definition at line 68 of file render_target.h.
Referenced by impeller::ContentContext::MakeSubpass(), impeller::SurfaceVK::WrapSwapchainImage(), and impeller::WrapTextureWithRenderTarget().