7#include "flutter/fml/trace_event.h"
14 : context_(
std::move(context)), desc_(
desc), enable_msaa_(enable_msaa) {}
19 if (cached_msaa_texture_) {
20 return cached_msaa_texture_;
22 cached_msaa_texture_ = CreateMSAATexture();
23 return cached_msaa_texture_;
26const std::shared_ptr<Texture>&
28 if (cached_depth_stencil_) {
29 return cached_depth_stencil_;
31 cached_depth_stencil_ = CreateDepthStencilTexture();
32 return cached_depth_stencil_;
35std::shared_ptr<Texture> SwapchainTransientsVK::CreateMSAATexture()
const {
40 TextureDescriptor msaa_desc;
44 msaa_desc.format = desc_.
format;
45 msaa_desc.size = desc_.
size;
48 auto context = context_.lock();
52 auto texture = context->GetResourceAllocator()->CreateTexture(msaa_desc);
56 texture->SetLabel(
"SwapchainMSAA");
60std::shared_ptr<Texture> SwapchainTransientsVK::CreateDepthStencilTexture()
63 auto context = context_.lock();
67 TextureDescriptor depth_stencil_desc;
76 depth_stencil_desc.format =
77 context->GetCapabilities()->GetDefaultDepthStencilFormat();
78 depth_stencil_desc.size = desc_.
size;
82 context->GetResourceAllocator()->CreateTexture(depth_stencil_desc);
86 texture->SetLabel(
"SwapchainDepthStencil");
bool IsMSAAEnabled() const
const std::weak_ptr< Context > & GetContext() const
const std::shared_ptr< Texture > & GetMSAATexture()
const std::shared_ptr< Texture > & GetDepthStencilTexture()
SwapchainTransientsVK(std::weak_ptr< Context > context, TextureDescriptor desc, bool enable_msaa)
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...
#define TRACE_EVENT0(category_group, name)