#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, const std::string &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) |
RenderTarget & | SetDepthAttachment (std::optional< DepthAttachment > attachment) |
RenderTarget & | SetStencilAttachment (std::optional< StencilAttachment > attachment) |
size_t | GetMaxColorAttacmentBindIndex () const |
const std::map< size_t, ColorAttachment > & | GetColorAttachments () const |
const std::optional< DepthAttachment > & | GetDepthAttachment () const |
const std::optional< StencilAttachment > & | GetStencilAttachment () const |
size_t | GetTotalAttachmentCount () 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 |
const std::map< size_t, ColorAttachment > & impeller::RenderTarget::GetColorAttachments | ( | ) | const |
Definition at line 198 of file render_target.cc.
Referenced by impeller::EntityPassTarget::Flip(), impeller::InlinePassContext::GetRenderPass(), impeller::GetVKClearValues(), impeller::ContextVK::InitializeCommonlyUsedShadersIfNeeded(), impeller::testing::TEST_P(), ToConfig(), and impeller::ToMTLRenderPassDescriptor().
std::optional< ISize > impeller::RenderTarget::GetColorAttachmentSize | ( | size_t | index | ) | const |
Definition at line 129 of file render_target.cc.
Referenced by GetRenderTargetSize(), and impeller::Surface::Surface().
const std::optional< DepthAttachment > & impeller::RenderTarget::GetDepthAttachment | ( | ) | const |
Definition at line 203 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 161 of file render_target.cc.
PixelFormat impeller::RenderTarget::GetRenderTargetPixelFormat | ( | ) | const |
Definition at line 153 of file render_target.cc.
References GetRenderTargetTexture(), and impeller::kUnknown.
ISize impeller::RenderTarget::GetRenderTargetSize | ( | ) | const |
Definition at line 139 of file render_target.cc.
References GetColorAttachmentSize().
Referenced by impeller::RenderPass::AddCommand(), impeller::scene::Scene::Render(), and impeller::EntityPass::Render().
std::shared_ptr< Texture > impeller::RenderTarget::GetRenderTargetTexture | ( | ) | const |
Definition at line 144 of file render_target.cc.
Referenced by impeller::InlinePassContext::EndPass(), GetRenderTargetPixelFormat(), impeller::InlinePassContext::GetTexture(), impeller::ContentContext::MakeSubpass(), impeller::SceneContents::Render(), and impeller::EntityPass::Render().
SampleCount impeller::RenderTarget::GetSampleCount | ( | ) | const |
Definition at line 115 of file render_target.cc.
References impeller::kCount1.
Referenced by impeller::scene::Material::GetContextOptions().
const std::optional< StencilAttachment > & impeller::RenderTarget::GetStencilAttachment | ( | ) | const |
Definition at line 207 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 212 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::EntityPassTarget::IsValid(), impeller::SceneContents::Render(), and impeller::testing::TEST_P().
void impeller::RenderTarget::IterateAllAttachments | ( | const std::function< bool(const Attachment &attachment)> & | iterator | ) | const |
RenderTarget & impeller::RenderTarget::SetColorAttachment | ( | const ColorAttachment & | attachment, |
size_t | index | ||
) |
Definition at line 169 of file render_target.cc.
References impeller::Attachment::IsValid().
Referenced by impeller::RenderTargetAllocator::CreateOffscreen(), impeller::RenderTargetAllocator::CreateOffscreenMSAA(), impeller::EntityPassTarget::Flip(), impeller::InlinePassContext::GetRenderPass(), impeller::testing::TEST_P(), impeller::SurfaceGLES::WrapFBO(), and impeller::KHRSurfaceVK::WrapSwapchainImage().
RenderTarget & impeller::RenderTarget::SetDepthAttachment | ( | std::optional< DepthAttachment > | attachment | ) |
RenderTarget & impeller::RenderTarget::SetStencilAttachment | ( | std::optional< StencilAttachment > | attachment | ) |
Definition at line 188 of file render_target.cc.
Referenced by impeller::RenderTargetAllocator::CreateOffscreen(), impeller::RenderTargetAllocator::CreateOffscreenMSAA(), impeller::InlinePassContext::GetRenderPass(), SetupDepthStencilAttachments(), impeller::testing::TEST_P(), and impeller::SurfaceGLES::WrapFBO().
void impeller::RenderTarget::SetupDepthStencilAttachments | ( | const Context & | context, |
Allocator & | allocator, | ||
ISize | size, | ||
bool | msaa, | ||
const std::string & | label = "Offscreen" , |
||
RenderTarget::AttachmentConfig | stencil_attachment_config = RenderTarget::kDefaultStencilAttachmentConfig , |
||
const std::shared_ptr< Texture > & | depth_stencil_texture = nullptr |
||
) |
Definition at line 413 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::RenderTarget::AttachmentConfig::load_action, impeller::Attachment::load_action, impeller::TextureDescriptor::sample_count, SetDepthAttachment(), SetStencilAttachment(), impeller::TextureDescriptor::size, impeller::SPrintF(), impeller::TextureDescriptor::storage_mode, impeller::RenderTarget::AttachmentConfig::storage_mode, impeller::RenderTarget::AttachmentConfig::store_action, impeller::Attachment::store_action, impeller::Attachment::texture, impeller::TextureDescriptor::type, and impeller::TextureDescriptor::usage.
Referenced by impeller::RenderTargetAllocator::CreateOffscreen(), impeller::RenderTargetAllocator::CreateOffscreenMSAA(), and impeller::KHRSurfaceVK::WrapSwapchainImage().
|
inline |
Definition at line 125 of file render_target.h.
References GetColorAttachments(), and impeller::RenderTargetConfig::size.
std::string impeller::RenderTarget::ToString | ( | ) | const |
Definition at line 231 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(), and impeller::KHRSurfaceVK::WrapSwapchainImage().