@@ -110,6 +110,42 @@ enum class PixelFormat {
110110 kD32FloatS8UInt ,
111111};
112112
113+ constexpr const char * PixelFormatToString (PixelFormat format) {
114+ switch (format) {
115+ case PixelFormat::kUnknown :
116+ return " Unknown" ;
117+ case PixelFormat::kA8UNormInt :
118+ return " A8UNormInt" ;
119+ case PixelFormat::kR8UNormInt :
120+ return " R8UNormInt" ;
121+ case PixelFormat::kR8G8UNormInt :
122+ return " R8G8UNormInt" ;
123+ case PixelFormat::kR8G8B8A8UNormInt :
124+ return " R8G8B8A8UNormInt" ;
125+ case PixelFormat::kR8G8B8A8UNormIntSRGB :
126+ return " R8G8B8A8UNormIntSRGB" ;
127+ case PixelFormat::kB8G8R8A8UNormInt :
128+ return " B8G8R8A8UNormInt" ;
129+ case PixelFormat::kB8G8R8A8UNormIntSRGB :
130+ return " B8G8R8A8UNormIntSRGB" ;
131+ case PixelFormat::kR32G32B32A32Float :
132+ return " R32G32B32A32Float" ;
133+ case PixelFormat::kR16G16B16A16Float :
134+ return " R16G16B16A16Float" ;
135+ case PixelFormat::kB10G10R10XR :
136+ return " B10G10R10XR" ;
137+ case PixelFormat::kB10G10R10XRSRGB :
138+ return " B10G10R10XRSRGB" ;
139+ case PixelFormat::kB10G10R10A10XR :
140+ return " B10G10R10A10XR" ;
141+ case PixelFormat::kS8UInt :
142+ return " S8UInt" ;
143+ case PixelFormat::kD32FloatS8UInt :
144+ return " D32FloatS8UInt" ;
145+ }
146+ FML_UNREACHABLE ();
147+ }
148+
113149enum class BlendFactor {
114150 kZero ,
115151 kOne ,
@@ -147,6 +183,30 @@ enum class StoreAction {
147183 kStoreAndMultisampleResolve ,
148184};
149185
186+ constexpr const char * LoadActionToString (LoadAction action) {
187+ switch (action) {
188+ case LoadAction::kDontCare :
189+ return " DontCare" ;
190+ case LoadAction::kLoad :
191+ return " Load" ;
192+ case LoadAction::kClear :
193+ return " Clear" ;
194+ }
195+ }
196+
197+ constexpr const char * StoreActionToString (StoreAction action) {
198+ switch (action) {
199+ case StoreAction::kDontCare :
200+ return " DontCare" ;
201+ case StoreAction::kStore :
202+ return " Store" ;
203+ case StoreAction::kMultisampleResolve :
204+ return " MultisampleResolve" ;
205+ case StoreAction::kStoreAndMultisampleResolve :
206+ return " StoreAndMultisampleResolve" ;
207+ }
208+ }
209+
150210constexpr bool CanClearAttachment (LoadAction action) {
151211 switch (action) {
152212 case LoadAction::kLoad :
@@ -530,6 +590,14 @@ struct StencilAttachment : public Attachment {
530590 uint32_t clear_stencil = 0 ;
531591};
532592
593+ std::string AttachmentToString (const Attachment& attachment);
594+
595+ std::string ColorAttachmentToString (const ColorAttachment& color);
596+
597+ std::string DepthAttachmentToString (const DepthAttachment& depth);
598+
599+ std::string StencilAttachmentToString (const StencilAttachment& stencil);
600+
533601} // namespace impeller
534602
535603namespace std {
0 commit comments