5#ifndef FLUTTER_IMPELLER_CORE_FORMATS_H_
6#define FLUTTER_IMPELLER_CORE_FORMATS_H_
65 return "DevicePrivate";
67 return "DeviceTransient";
301 return "R8G8UNormInt";
303 return "R8G8B8A8UNormInt";
305 return "R8G8B8A8UNormIntSRGB";
307 return "B8G8R8A8UNormInt";
309 return "B8G8R8A8UNormIntSRGB";
311 return "R32G32B32A32Float";
313 return "R16G16B16A16Float";
315 return "B10G10R10XR";
317 return "B10G10R10XRSRGB";
319 return "B10G10R10A10XR";
323 return "D24UnormS8Uint";
325 return "D32FloatS8UInt";
329 return "BC1RGBAUNormInt";
331 return "BC1RGBAUNormIntSRGB";
333 return "BC3RGBAUNormInt";
335 return "BC3RGBAUNormIntSRGB";
337 return "BC5RGUNormInt";
339 return "BC7RGBAUNormInt";
341 return "BC7RGBAUNormIntSRGB";
343 return "ETC2RGB8UNormInt";
345 return "ETC2RGB8UNormIntSRGB";
347 return "ETC2RGBA8UNormInt";
349 return "ETC2RGBA8UNormIntSRGB";
353 return "ASTC4x4LDRSRGB";
357 return "ASTC8x8LDRSRGB";
421 return "MultisampleResolve";
423 return "StoreAndMultisampleResolve";
462 return "Texture2DMultisample";
464 return "TextureCube";
466 return "TextureExternalOES";
505 return "ShaderWrite";
507 return "RenderTarget";
732 const size_t w = width <= 0 ? 0u : static_cast<size_t>(
width);
733 const size_t h = height <= 0 ? 0u : static_cast<size_t>(
height);
734 const size_t blocks_wide = (w + block_width - 1u) / block_width;
735 const size_t blocks_high = (h + block_height - 1u) / block_height;
743 const size_t w = width <= 0 ? 0u : static_cast<size_t>(
width);
744 const size_t blocks_wide = (w + block_width - 1u) / block_width;
796 constexpr size_t Hash()
const {
956struct hash<
impeller::StencilAttachmentDescriptor> {
uint32_t uint32_t * format
#define FML_UNREACHABLE()
#define IMPELLER_ENUM_IS_MASK(enum_name)
Declare this in the "impeller" namespace to make the enum maskable.
constexpr std::size_t HashCombine()
constexpr size_t BytesPerPixelForPixelFormat(PixelFormat format)
constexpr bool CanClearAttachment(LoadAction action)
constexpr size_t CompressedBlockHeightForPixelFormat(PixelFormat format)
The height, in texels, of one compression block. Uncompressed formats report 1.
std::string DepthAttachmentToString(const DepthAttachment &depth)
std::string ColorAttachmentToString(const ColorAttachment &color)
@ kOneMinusDestinationAlpha
@ kOneMinusDestinationColor
PrimitiveType
Decides how backend draws pixels based on input vertices.
@ kPoint
Draws a point at each input vertex.
@ kDecal
decal sampling mode is only supported on devices that pass the Capabilities.SupportsDecalSamplerAddre...
constexpr bool IsDepthWritable(PixelFormat format)
std::string StencilAttachmentToString(const StencilAttachment &stencil)
std::string TextureUsageMaskToString(TextureUsageMask mask)
StorageMode
Specified where the allocation resides and how it is used.
std::string AttachmentToString(const Attachment &attachment)
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
@ kEqual
Comparison test passes if new_value == current_value.
@ kLessEqual
Comparison test passes if new_value <= current_value.
@ kGreaterEqual
Comparison test passes if new_value >= current_value.
@ kAlways
Comparison test passes always passes.
@ kLess
Comparison test passes if new_value < current_value.
@ kGreater
Comparison test passes if new_value > current_value.
@ kNotEqual
Comparison test passes if new_value != current_value.
@ kNever
Comparison test never passes.
constexpr const char * LoadActionToString(LoadAction action)
constexpr const char * StoreActionToString(StoreAction action)
MipFilter
Options for selecting and filtering between mipmap levels.
@ kBase
The texture is sampled as if it only had a single mipmap level.
@ kDecrementWrap
Decrement the current stencil value by 1. If at zero, set to maximum.
@ kSetToReferenceValue
Reset the stencil value to the reference value.
@ kDecrementClamp
Decrement the current stencil value by 1. Clamp it to zero.
@ kIncrementClamp
Increment the current stencil value by 1. Clamp it to the maximum.
@ kIncrementWrap
Increment the current stencil value by 1. If at maximum, set to zero.
@ kInvert
Perform a logical bitwise invert on the current stencil value.
@ kKeep
Don't modify the current stencil value.
CompressedTextureFamily
The family of a block-compressed pixel format. GPUs support compressed formats on a per-family basis,...
@ kASTCHDR
ASTC HDR. A separate device feature from ASTC LDR.
@ kBC
S3TC, RGTC, and BPTC (BC1 through BC7). Desktop GPUs.
@ kETC2
ETC2 and EAC. Mobile, OpenGL ES 3.0, and WebGL2.
@ kASTC
ASTC LDR. Modern mobile and some desktop.
constexpr size_t CompressedBlockWidthForPixelFormat(PixelFormat format)
The width, in texels, of one compression block. Uncompressed formats report 1.
constexpr size_t BytesForTextureRegion(PixelFormat format, int64_t width, int64_t height)
The number of bytes required to store a width x height texel region in format. Block-compressed forma...
@ kStoreAndMultisampleResolve
constexpr bool IsStencilWritable(PixelFormat format)
constexpr size_t BytesPerRowForTextureWidth(PixelFormat format, int64_t width)
The number of bytes in a single row of texel blocks for a texture of the given width in format.
constexpr size_t BytesPerBlockForPixelFormat(PixelFormat format)
The number of bytes used to store one block of format. For uncompressed formats a block is a single p...
constexpr CompressedTextureFamily CompressedTextureFamilyForFormat(PixelFormat format)
The compression family that format belongs to. Only valid for formats where IsCompressed is true.
constexpr const char * TextureTypeToString(TextureType type)
constexpr const char * StorageModeToString(StorageMode mode)
constexpr bool IsMultisampleCapable(TextureType type)
MinMagFilter
Describes how the texture should be sampled when the texture is being shrunk (minified) or expanded (...
@ kNearest
Select nearest to the sample point. Most widely supported.
constexpr bool IsCompressed(PixelFormat format)
Whether format is a block-compressed format.
constexpr const char * TextureUsageToString(TextureUsage usage)
Mask< TextureUsage > TextureUsageMask
constexpr const char * PixelFormatToString(PixelFormat format)
constexpr bool CanDiscardAttachmentWhenDone(StoreAction action)
impeller::ShaderType type
std::shared_ptr< Texture > resolve_texture
std::shared_ptr< Texture > texture
Describe the color attachment that will be used with this pipeline.
BlendOperation color_blend_op
constexpr size_t Hash() const
BlendFactor dst_color_blend_factor
ColorWriteMask write_mask
BlendFactor src_alpha_blend_factor
constexpr bool operator==(const ColorAttachmentDescriptor &o) const
BlendOperation alpha_blend_op
BlendFactor src_color_blend_factor
BlendFactor dst_alpha_blend_factor
static constexpr Color BlackTransparent()
constexpr bool operator==(const DepthAttachmentDescriptor &o) const
CompareFunction depth_compare
constexpr size_t GetHash() const
constexpr bool operator==(const DepthRange &other) const
StencilOperation stencil_failure
CompareFunction stencil_compare
StencilOperation depth_failure
constexpr bool operator==(const StencilAttachmentDescriptor &o) const
constexpr size_t GetHash() const
StencilOperation depth_stencil_pass
constexpr bool operator==(const Viewport &other) const
constexpr std::size_t operator()(const impeller::DepthAttachmentDescriptor &des) const
constexpr std::size_t operator()(const impeller::StencilAttachmentDescriptor &des) const