Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 638 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:640
LoadAction load_action
Definition formats.h:641
std::shared_ptr< Texture > texture
Definition formats.h:639
StoreAction store_action
Definition formats.h:642
#define VALIDATION_LOG
Definition validation.h:73

Member Data Documentation

◆ load_action

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

Definition at line 641 of file formats.h.

◆ resolve_texture

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

Definition at line 640 of file formats.h.

◆ store_action

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

Definition at line 642 of file formats.h.

◆ texture

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

Definition at line 639 of file formats.h.


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