Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
impeller::Attachment Struct Reference

#include <formats.h>

Inheritance diagram for impeller::Attachment:
impeller::ColorAttachment impeller::DepthAttachment impeller::StencilAttachment

Public Member Functions

bool IsValid () const
 

Public Attributes

std::shared_ptr< Texturetexture
 
std::shared_ptr< Textureresolve_texture
 
LoadAction load_action = LoadAction::kDontCare
 
StoreAction store_action = StoreAction::kStore
 

Detailed Description

Definition at line 650 of file formats.h.

Member Function Documentation

◆ IsValid()

bool impeller::Attachment::IsValid ( ) const

Definition at line 26 of file formats.cc.

26 {
27 if (!texture || !texture->IsValid()) {
28 VALIDATION_LOG << "Attachment has no texture.";
29 return false;
30 }
31
33 if (!resolve_texture || !resolve_texture->IsValid()) {
34 VALIDATION_LOG << "Store action needs resolve but no valid resolve "
35 "texture specified.";
36 return false;
37 }
38 }
39
40 if (resolve_texture) {
43 VALIDATION_LOG << "A resolve texture was specified, but the store action "
44 "doesn't include multisample resolve.";
45 return false;
46 }
47
48 if (texture->GetTextureDescriptor().storage_mode ==
52 << "The multisample texture cannot be transient when "
53 "specifying the StoreAndMultisampleResolve StoreAction.";
54 }
55 }
56
57 auto storage_mode = resolve_texture
58 ? resolve_texture->GetTextureDescriptor().storage_mode
59 : texture->GetTextureDescriptor().storage_mode;
60
61 if (storage_mode == StorageMode::kDeviceTransient) {
63 VALIDATION_LOG << "The LoadAction cannot be Load when attaching a device "
64 "transient " +
65 std::string(resolve_texture ? "resolve texture."
66 : "texture.");
67 return false;
68 }
70 VALIDATION_LOG << "The StoreAction must be DontCare when attaching a "
71 "device transient " +
72 std::string(resolve_texture ? "resolve texture."
73 : "texture.");
74 return false;
75 }
76 }
77
78 return true;
79}
constexpr bool StoreActionNeedsResolveTexture(StoreAction action)
Definition: formats.cc:15
std::shared_ptr< Texture > resolve_texture
Definition: formats.h:652
LoadAction load_action
Definition: formats.h:653
std::shared_ptr< Texture > texture
Definition: formats.h:651
StoreAction store_action
Definition: formats.h:654
#define VALIDATION_LOG
Definition: validation.h:73

Member Data Documentation

◆ load_action

LoadAction impeller::Attachment::load_action = LoadAction::kDontCare

Definition at line 653 of file formats.h.

◆ resolve_texture

std::shared_ptr<Texture> impeller::Attachment::resolve_texture

Definition at line 652 of file formats.h.

◆ store_action

StoreAction impeller::Attachment::store_action = StoreAction::kStore

Definition at line 654 of file formats.h.

◆ texture

std::shared_ptr<Texture> impeller::Attachment::texture

Definition at line 651 of file formats.h.


The documentation for this struct was generated from the following files: