Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
flutter::gpu Namespace Reference

Classes

class  CommandBuffer
 
class  Context
 
class  DeviceBuffer
 
class  RenderPass
 
class  RenderPipeline
 
class  Shader
 An immutable collection of shaders loaded from a shader bundle asset. More...
 
class  ShaderLibrary
 An immutable collection of shaders loaded from a shader bundle asset. More...
 
class  Surface
 
class  Texture
 

Enumerations

enum class  FlutterGPUStorageMode {
  kHostVisible ,
  kDevicePrivate ,
  kDeviceTransient
}
 
enum class  FlutterGPUPixelFormat {
  kUnknown ,
  kA8UNormInt ,
  kR8UNormInt ,
  kR8G8UNormInt ,
  kR8G8B8A8UNormInt ,
  kR8G8B8A8UNormIntSRGB ,
  kB8G8R8A8UNormInt ,
  kB8G8R8A8UNormIntSRGB ,
  kR32G32B32A32Float ,
  kR16G16B16A16Float ,
  kR32Float ,
  kS8UInt ,
  kD24UnormS8Uint ,
  kD32FloatS8UInt ,
  kBC1RGBAUNormInt ,
  kBC1RGBAUNormIntSRGB ,
  kBC3RGBAUNormInt ,
  kBC3RGBAUNormIntSRGB ,
  kBC5RGUNormInt ,
  kBC7RGBAUNormInt ,
  kBC7RGBAUNormIntSRGB ,
  kETC2RGB8UNormInt ,
  kETC2RGB8UNormIntSRGB ,
  kETC2RGBA8UNormInt ,
  kETC2RGBA8UNormIntSRGB ,
  kASTC4x4LDR ,
  kASTC4x4LDRSRGB ,
  kASTC8x8LDR ,
  kASTC8x8LDRSRGB ,
  kASTC4x4HDR ,
  kASTC8x8HDR
}
 
enum class  FlutterGPUTextureCompressionFamily {
  kBC ,
  kETC2 ,
  kASTC ,
  kASTCHDR
}
 
enum class  FlutterGPUBlendFactor {
  kZero ,
  kOne ,
  kSourceColor ,
  kOneMinusSourceColor ,
  kSourceAlpha ,
  kOneMinusSourceAlpha ,
  kDestinationColor ,
  kOneMinusDestinationColor ,
  kDestinationAlpha ,
  kOneMinusDestinationAlpha ,
  kSourceAlphaSaturated ,
  kBlendColor ,
  kOneMinusBlendColor ,
  kBlendAlpha ,
  kOneMinusBlendAlpha
}
 
enum class  FlutterGPUBlendOperation {
  kAdd ,
  kSubtract ,
  kReverseSubtract
}
 
enum class  FlutterGPULoadAction {
  kDontCare ,
  kLoad ,
  kClear
}
 
enum class  FlutterGPUStoreAction {
  kDontCare ,
  kStore ,
  kMultisampleResolve ,
  kStoreAndMultisampleResolve
}
 
enum class  FlutterGPUShaderStage {
  kVertex ,
  kFragment
}
 
enum class  FlutterGPUMinMagFilter {
  kNearest ,
  kLinear
}
 
enum class  FlutterGPUMipFilter {
  kNearest ,
  kLinear
}
 
enum class  FlutterGPUSamplerAddressMode {
  kClampToEdge ,
  kRepeat ,
  kMirror
}
 
enum class  FlutterGPUIndexType {
  k16bit ,
  k32bit
}
 
enum class  FlutterGPUPrimitiveType {
  kTriangle ,
  kTriangleStrip ,
  kLine ,
  kLineStrip ,
  kPoint
}
 
enum class  FlutterGPUCompareFunction {
  kNever ,
  kAlways ,
  kLess ,
  kEqual ,
  kLessEqual ,
  kGreater ,
  kNotEqual ,
  kGreaterEqual
}
 
enum class  FlutterGPUStencilOperation {
  kKeep ,
  kZero ,
  kSetToReferenceValue ,
  kIncrementClamp ,
  kDecrementClamp ,
  kInvert ,
  kIncrementWrap ,
  kDecrementWrap
}
 
enum class  FlutterGPUCullMode {
  kNone ,
  kFrontFace ,
  kBackFace
}
 
enum class  FlutterGPUWindingOrder {
  kClockwise ,
  kCounterClockwise
}
 
enum class  FlutterGPUPolygonMode {
  kFill ,
  kLine
}
 

Functions

 IMPLEMENT_WRAPPERTYPEINFO (flutter_gpu, CommandBuffer)
 
bool SupportsNormalOffscreenMSAA (const impeller::Context &context)
 
 IMPLEMENT_WRAPPERTYPEINFO (flutter_gpu, Context)
 
 IMPLEMENT_WRAPPERTYPEINFO (flutter_gpu, DeviceBuffer)
 
constexpr impeller::StorageMode ToImpellerStorageMode (FlutterGPUStorageMode value)
 
constexpr impeller::StorageMode ToImpellerStorageMode (int value)
 
constexpr impeller::CompressedTextureFamily ToImpellerCompressedTextureFamily (FlutterGPUTextureCompressionFamily value)
 
constexpr impeller::CompressedTextureFamily ToImpellerCompressedTextureFamily (int value)
 
constexpr impeller::PixelFormat ToImpellerPixelFormat (FlutterGPUPixelFormat value)
 
constexpr impeller::PixelFormat ToImpellerPixelFormat (int value)
 
constexpr FlutterGPUPixelFormat FromImpellerPixelFormat (impeller::PixelFormat value)
 
constexpr impeller::BlendFactor ToImpellerBlendFactor (FlutterGPUBlendFactor value)
 
constexpr impeller::BlendFactor ToImpellerBlendFactor (int value)
 
constexpr impeller::BlendOperation ToImpellerBlendOperation (FlutterGPUBlendOperation value)
 
constexpr impeller::BlendOperation ToImpellerBlendOperation (int value)
 
constexpr impeller::LoadAction ToImpellerLoadAction (FlutterGPULoadAction value)
 
constexpr impeller::LoadAction ToImpellerLoadAction (int value)
 
constexpr impeller::StoreAction ToImpellerStoreAction (FlutterGPUStoreAction value)
 
constexpr impeller::StoreAction ToImpellerStoreAction (int value)
 
constexpr impeller::ShaderStage ToImpellerShaderStage (FlutterGPUShaderStage value)
 
constexpr impeller::ShaderStage ToImpellerShaderStage (int value)
 
constexpr FlutterGPUShaderStage FromImpellerShaderStage (impeller::ShaderStage value)
 
constexpr impeller::MinMagFilter ToImpellerMinMagFilter (FlutterGPUMinMagFilter value)
 
constexpr impeller::MinMagFilter ToImpellerMinMagFilter (int value)
 
constexpr impeller::MipFilter ToImpellerMipFilter (FlutterGPUMipFilter value)
 
constexpr impeller::MipFilter ToImpellerMipFilter (int value)
 
constexpr impeller::SamplerAddressMode ToImpellerSamplerAddressMode (FlutterGPUSamplerAddressMode value)
 
constexpr impeller::SamplerAddressMode ToImpellerSamplerAddressMode (int value)
 
constexpr impeller::IndexType ToImpellerIndexType (FlutterGPUIndexType value)
 
constexpr impeller::IndexType ToImpellerIndexType (int value)
 
constexpr impeller::PrimitiveType ToImpellerPrimitiveType (FlutterGPUPrimitiveType value)
 
constexpr impeller::PrimitiveType ToImpellerPrimitiveType (int value)
 
constexpr impeller::CompareFunction ToImpellerCompareFunction (FlutterGPUCompareFunction value)
 
constexpr impeller::CompareFunction ToImpellerCompareFunction (int value)
 
constexpr impeller::StencilOperation ToImpellerStencilOperation (FlutterGPUStencilOperation value)
 
constexpr impeller::StencilOperation ToImpellerStencilOperation (int value)
 
constexpr impeller::CullMode ToImpellerCullMode (FlutterGPUCullMode value)
 
constexpr impeller::CullMode ToImpellerCullMode (int value)
 
constexpr impeller::WindingOrder ToImpellerWindingOrder (FlutterGPUWindingOrder value)
 
constexpr impeller::WindingOrder ToImpellerWindingOrder (int value)
 
constexpr impeller::PolygonMode ToImpellerPolygonMode (FlutterGPUPolygonMode value)
 
constexpr impeller::PolygonMode ToImpellerPolygonMode (int value)
 
 IMPLEMENT_WRAPPERTYPEINFO (flutter_gpu, RenderPass)
 
 IMPLEMENT_WRAPPERTYPEINFO (flutter_gpu, RenderPipeline)
 
 IMPLEMENT_WRAPPERTYPEINFO (flutter_gpu, Shader)
 
 IMPLEMENT_WRAPPERTYPEINFO (flutter_gpu, ShaderLibrary)
 
static impeller::ShaderStage ToShaderStage (impeller::fb::shaderbundle::ShaderStage stage)
 
static impeller::ShaderType FromInputType (impeller::fb::shaderbundle::InputDataType input_type)
 
static impeller::ShaderType FromUniformType (impeller::fb::shaderbundle::UniformDataType uniform_type)
 
static size_t SizeOfInputType (impeller::fb::shaderbundle::InputDataType input_type)
 
static const impeller::fb::shaderbundle::BackendShader * GetShaderBackend (impeller::Context::BackendType backend_type, const impeller::fb::shaderbundle::Shader *shader)
 
static ShaderLibrary::ShaderMap ParseShaderBundle (impeller::Context::BackendType backend_type, const std::shared_ptr< fml::Mapping > &payload, const std::string &library_id)
 
 IMPLEMENT_WRAPPERTYPEINFO (flutter_gpu, Surface)
 
 IMPLEMENT_WRAPPERTYPEINFO (flutter_gpu, Texture)
 
static int32_t MipDimensionAtLevel (int32_t base_dimension, uint32_t mip_level)
 
static bool EncodeAndSubmitOverwrite (impeller::Context &context, const std::shared_ptr< impeller::Texture > &texture, const std::shared_ptr< impeller::DeviceBuffer > &staging_buffer, size_t source_length, impeller::IRect destination_region, uint32_t mip_level, uint32_t slice)
 

Enumeration Type Documentation

◆ FlutterGPUBlendFactor

Enumerator
kZero 
kOne 
kSourceColor 
kOneMinusSourceColor 
kSourceAlpha 
kOneMinusSourceAlpha 
kDestinationColor 
kOneMinusDestinationColor 
kDestinationAlpha 
kOneMinusDestinationAlpha 
kSourceAlphaSaturated 
kBlendColor 
kOneMinusBlendColor 
kBlendAlpha 
kOneMinusBlendAlpha 

Definition at line 249 of file formats.h.

◆ FlutterGPUBlendOperation

Enumerator
kAdd 
kSubtract 
kReverseSubtract 

Definition at line 307 of file formats.h.

◆ FlutterGPUCompareFunction

Enumerator
kNever 
kAlways 
kLess 
kEqual 
kLessEqual 
kGreater 
kNotEqual 
kGreaterEqual 

Definition at line 516 of file formats.h.

516 {
517 kNever,
518 kAlways,
519 kLess,
520 kEqual,
522 kGreater,
523 kNotEqual,
525};
@ 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.
@ kNever
Comparison test never passes.

◆ FlutterGPUCullMode

Enumerator
kNone 
kFrontFace 
kBackFace 

Definition at line 592 of file formats.h.

592 {
593 kNone,
595 kBackFace,
596};
@ kNone
Definition layer.h:43

◆ FlutterGPUIndexType

Enumerator
k16bit 
k32bit 

Definition at line 470 of file formats.h.

◆ FlutterGPULoadAction

Enumerator
kDontCare 
kLoad 
kClear 

Definition at line 329 of file formats.h.

◆ FlutterGPUMinMagFilter

Enumerator
kNearest 
kLinear 

Definition at line 410 of file formats.h.

◆ FlutterGPUMipFilter

Enumerator
kNearest 
kLinear 

Definition at line 429 of file formats.h.

429 {
430 kNearest,
431 kLinear,
432};

◆ FlutterGPUPixelFormat

Enumerator
kUnknown 
kA8UNormInt 
kR8UNormInt 
kR8G8UNormInt 
kR8G8B8A8UNormInt 
kR8G8B8A8UNormIntSRGB 
kB8G8R8A8UNormInt 
kB8G8R8A8UNormIntSRGB 
kR32G32B32A32Float 
kR16G16B16A16Float 
kR32Float 
kS8UInt 
kD24UnormS8Uint 
kD32FloatS8UInt 
kBC1RGBAUNormInt 
kBC1RGBAUNormIntSRGB 
kBC3RGBAUNormInt 
kBC3RGBAUNormIntSRGB 
kBC5RGUNormInt 
kBC7RGBAUNormInt 
kBC7RGBAUNormIntSRGB 
kETC2RGB8UNormInt 
kETC2RGB8UNormIntSRGB 
kETC2RGBA8UNormInt 
kETC2RGBA8UNormIntSRGB 
kASTC4x4LDR 
kASTC4x4LDRSRGB 
kASTC8x8LDR 
kASTC8x8LDRSRGB 
kASTC4x4HDR 
kASTC8x8HDR 

Definition at line 41 of file formats.h.

41 {
42 kUnknown,
53 kS8UInt,
56 // Block-compressed formats. Sample-only; support is per-family.
72 // ASTC HDR has no sRGB variant; the data is already linear floating point.
75};

◆ FlutterGPUPolygonMode

Enumerator
kFill 
kLine 

Definition at line 632 of file formats.h.

632 {
633 kFill,
634 kLine,
635};
@ kFill
fills interior of shapes

◆ FlutterGPUPrimitiveType

Enumerator
kTriangle 
kTriangleStrip 
kLine 
kLineStrip 
kPoint 

Definition at line 488 of file formats.h.

488 {
489 kTriangle,
491 kLine,
493 kPoint,
494};
@ kPoint
Draws a point at each input vertex.

◆ FlutterGPUSamplerAddressMode

Enumerator
kClampToEdge 
kRepeat 
kMirror 

Definition at line 447 of file formats.h.

◆ FlutterGPUShaderStage

Enumerator
kVertex 
kFragment 

Definition at line 376 of file formats.h.

◆ FlutterGPUStencilOperation

Enumerator
kKeep 
kZero 
kSetToReferenceValue 
kIncrementClamp 
kDecrementClamp 
kInvert 
kIncrementWrap 
kDecrementWrap 

Definition at line 554 of file formats.h.

554 {
555 kKeep,
556 kZero,
560 kInvert,
563};
@ 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.

◆ FlutterGPUStorageMode

Enumerator
kHostVisible 
kDevicePrivate 
kDeviceTransient 

Definition at line 19 of file formats.h.

◆ FlutterGPUStoreAction

Enumerator
kDontCare 
kStore 
kMultisampleResolve 
kStoreAndMultisampleResolve 

Definition at line 351 of file formats.h.

◆ FlutterGPUTextureCompressionFamily

Enumerator
kBC 
kETC2 
kASTC 
kASTCHDR 

Definition at line 77 of file formats.h.

77 {
78 kBC,
79 kETC2,
80 kASTC,
82};
@ 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.

◆ FlutterGPUWindingOrder

Enumerator
kClockwise 
kCounterClockwise 

Definition at line 613 of file formats.h.

Function Documentation

◆ EncodeAndSubmitOverwrite()

static bool flutter::gpu::EncodeAndSubmitOverwrite ( impeller::Context context,
const std::shared_ptr< impeller::Texture > &  texture,
const std::shared_ptr< impeller::DeviceBuffer > &  staging_buffer,
size_t  source_length,
impeller::IRect  destination_region,
uint32_t  mip_level,
uint32_t  slice 
)
static

Definition at line 56 of file texture.cc.

63 {
64 auto command_buffer = context.CreateCommandBuffer();
65 if (!command_buffer) {
66 FML_LOG(ERROR) << "Failed to create command buffer for texture overwrite.";
67 return false;
68 }
69 auto blit_pass = command_buffer->CreateBlitPass();
70 if (!blit_pass) {
71 FML_LOG(ERROR) << "Failed to create blit pass for texture overwrite.";
72 return false;
73 }
74 impeller::BufferView buffer_view(staging_buffer,
75 impeller::Range(0, source_length));
76 if (!blit_pass->AddCopy(std::move(buffer_view), texture, destination_region,
77 /*label=*/"Texture.overwrite", mip_level, slice)) {
78 return false;
79 }
80 if (!blit_pass->EncodeCommands()) {
81 return false;
82 }
83 return context.GetCommandQueue()->Submit({std::move(command_buffer)}).ok();
84}
#define FML_LOG(severity)
Definition logging.h:101
FlTexture * texture
std::shared_ptr< ContextGLES > context
std::shared_ptr< CommandBuffer > command_buffer

References command_buffer, context, FML_LOG, and texture.

Referenced by flutter::gpu::Texture::Overwrite().

◆ FromImpellerPixelFormat()

constexpr FlutterGPUPixelFormat flutter::gpu::FromImpellerPixelFormat ( impeller::PixelFormat  value)
constexpr

Definition at line 176 of file formats.h.

177 {
178 switch (value) {
180 return FlutterGPUPixelFormat::kUnknown;
182 return FlutterGPUPixelFormat::kR32Float;
184 return FlutterGPUPixelFormat::kA8UNormInt;
186 return FlutterGPUPixelFormat::kR8UNormInt;
188 return FlutterGPUPixelFormat::kR8G8UNormInt;
190 return FlutterGPUPixelFormat::kR8G8B8A8UNormInt;
192 return FlutterGPUPixelFormat::kR8G8B8A8UNormIntSRGB;
194 return FlutterGPUPixelFormat::kB8G8R8A8UNormInt;
196 return FlutterGPUPixelFormat::kB8G8R8A8UNormIntSRGB;
198 return FlutterGPUPixelFormat::kR32G32B32A32Float;
200 return FlutterGPUPixelFormat::kR16G16B16A16Float;
204 // Apple-only extended-range formats, not exposed by the Flutter GPU API.
205 return FlutterGPUPixelFormat::kUnknown;
207 return FlutterGPUPixelFormat::kS8UInt;
209 return FlutterGPUPixelFormat::kD24UnormS8Uint;
211 return FlutterGPUPixelFormat::kD32FloatS8UInt;
213 return FlutterGPUPixelFormat::kBC1RGBAUNormInt;
215 return FlutterGPUPixelFormat::kBC1RGBAUNormIntSRGB;
217 return FlutterGPUPixelFormat::kBC3RGBAUNormInt;
219 return FlutterGPUPixelFormat::kBC3RGBAUNormIntSRGB;
221 return FlutterGPUPixelFormat::kBC5RGUNormInt;
223 return FlutterGPUPixelFormat::kBC7RGBAUNormInt;
225 return FlutterGPUPixelFormat::kBC7RGBAUNormIntSRGB;
227 return FlutterGPUPixelFormat::kETC2RGB8UNormInt;
229 return FlutterGPUPixelFormat::kETC2RGB8UNormIntSRGB;
231 return FlutterGPUPixelFormat::kETC2RGBA8UNormInt;
233 return FlutterGPUPixelFormat::kETC2RGBA8UNormIntSRGB;
235 return FlutterGPUPixelFormat::kASTC4x4LDR;
237 return FlutterGPUPixelFormat::kASTC4x4LDRSRGB;
239 return FlutterGPUPixelFormat::kASTC8x8LDR;
241 return FlutterGPUPixelFormat::kASTC8x8LDRSRGB;
243 return FlutterGPUPixelFormat::kASTC4x4HDR;
245 return FlutterGPUPixelFormat::kASTC8x8HDR;
246 }
247}

References impeller::kA8UNormInt, kA8UNormInt, impeller::kASTC4x4HDR, kASTC4x4HDR, impeller::kASTC4x4LDR, kASTC4x4LDR, impeller::kASTC4x4LDRSRGB, kASTC4x4LDRSRGB, impeller::kASTC8x8HDR, kASTC8x8HDR, impeller::kASTC8x8LDR, kASTC8x8LDR, impeller::kASTC8x8LDRSRGB, kASTC8x8LDRSRGB, impeller::kB10G10R10A10XR, impeller::kB10G10R10XR, impeller::kB10G10R10XRSRGB, impeller::kB8G8R8A8UNormInt, kB8G8R8A8UNormInt, impeller::kB8G8R8A8UNormIntSRGB, kB8G8R8A8UNormIntSRGB, impeller::kBC1RGBAUNormInt, kBC1RGBAUNormInt, impeller::kBC1RGBAUNormIntSRGB, kBC1RGBAUNormIntSRGB, impeller::kBC3RGBAUNormInt, kBC3RGBAUNormInt, impeller::kBC3RGBAUNormIntSRGB, kBC3RGBAUNormIntSRGB, impeller::kBC5RGUNormInt, kBC5RGUNormInt, impeller::kBC7RGBAUNormInt, kBC7RGBAUNormInt, impeller::kBC7RGBAUNormIntSRGB, kBC7RGBAUNormIntSRGB, impeller::kD24UnormS8Uint, kD24UnormS8Uint, impeller::kD32FloatS8UInt, kD32FloatS8UInt, impeller::kETC2RGB8UNormInt, kETC2RGB8UNormInt, impeller::kETC2RGB8UNormIntSRGB, kETC2RGB8UNormIntSRGB, impeller::kETC2RGBA8UNormInt, kETC2RGBA8UNormInt, impeller::kETC2RGBA8UNormIntSRGB, kETC2RGBA8UNormIntSRGB, impeller::kR16G16B16A16Float, kR16G16B16A16Float, impeller::kR32Float, kR32Float, impeller::kR32G32B32A32Float, kR32G32B32A32Float, impeller::kR8G8B8A8UNormInt, kR8G8B8A8UNormInt, impeller::kR8G8B8A8UNormIntSRGB, kR8G8B8A8UNormIntSRGB, impeller::kR8G8UNormInt, kR8G8UNormInt, impeller::kR8UNormInt, kR8UNormInt, impeller::kS8UInt, kS8UInt, impeller::kUnknown, kUnknown, and value.

Referenced by InternalFlutterGpu_Context_GetDefaultColorFormat(), InternalFlutterGpu_Context_GetDefaultDepthStencilFormat(), and InternalFlutterGpu_Context_GetDefaultStencilFormat().

◆ FromImpellerShaderStage()

constexpr FlutterGPUShaderStage flutter::gpu::FromImpellerShaderStage ( impeller::ShaderStage  value)
constexpr

Definition at line 395 of file formats.h.

396 {
397 switch (value) {
399 return FlutterGPUShaderStage::kVertex;
401 return FlutterGPUShaderStage::kFragment;
404 FML_LOG(FATAL) << "Invalid Flutter GPU ShaderStage "
405 << static_cast<size_t>(value);
407 }
408}
int32_t value
#define FML_UNREACHABLE()
Definition logging.h:128

References FML_LOG, FML_UNREACHABLE, impeller::kCompute, impeller::kFragment, kFragment, impeller::kUnknown, impeller::kVertex, kVertex, and value.

◆ FromInputType()

static impeller::ShaderType flutter::gpu::FromInputType ( impeller::fb::shaderbundle::InputDataType  input_type)
static

Definition at line 68 of file shader_library.cc.

69 {
70 switch (input_type) {
71 case impeller::fb::shaderbundle::InputDataType::kBoolean:
73 case impeller::fb::shaderbundle::InputDataType::kSignedByte:
75 case impeller::fb::shaderbundle::InputDataType::kUnsignedByte:
77 case impeller::fb::shaderbundle::InputDataType::kSignedShort:
79 case impeller::fb::shaderbundle::InputDataType::kUnsignedShort:
81 case impeller::fb::shaderbundle::InputDataType::kSignedInt:
83 case impeller::fb::shaderbundle::InputDataType::kUnsignedInt:
85 case impeller::fb::shaderbundle::InputDataType::kSignedInt64:
87 case impeller::fb::shaderbundle::InputDataType::kUnsignedInt64:
89 case impeller::fb::shaderbundle::InputDataType::kFloat:
91 case impeller::fb::shaderbundle::InputDataType::kDouble:
93 }
94}

References impeller::kBoolean, impeller::kDouble, impeller::kFloat, impeller::kSignedByte, impeller::kSignedInt, impeller::kSignedInt64, impeller::kSignedShort, impeller::kUnsignedByte, impeller::kUnsignedInt, impeller::kUnsignedInt64, and impeller::kUnsignedShort.

Referenced by ParseShaderBundle().

◆ FromUniformType()

static impeller::ShaderType flutter::gpu::FromUniformType ( impeller::fb::shaderbundle::UniformDataType  uniform_type)
static

Definition at line 96 of file shader_library.cc.

97 {
98 switch (uniform_type) {
99 case impeller::fb::shaderbundle::UniformDataType::kBoolean:
101 case impeller::fb::shaderbundle::UniformDataType::kSignedByte:
103 case impeller::fb::shaderbundle::UniformDataType::kUnsignedByte:
105 case impeller::fb::shaderbundle::UniformDataType::kSignedShort:
107 case impeller::fb::shaderbundle::UniformDataType::kUnsignedShort:
109 case impeller::fb::shaderbundle::UniformDataType::kSignedInt:
111 case impeller::fb::shaderbundle::UniformDataType::kUnsignedInt:
113 case impeller::fb::shaderbundle::UniformDataType::kSignedInt64:
115 case impeller::fb::shaderbundle::UniformDataType::kUnsignedInt64:
117 case impeller::fb::shaderbundle::UniformDataType::kFloat:
119 case impeller::fb::shaderbundle::UniformDataType::kDouble:
121 case impeller::fb::shaderbundle::UniformDataType::kHalfFloat:
123 case impeller::fb::shaderbundle::UniformDataType::kSampledImage:
125 }
126}

References impeller::kBoolean, impeller::kDouble, impeller::kFloat, impeller::kHalfFloat, impeller::kSampledImage, impeller::kSignedByte, impeller::kSignedInt, impeller::kSignedInt64, impeller::kSignedShort, impeller::kUnsignedByte, impeller::kUnsignedInt, impeller::kUnsignedInt64, and impeller::kUnsignedShort.

Referenced by ParseShaderBundle().

◆ GetShaderBackend()

static const impeller::fb::shaderbundle::BackendShader * flutter::gpu::GetShaderBackend ( impeller::Context::BackendType  backend_type,
const impeller::fb::shaderbundle::Shader *  shader 
)
static

Definition at line 156 of file shader_library.cc.

158 {
159 switch (backend_type) {
161#ifdef FML_OS_IOS
162 return shader->metal_ios();
163#else
164 return shader->metal_desktop();
165#endif
167 return shader->opengl_es();
169 return shader->vulkan();
170 }
171}

References impeller::Context::kMetal, impeller::Context::kOpenGLES, and impeller::Context::kVulkan.

Referenced by ParseShaderBundle().

◆ IMPLEMENT_WRAPPERTYPEINFO() [1/9]

flutter::gpu::IMPLEMENT_WRAPPERTYPEINFO ( flutter_gpu  ,
CommandBuffer   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [2/9]

flutter::gpu::IMPLEMENT_WRAPPERTYPEINFO ( flutter_gpu  ,
Context   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [3/9]

flutter::gpu::IMPLEMENT_WRAPPERTYPEINFO ( flutter_gpu  ,
DeviceBuffer   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [4/9]

flutter::gpu::IMPLEMENT_WRAPPERTYPEINFO ( flutter_gpu  ,
RenderPass   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [5/9]

flutter::gpu::IMPLEMENT_WRAPPERTYPEINFO ( flutter_gpu  ,
RenderPipeline   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [6/9]

flutter::gpu::IMPLEMENT_WRAPPERTYPEINFO ( flutter_gpu  ,
Shader   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [7/9]

flutter::gpu::IMPLEMENT_WRAPPERTYPEINFO ( flutter_gpu  ,
ShaderLibrary   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [8/9]

flutter::gpu::IMPLEMENT_WRAPPERTYPEINFO ( flutter_gpu  ,
Surface   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [9/9]

flutter::gpu::IMPLEMENT_WRAPPERTYPEINFO ( flutter_gpu  ,
Texture   
)

◆ MipDimensionAtLevel()

static int32_t flutter::gpu::MipDimensionAtLevel ( int32_t  base_dimension,
uint32_t  mip_level 
)
static

Definition at line 47 of file texture.cc.

47 {
48 const int32_t shifted = base_dimension >> mip_level;
49 return shifted > 0 ? shifted : 1;
50}

Referenced by flutter::gpu::Texture::Overwrite().

◆ ParseShaderBundle()

static ShaderLibrary::ShaderMap flutter::gpu::ParseShaderBundle ( impeller::Context::BackendType  backend_type,
const std::shared_ptr< fml::Mapping > &  payload,
const std::string &  library_id 
)
static

Definition at line 173 of file shader_library.cc.

176 {
177 ShaderLibrary::ShaderMap shader_map;
178 if (payload == nullptr || !payload->GetMapping()) {
179 return shader_map;
180 }
181 if (!impeller::fb::shaderbundle::ShaderBundleBufferHasIdentifier(
182 payload->GetMapping())) {
183 return shader_map;
184 }
185 auto* bundle =
186 impeller::fb::shaderbundle::GetShaderBundle(payload->GetMapping());
187 if (!bundle) {
188 return shader_map;
189 }
190
191 const auto version = bundle->format_version();
192 const auto expected = static_cast<uint32_t>(
193 impeller::fb::shaderbundle::ShaderBundleFormatVersion::kVersion);
194 if (version != expected) {
195 VALIDATION_LOG << "Unsupported shader bundle format version: " << version
196 << ", expected: " << expected
197 << ". This shader bundle was compiled with an incompatible "
198 "version of impellerc. Please rebuild the shader bundle "
199 "with the version of impellerc that ships with the "
200 "current Flutter SDK.";
201 return shader_map;
202 }
203
204 for (const auto* bundled_shader : *bundle->shaders()) {
205 const impeller::fb::shaderbundle::BackendShader* backend_shader =
206 GetShaderBackend(backend_type, bundled_shader);
207 if (!backend_shader) {
208 VALIDATION_LOG << "Failed to unpack shader \""
209 << bundled_shader->name()->c_str() << "\" from bundle.";
210 continue;
211 }
212
213 auto code_mapping = std::make_shared<fml::NonOwnedMapping>(
214 backend_shader->shader()->data(), //
215 backend_shader->shader()->size(), //
216 [payload = payload](auto, auto) {} //
217 );
218
219 std::vector<impeller::DescriptorSetLayout> descriptor_set_layouts;
220
221 std::unordered_map<std::string, Shader::UniformBinding> uniform_structs;
222 if (backend_shader->uniform_structs() != nullptr) {
223 for (const auto& uniform : *backend_shader->uniform_structs()) {
224 std::vector<impeller::ShaderStructMemberMetadata> members;
225 if (uniform->fields() != nullptr) {
226 for (const auto& struct_member : *uniform->fields()) {
228 FromUniformType(struct_member->type());
229 members.push_back(impeller::ShaderStructMemberMetadata{
230 .type = type,
231 .name = struct_member->name()->c_str(),
232 .offset = static_cast<size_t>(struct_member->offset_in_bytes()),
233 .size =
234 static_cast<size_t>(struct_member->element_size_in_bytes()),
235 .byte_length =
236 static_cast<size_t>(struct_member->total_size_in_bytes()),
237 .array_elements =
238 struct_member->array_elements() == 0
239 ? std::optional<size_t>(std::nullopt)
240 : static_cast<size_t>(struct_member->array_elements()),
241 .float_type = impeller::DeriveShaderFloatType(
242 type, static_cast<size_t>(struct_member->vec_size()),
243 static_cast<size_t>(struct_member->columns())),
244 });
245 }
246 }
247
248 uniform_structs[uniform->name()->str()] = Shader::UniformBinding{
249 .slot =
251 .name = uniform->name()->c_str(),
252 .ext_res_0 = static_cast<size_t>(uniform->ext_res_0()),
253 .set = static_cast<size_t>(uniform->set()),
254 .binding = static_cast<size_t>(uniform->binding()),
255 },
256 .metadata =
258 .name = uniform->name()->c_str(),
259 .members = members,
260 },
261 .size_in_bytes = static_cast<size_t>(uniform->size_in_bytes()),
262 };
263
264 descriptor_set_layouts.push_back(impeller::DescriptorSetLayout{
265 static_cast<uint32_t>(uniform->binding()),
267 ToShaderStage(backend_shader->stage()),
268 });
269 }
270 }
271
272 std::unordered_map<std::string, Shader::TextureBinding> uniform_textures;
273 if (backend_shader->uniform_textures() != nullptr) {
274 for (const auto& uniform : *backend_shader->uniform_textures()) {
275 Shader::TextureBinding texture_binding;
276 texture_binding.slot = impeller::SampledImageSlot{
277 .name = uniform->name()->c_str(),
278 .texture_index = static_cast<size_t>(uniform->ext_res_0()),
279 .set = static_cast<size_t>(uniform->set()),
280 .binding = static_cast<size_t>(uniform->binding()),
281 };
282 texture_binding.metadata = impeller::ShaderMetadata{
283 .name = uniform->name()->c_str(),
284 .members = {},
285 };
286
287 uniform_textures[uniform->name()->str()] = texture_binding;
288
289 descriptor_set_layouts.push_back(impeller::DescriptorSetLayout{
290 static_cast<uint32_t>(uniform->binding()),
292 ToShaderStage(backend_shader->stage()),
293 });
294 }
295 }
296
297 std::vector<impeller::ShaderStageIOSlot> inputs;
298 std::vector<impeller::ShaderStageBufferLayout> layouts;
299 if (backend_shader->stage() ==
300 impeller::fb::shaderbundle::ShaderStage::kVertex) {
301 auto inputs_fb = backend_shader->inputs();
302
303 inputs.reserve(inputs_fb->size());
304 size_t default_stride = 0;
305 for (const auto& input : *inputs_fb) {
307 slot.name = input->name()->c_str();
308 slot.location = input->location();
309 slot.set = input->set();
310 slot.binding = input->binding();
311 slot.type = FromInputType(input->type());
312 slot.bit_width = input->bit_width();
313 slot.vec_size = input->vec_size();
314 slot.columns = input->columns();
315 slot.offset = input->offset();
316 inputs.emplace_back(slot);
317
318 default_stride +=
319 SizeOfInputType(input->type()) * slot.vec_size * slot.columns;
320 }
322 .stride = default_stride,
323 .binding = 0u,
324 }};
325 }
326
327 auto shader = flutter::gpu::Shader::Make(
328 library_id, backend_shader->entrypoint()->str(),
329 ToShaderStage(backend_shader->stage()), std::move(code_mapping),
330 std::move(inputs), std::move(layouts), std::move(uniform_structs),
331 std::move(uniform_textures), std::move(descriptor_set_layouts));
332 shader_map[bundled_shader->name()->str()] = std::move(shader);
333 }
334
335 return shader_map;
336}
static fml::RefPtr< Shader > Make(std::string library_id, std::string entrypoint, impeller::ShaderStage stage, std::shared_ptr< fml::Mapping > code_mapping, std::vector< impeller::ShaderStageIOSlot > inputs, std::vector< impeller::ShaderStageBufferLayout > layouts, std::unordered_map< std::string, UniformBinding > uniform_structs, std::unordered_map< std::string, TextureBinding > uniform_textures, std::vector< impeller::DescriptorSetLayout > descriptor_set_layouts)
Definition shader.cc:41
std::unordered_map< std::string, fml::RefPtr< Shader > > ShaderMap
static int input(yyscan_t yyscanner)
uint32_t vec_size
uint32_t columns
static const impeller::fb::shaderbundle::BackendShader * GetShaderBackend(impeller::Context::BackendType backend_type, const impeller::fb::shaderbundle::Shader *shader)
static impeller::ShaderType FromUniformType(impeller::fb::shaderbundle::UniformDataType uniform_type)
static impeller::ShaderType FromInputType(impeller::fb::shaderbundle::InputDataType input_type)
static size_t SizeOfInputType(impeller::fb::shaderbundle::InputDataType input_type)
constexpr std::optional< ShaderFloatType > DeriveShaderFloatType(ShaderType type, size_t vec_size, size_t columns)
Derive the ShaderFloatType from the base ShaderType and the (vec_size, columns) dimensions reported b...
constexpr ShaderStage ToShaderStage(RuntimeShaderStage stage)
impeller::ShaderType type
Metadata required to bind a combined texture and sampler.
const char * name
The name of the uniform slot.
Metadata required to bind a buffer.
const char * name
The name of the uniform slot.
#define VALIDATION_LOG
Definition validation.h:91

References impeller::ShaderStageIOSlot::binding, impeller::ShaderStageIOSlot::bit_width, impeller::ShaderStageIOSlot::columns, impeller::DeriveShaderFloatType(), FromInputType(), FromUniformType(), GetShaderBackend(), input(), impeller::kSampledImage, impeller::kUniformBuffer, impeller::ShaderStageIOSlot::location, flutter::gpu::Shader::Make(), flutter::gpu::Shader::TextureBinding::metadata, impeller::ShaderMetadata::name, impeller::ShaderUniformSlot::name, impeller::SampledImageSlot::name, impeller::ShaderStageIOSlot::name, impeller::ShaderStageIOSlot::offset, impeller::ShaderStageIOSlot::set, flutter::set, SizeOfInputType(), flutter::gpu::Shader::UniformBinding::slot, flutter::gpu::Shader::TextureBinding::slot, impeller::ShaderStageBufferLayout::stride, ToShaderStage(), impeller::ShaderStructMemberMetadata::type, impeller::ShaderStageIOSlot::type, type, VALIDATION_LOG, and impeller::ShaderStageIOSlot::vec_size.

Referenced by flutter::gpu::ShaderLibrary::MakeFromFlatbuffer(), and flutter::gpu::ShaderLibrary::ReloadFromFlatbuffer().

◆ SizeOfInputType()

static size_t flutter::gpu::SizeOfInputType ( impeller::fb::shaderbundle::InputDataType  input_type)
static

Definition at line 128 of file shader_library.cc.

129 {
130 switch (input_type) {
131 case impeller::fb::shaderbundle::InputDataType::kBoolean:
132 return 1;
133 case impeller::fb::shaderbundle::InputDataType::kSignedByte:
134 return 1;
135 case impeller::fb::shaderbundle::InputDataType::kUnsignedByte:
136 return 1;
137 case impeller::fb::shaderbundle::InputDataType::kSignedShort:
138 return 2;
139 case impeller::fb::shaderbundle::InputDataType::kUnsignedShort:
140 return 2;
141 case impeller::fb::shaderbundle::InputDataType::kSignedInt:
142 return 4;
143 case impeller::fb::shaderbundle::InputDataType::kUnsignedInt:
144 return 4;
145 case impeller::fb::shaderbundle::InputDataType::kSignedInt64:
146 return 8;
147 case impeller::fb::shaderbundle::InputDataType::kUnsignedInt64:
148 return 8;
149 case impeller::fb::shaderbundle::InputDataType::kFloat:
150 return 4;
151 case impeller::fb::shaderbundle::InputDataType::kDouble:
152 return 8;
153 }
154}

Referenced by ParseShaderBundle().

◆ SupportsNormalOffscreenMSAA()

bool flutter::gpu::SupportsNormalOffscreenMSAA ( const impeller::Context context)

Definition at line 21 of file context.cc.

21 {
22 auto& capabilities = context.GetCapabilities();
23 return capabilities->SupportsOffscreenMSAA() &&
24 !capabilities->SupportsImplicitResolvingMSAA();
25}

References context.

Referenced by InternalFlutterGpu_Context_GetSupportsOffscreenMSAA(), and InternalFlutterGpu_RenderPass_SetColorAttachment().

◆ ToImpellerBlendFactor() [1/2]

constexpr impeller::BlendFactor flutter::gpu::ToImpellerBlendFactor ( FlutterGPUBlendFactor  value)
constexpr

Definition at line 267 of file formats.h.

268 {
269 switch (value) {
270 case FlutterGPUBlendFactor::kZero:
272 case FlutterGPUBlendFactor::kOne:
274 case FlutterGPUBlendFactor::kSourceColor:
276 case FlutterGPUBlendFactor::kOneMinusSourceColor:
278 case FlutterGPUBlendFactor::kSourceAlpha:
280 case FlutterGPUBlendFactor::kOneMinusSourceAlpha:
282 case FlutterGPUBlendFactor::kDestinationColor:
284 case FlutterGPUBlendFactor::kOneMinusDestinationColor:
286 case FlutterGPUBlendFactor::kDestinationAlpha:
288 case FlutterGPUBlendFactor::kOneMinusDestinationAlpha:
290 case FlutterGPUBlendFactor::kSourceAlphaSaturated:
292 case FlutterGPUBlendFactor::kBlendColor:
294 case FlutterGPUBlendFactor::kOneMinusBlendColor:
296 case FlutterGPUBlendFactor::kBlendAlpha:
298 case FlutterGPUBlendFactor::kOneMinusBlendAlpha:
300 }
301}

References impeller::kBlendAlpha, kBlendAlpha, impeller::kBlendColor, kBlendColor, impeller::kDestinationAlpha, kDestinationAlpha, impeller::kDestinationColor, kDestinationColor, impeller::kOne, kOne, impeller::kOneMinusBlendAlpha, kOneMinusBlendAlpha, impeller::kOneMinusBlendColor, kOneMinusBlendColor, impeller::kOneMinusDestinationAlpha, kOneMinusDestinationAlpha, impeller::kOneMinusDestinationColor, kOneMinusDestinationColor, impeller::kOneMinusSourceAlpha, kOneMinusSourceAlpha, impeller::kOneMinusSourceColor, kOneMinusSourceColor, impeller::kSourceAlpha, kSourceAlpha, impeller::kSourceAlphaSaturated, kSourceAlphaSaturated, impeller::kSourceColor, kSourceColor, impeller::kZero, kZero, and value.

Referenced by InternalFlutterGpu_RenderPass_SetColorBlendEquation(), and ToImpellerBlendFactor().

◆ ToImpellerBlendFactor() [2/2]

constexpr impeller::BlendFactor flutter::gpu::ToImpellerBlendFactor ( int  value)
constexpr

Definition at line 303 of file formats.h.

303 {
304 return ToImpellerBlendFactor(static_cast<FlutterGPUBlendFactor>(value));
305}
constexpr impeller::BlendFactor ToImpellerBlendFactor(FlutterGPUBlendFactor value)
Definition formats.h:267
FlutterGPUBlendFactor
Definition formats.h:249

References ToImpellerBlendFactor(), and value.

◆ ToImpellerBlendOperation() [1/2]

constexpr impeller::BlendOperation flutter::gpu::ToImpellerBlendOperation ( FlutterGPUBlendOperation  value)
constexpr

Definition at line 313 of file formats.h.

314 {
315 switch (value) {
316 case FlutterGPUBlendOperation::kAdd:
318 case FlutterGPUBlendOperation::kSubtract:
320 case FlutterGPUBlendOperation::kReverseSubtract:
322 }
323}

References impeller::kAdd, kAdd, impeller::kReverseSubtract, kReverseSubtract, impeller::kSubtract, kSubtract, and value.

Referenced by InternalFlutterGpu_RenderPass_SetColorBlendEquation(), and ToImpellerBlendOperation().

◆ ToImpellerBlendOperation() [2/2]

constexpr impeller::BlendOperation flutter::gpu::ToImpellerBlendOperation ( int  value)
constexpr

Definition at line 325 of file formats.h.

325 {
326 return ToImpellerBlendOperation(static_cast<FlutterGPUBlendOperation>(value));
327}
FlutterGPUBlendOperation
Definition formats.h:307
constexpr impeller::BlendOperation ToImpellerBlendOperation(FlutterGPUBlendOperation value)
Definition formats.h:313

References ToImpellerBlendOperation(), and value.

◆ ToImpellerCompareFunction() [1/2]

constexpr impeller::CompareFunction flutter::gpu::ToImpellerCompareFunction ( FlutterGPUCompareFunction  value)
constexpr

Definition at line 527 of file formats.h.

528 {
529 switch (value) {
530 case FlutterGPUCompareFunction::kNever:
532 case FlutterGPUCompareFunction::kAlways:
534 case FlutterGPUCompareFunction::kLess:
536 case FlutterGPUCompareFunction::kEqual:
538 case FlutterGPUCompareFunction::kLessEqual:
540 case FlutterGPUCompareFunction::kGreater:
542 case FlutterGPUCompareFunction::kNotEqual:
544 case FlutterGPUCompareFunction::kGreaterEqual:
546 }
547}
@ kEqual
Comparison test passes if new_value == current_value.
@ kNotEqual
Comparison test passes if new_value != current_value.

References impeller::kAlways, kAlways, impeller::kEqual, kEqual, impeller::kGreater, kGreater, impeller::kGreaterEqual, kGreaterEqual, impeller::kLess, kLess, impeller::kLessEqual, kLessEqual, impeller::kNever, kNever, impeller::kNotEqual, kNotEqual, and value.

Referenced by InternalFlutterGpu_RenderPass_SetDepthCompareOperation(), InternalFlutterGpu_RenderPass_SetStencilConfig(), and ToImpellerCompareFunction().

◆ ToImpellerCompareFunction() [2/2]

constexpr impeller::CompareFunction flutter::gpu::ToImpellerCompareFunction ( int  value)
constexpr

Definition at line 549 of file formats.h.

549 {
551 static_cast<FlutterGPUCompareFunction>(value));
552}
FlutterGPUCompareFunction
Definition formats.h:516
constexpr impeller::CompareFunction ToImpellerCompareFunction(FlutterGPUCompareFunction value)
Definition formats.h:527

References ToImpellerCompareFunction(), and value.

◆ ToImpellerCompressedTextureFamily() [1/2]

constexpr impeller::CompressedTextureFamily flutter::gpu::ToImpellerCompressedTextureFamily ( FlutterGPUTextureCompressionFamily  value)
constexpr

Definition at line 84 of file formats.h.

85 {
86 switch (value) {
87 case FlutterGPUTextureCompressionFamily::kBC:
89 case FlutterGPUTextureCompressionFamily::kETC2:
91 case FlutterGPUTextureCompressionFamily::kASTC:
93 case FlutterGPUTextureCompressionFamily::kASTCHDR:
95 }
96}

References impeller::kASTC, kASTC, impeller::kASTCHDR, kASTCHDR, impeller::kBC, kBC, impeller::kETC2, kETC2, and value.

Referenced by InternalFlutterGpu_Context_SupportsTextureCompression(), and ToImpellerCompressedTextureFamily().

◆ ToImpellerCompressedTextureFamily() [2/2]

constexpr impeller::CompressedTextureFamily flutter::gpu::ToImpellerCompressedTextureFamily ( int  value)
constexpr

Definition at line 98 of file formats.h.

99 {
101 static_cast<FlutterGPUTextureCompressionFamily>(value));
102}
FlutterGPUTextureCompressionFamily
Definition formats.h:77
constexpr impeller::CompressedTextureFamily ToImpellerCompressedTextureFamily(FlutterGPUTextureCompressionFamily value)
Definition formats.h:84

References ToImpellerCompressedTextureFamily(), and value.

◆ ToImpellerCullMode() [1/2]

constexpr impeller::CullMode flutter::gpu::ToImpellerCullMode ( FlutterGPUCullMode  value)
constexpr

Definition at line 598 of file formats.h.

598 {
599 switch (value) {
600 case FlutterGPUCullMode::kNone:
602 case FlutterGPUCullMode::kFrontFace:
604 case FlutterGPUCullMode::kBackFace:
606 }
607}

References impeller::kBackFace, kBackFace, impeller::kFrontFace, kFrontFace, impeller::kNone, kNone, and value.

Referenced by InternalFlutterGpu_RenderPass_SetCullMode(), and ToImpellerCullMode().

◆ ToImpellerCullMode() [2/2]

constexpr impeller::CullMode flutter::gpu::ToImpellerCullMode ( int  value)
constexpr

Definition at line 609 of file formats.h.

609 {
610 return ToImpellerCullMode(static_cast<FlutterGPUCullMode>(value));
611}
constexpr impeller::CullMode ToImpellerCullMode(FlutterGPUCullMode value)
Definition formats.h:598

References ToImpellerCullMode(), and value.

◆ ToImpellerIndexType() [1/2]

constexpr impeller::IndexType flutter::gpu::ToImpellerIndexType ( FlutterGPUIndexType  value)
constexpr

Definition at line 475 of file formats.h.

475 {
476 switch (value) {
477 case FlutterGPUIndexType::k16bit:
479 case FlutterGPUIndexType::k32bit:
481 }
482}

References impeller::k16bit, k16bit, impeller::k32bit, k32bit, and value.

Referenced by BindIndexBuffer(), and ToImpellerIndexType().

◆ ToImpellerIndexType() [2/2]

constexpr impeller::IndexType flutter::gpu::ToImpellerIndexType ( int  value)
constexpr

Definition at line 484 of file formats.h.

484 {
485 return ToImpellerIndexType(static_cast<FlutterGPUIndexType>(value));
486}
constexpr impeller::IndexType ToImpellerIndexType(FlutterGPUIndexType value)
Definition formats.h:475

References ToImpellerIndexType(), and value.

◆ ToImpellerLoadAction() [1/2]

constexpr impeller::LoadAction flutter::gpu::ToImpellerLoadAction ( FlutterGPULoadAction  value)
constexpr

Definition at line 335 of file formats.h.

336 {
337 switch (value) {
338 case FlutterGPULoadAction::kDontCare:
340 case FlutterGPULoadAction::kLoad:
342 case FlutterGPULoadAction::kClear:
344 }
345}

References impeller::kClear, kClear, impeller::kDontCare, kDontCare, impeller::kLoad, kLoad, and value.

Referenced by InternalFlutterGpu_RenderPass_SetColorAttachment(), InternalFlutterGpu_RenderPass_SetDepthStencilAttachment(), and ToImpellerLoadAction().

◆ ToImpellerLoadAction() [2/2]

constexpr impeller::LoadAction flutter::gpu::ToImpellerLoadAction ( int  value)
constexpr

Definition at line 347 of file formats.h.

347 {
348 return ToImpellerLoadAction(static_cast<FlutterGPULoadAction>(value));
349}
constexpr impeller::LoadAction ToImpellerLoadAction(FlutterGPULoadAction value)
Definition formats.h:335

References ToImpellerLoadAction(), and value.

◆ ToImpellerMinMagFilter() [1/2]

constexpr impeller::MinMagFilter flutter::gpu::ToImpellerMinMagFilter ( FlutterGPUMinMagFilter  value)
constexpr

Definition at line 415 of file formats.h.

416 {
417 switch (value) {
418 case FlutterGPUMinMagFilter::kNearest:
420 case FlutterGPUMinMagFilter::kLinear:
422 }
423}
@ kNearest
Select nearest to the sample point. Most widely supported.

References impeller::kLinear, kLinear, impeller::kNearest, kNearest, and value.

Referenced by InternalFlutterGpu_RenderPass_BindTexture(), and ToImpellerMinMagFilter().

◆ ToImpellerMinMagFilter() [2/2]

constexpr impeller::MinMagFilter flutter::gpu::ToImpellerMinMagFilter ( int  value)
constexpr

Definition at line 425 of file formats.h.

425 {
426 return ToImpellerMinMagFilter(static_cast<FlutterGPUMinMagFilter>(value));
427}
FlutterGPUMinMagFilter
Definition formats.h:410
constexpr impeller::MinMagFilter ToImpellerMinMagFilter(FlutterGPUMinMagFilter value)
Definition formats.h:415

References ToImpellerMinMagFilter(), and value.

◆ ToImpellerMipFilter() [1/2]

constexpr impeller::MipFilter flutter::gpu::ToImpellerMipFilter ( FlutterGPUMipFilter  value)
constexpr

Definition at line 434 of file formats.h.

434 {
435 switch (value) {
436 case FlutterGPUMipFilter::kNearest:
438 case FlutterGPUMipFilter::kLinear:
440 }
441}
@ kLinear
Sample from the two nearest mip levels and linearly interpolate.
@ kNearest
The nearst mipmap level is selected.

References impeller::kLinear, kLinear, impeller::kNearest, kNearest, and value.

Referenced by InternalFlutterGpu_RenderPass_BindTexture(), and ToImpellerMipFilter().

◆ ToImpellerMipFilter() [2/2]

constexpr impeller::MipFilter flutter::gpu::ToImpellerMipFilter ( int  value)
constexpr

Definition at line 443 of file formats.h.

443 {
444 return ToImpellerMipFilter(static_cast<FlutterGPUMipFilter>(value));
445}
constexpr impeller::MipFilter ToImpellerMipFilter(FlutterGPUMipFilter value)
Definition formats.h:434

References ToImpellerMipFilter(), and value.

◆ ToImpellerPixelFormat() [1/2]

constexpr impeller::PixelFormat flutter::gpu::ToImpellerPixelFormat ( FlutterGPUPixelFormat  value)
constexpr

Definition at line 104 of file formats.h.

105 {
106 switch (value) {
107 case FlutterGPUPixelFormat::kUnknown:
109 case FlutterGPUPixelFormat::kA8UNormInt:
111 case FlutterGPUPixelFormat::kR8UNormInt:
113 case FlutterGPUPixelFormat::kR8G8UNormInt:
115 case FlutterGPUPixelFormat::kR8G8B8A8UNormInt:
117 case FlutterGPUPixelFormat::kR8G8B8A8UNormIntSRGB:
119 case FlutterGPUPixelFormat::kB8G8R8A8UNormInt:
121 case FlutterGPUPixelFormat::kB8G8R8A8UNormIntSRGB:
123 case FlutterGPUPixelFormat::kR32G32B32A32Float:
125 case FlutterGPUPixelFormat::kR16G16B16A16Float:
127 case FlutterGPUPixelFormat::kR32Float:
129 case FlutterGPUPixelFormat::kS8UInt:
131 case FlutterGPUPixelFormat::kD24UnormS8Uint:
133 case FlutterGPUPixelFormat::kD32FloatS8UInt:
135 case FlutterGPUPixelFormat::kBC1RGBAUNormInt:
137 case FlutterGPUPixelFormat::kBC1RGBAUNormIntSRGB:
139 case FlutterGPUPixelFormat::kBC3RGBAUNormInt:
141 case FlutterGPUPixelFormat::kBC3RGBAUNormIntSRGB:
143 case FlutterGPUPixelFormat::kBC5RGUNormInt:
145 case FlutterGPUPixelFormat::kBC7RGBAUNormInt:
147 case FlutterGPUPixelFormat::kBC7RGBAUNormIntSRGB:
149 case FlutterGPUPixelFormat::kETC2RGB8UNormInt:
151 case FlutterGPUPixelFormat::kETC2RGB8UNormIntSRGB:
153 case FlutterGPUPixelFormat::kETC2RGBA8UNormInt:
155 case FlutterGPUPixelFormat::kETC2RGBA8UNormIntSRGB:
157 case FlutterGPUPixelFormat::kASTC4x4LDR:
159 case FlutterGPUPixelFormat::kASTC4x4LDRSRGB:
161 case FlutterGPUPixelFormat::kASTC8x8LDR:
163 case FlutterGPUPixelFormat::kASTC8x8LDRSRGB:
165 case FlutterGPUPixelFormat::kASTC4x4HDR:
167 case FlutterGPUPixelFormat::kASTC8x8HDR:
169 }
170}

References impeller::kA8UNormInt, kA8UNormInt, impeller::kASTC4x4HDR, kASTC4x4HDR, impeller::kASTC4x4LDR, kASTC4x4LDR, impeller::kASTC4x4LDRSRGB, kASTC4x4LDRSRGB, impeller::kASTC8x8HDR, kASTC8x8HDR, impeller::kASTC8x8LDR, kASTC8x8LDR, impeller::kASTC8x8LDRSRGB, kASTC8x8LDRSRGB, impeller::kB8G8R8A8UNormInt, kB8G8R8A8UNormInt, impeller::kB8G8R8A8UNormIntSRGB, kB8G8R8A8UNormIntSRGB, impeller::kBC1RGBAUNormInt, kBC1RGBAUNormInt, impeller::kBC1RGBAUNormIntSRGB, kBC1RGBAUNormIntSRGB, impeller::kBC3RGBAUNormInt, kBC3RGBAUNormInt, impeller::kBC3RGBAUNormIntSRGB, kBC3RGBAUNormIntSRGB, impeller::kBC5RGUNormInt, kBC5RGUNormInt, impeller::kBC7RGBAUNormInt, kBC7RGBAUNormInt, impeller::kBC7RGBAUNormIntSRGB, kBC7RGBAUNormIntSRGB, impeller::kD24UnormS8Uint, kD24UnormS8Uint, impeller::kD32FloatS8UInt, kD32FloatS8UInt, impeller::kETC2RGB8UNormInt, kETC2RGB8UNormInt, impeller::kETC2RGB8UNormIntSRGB, kETC2RGB8UNormIntSRGB, impeller::kETC2RGBA8UNormInt, kETC2RGBA8UNormInt, impeller::kETC2RGBA8UNormIntSRGB, kETC2RGBA8UNormIntSRGB, impeller::kR16G16B16A16Float, kR16G16B16A16Float, impeller::kR32Float, kR32Float, impeller::kR32G32B32A32Float, kR32G32B32A32Float, impeller::kR8G8B8A8UNormInt, kR8G8B8A8UNormInt, impeller::kR8G8B8A8UNormIntSRGB, kR8G8B8A8UNormIntSRGB, impeller::kR8G8UNormInt, kR8G8UNormInt, impeller::kR8UNormInt, kR8UNormInt, impeller::kS8UInt, kS8UInt, impeller::kUnknown, kUnknown, and value.

Referenced by InternalFlutterGpu_Context_SupportsTextureFormat(), InternalFlutterGpu_Surface_Initialize(), InternalFlutterGpu_Texture_Initialize(), and ToImpellerPixelFormat().

◆ ToImpellerPixelFormat() [2/2]

constexpr impeller::PixelFormat flutter::gpu::ToImpellerPixelFormat ( int  value)
constexpr

Definition at line 172 of file formats.h.

172 {
173 return ToImpellerPixelFormat(static_cast<FlutterGPUPixelFormat>(value));
174}
FlutterGPUPixelFormat
Definition formats.h:41
constexpr impeller::PixelFormat ToImpellerPixelFormat(FlutterGPUPixelFormat value)
Definition formats.h:104

References ToImpellerPixelFormat(), and value.

◆ ToImpellerPolygonMode() [1/2]

constexpr impeller::PolygonMode flutter::gpu::ToImpellerPolygonMode ( FlutterGPUPolygonMode  value)
constexpr

Definition at line 637 of file formats.h.

638 {
639 switch (value) {
640 case FlutterGPUPolygonMode::kFill:
642 case FlutterGPUPolygonMode::kLine:
644 }
645}

References impeller::kFill, kFill, impeller::kLine, kLine, and value.

Referenced by InternalFlutterGpu_RenderPass_SetPolygonMode(), and ToImpellerPolygonMode().

◆ ToImpellerPolygonMode() [2/2]

constexpr impeller::PolygonMode flutter::gpu::ToImpellerPolygonMode ( int  value)
constexpr

Definition at line 647 of file formats.h.

647 {
648 return ToImpellerPolygonMode(static_cast<FlutterGPUPolygonMode>(value));
649}
FlutterGPUPolygonMode
Definition formats.h:632
constexpr impeller::PolygonMode ToImpellerPolygonMode(FlutterGPUPolygonMode value)
Definition formats.h:637

References ToImpellerPolygonMode(), and value.

◆ ToImpellerPrimitiveType() [1/2]

constexpr impeller::PrimitiveType flutter::gpu::ToImpellerPrimitiveType ( FlutterGPUPrimitiveType  value)
constexpr

Definition at line 496 of file formats.h.

497 {
498 switch (value) {
499 case FlutterGPUPrimitiveType::kTriangle:
501 case FlutterGPUPrimitiveType::kTriangleStrip:
503 case FlutterGPUPrimitiveType::kLine:
505 case FlutterGPUPrimitiveType::kLineStrip:
507 case FlutterGPUPrimitiveType::kPoint:
509 }
510}

References impeller::kLine, kLine, impeller::kLineStrip, kLineStrip, impeller::kPoint, kPoint, impeller::kTriangle, kTriangle, impeller::kTriangleStrip, kTriangleStrip, and value.

Referenced by InternalFlutterGpu_RenderPass_SetPrimitiveType(), and ToImpellerPrimitiveType().

◆ ToImpellerPrimitiveType() [2/2]

constexpr impeller::PrimitiveType flutter::gpu::ToImpellerPrimitiveType ( int  value)
constexpr

Definition at line 512 of file formats.h.

512 {
513 return ToImpellerPrimitiveType(static_cast<FlutterGPUPrimitiveType>(value));
514}
FlutterGPUPrimitiveType
Definition formats.h:488
constexpr impeller::PrimitiveType ToImpellerPrimitiveType(FlutterGPUPrimitiveType value)
Definition formats.h:496

References ToImpellerPrimitiveType(), and value.

◆ ToImpellerSamplerAddressMode() [1/2]

constexpr impeller::SamplerAddressMode flutter::gpu::ToImpellerSamplerAddressMode ( FlutterGPUSamplerAddressMode  value)
constexpr

Definition at line 453 of file formats.h.

454 {
455 switch (value) {
456 case FlutterGPUSamplerAddressMode::kClampToEdge:
458 case FlutterGPUSamplerAddressMode::kRepeat:
460 case FlutterGPUSamplerAddressMode::kMirror:
462 }
463}

References impeller::kClampToEdge, kClampToEdge, impeller::kMirror, kMirror, impeller::kRepeat, kRepeat, and value.

Referenced by InternalFlutterGpu_RenderPass_BindTexture(), and ToImpellerSamplerAddressMode().

◆ ToImpellerSamplerAddressMode() [2/2]

constexpr impeller::SamplerAddressMode flutter::gpu::ToImpellerSamplerAddressMode ( int  value)
constexpr

Definition at line 465 of file formats.h.

465 {
467 static_cast<FlutterGPUSamplerAddressMode>(value));
468}
constexpr impeller::SamplerAddressMode ToImpellerSamplerAddressMode(FlutterGPUSamplerAddressMode value)
Definition formats.h:453
FlutterGPUSamplerAddressMode
Definition formats.h:447

References ToImpellerSamplerAddressMode(), and value.

◆ ToImpellerShaderStage() [1/2]

constexpr impeller::ShaderStage flutter::gpu::ToImpellerShaderStage ( FlutterGPUShaderStage  value)
constexpr

Definition at line 381 of file formats.h.

382 {
383 switch (value) {
384 case FlutterGPUShaderStage::kVertex:
386 case FlutterGPUShaderStage::kFragment:
388 }
389}

References impeller::kFragment, kFragment, impeller::kVertex, kVertex, and value.

Referenced by ToImpellerShaderStage().

◆ ToImpellerShaderStage() [2/2]

constexpr impeller::ShaderStage flutter::gpu::ToImpellerShaderStage ( int  value)
constexpr

Definition at line 391 of file formats.h.

391 {
392 return ToImpellerShaderStage(static_cast<FlutterGPUShaderStage>(value));
393}
FlutterGPUShaderStage
Definition formats.h:376
constexpr impeller::ShaderStage ToImpellerShaderStage(FlutterGPUShaderStage value)
Definition formats.h:381

References ToImpellerShaderStage(), and value.

◆ ToImpellerStencilOperation() [1/2]

constexpr impeller::StencilOperation flutter::gpu::ToImpellerStencilOperation ( FlutterGPUStencilOperation  value)
constexpr

Definition at line 565 of file formats.h.

566 {
567 switch (value) {
568 case FlutterGPUStencilOperation::kKeep:
570 case FlutterGPUStencilOperation::kZero:
572 case FlutterGPUStencilOperation::kSetToReferenceValue:
574 case FlutterGPUStencilOperation::kIncrementClamp:
576 case FlutterGPUStencilOperation::kDecrementClamp:
578 case FlutterGPUStencilOperation::kInvert:
580 case FlutterGPUStencilOperation::kIncrementWrap:
582 case FlutterGPUStencilOperation::kDecrementWrap:
584 }
585}
@ kZero
Reset the stencil value to zero.

References impeller::kDecrementClamp, kDecrementClamp, impeller::kDecrementWrap, kDecrementWrap, impeller::kIncrementClamp, kIncrementClamp, impeller::kIncrementWrap, kIncrementWrap, impeller::kInvert, kInvert, impeller::kKeep, kKeep, impeller::kSetToReferenceValue, kSetToReferenceValue, impeller::kZero, kZero, and value.

Referenced by InternalFlutterGpu_RenderPass_SetStencilConfig(), and ToImpellerStencilOperation().

◆ ToImpellerStencilOperation() [2/2]

constexpr impeller::StencilOperation flutter::gpu::ToImpellerStencilOperation ( int  value)
constexpr

Definition at line 587 of file formats.h.

587 {
589 static_cast<FlutterGPUStencilOperation>(value));
590}
FlutterGPUStencilOperation
Definition formats.h:554
constexpr impeller::StencilOperation ToImpellerStencilOperation(FlutterGPUStencilOperation value)
Definition formats.h:565

References ToImpellerStencilOperation(), and value.

◆ ToImpellerStorageMode() [1/2]

constexpr impeller::StorageMode flutter::gpu::ToImpellerStorageMode ( FlutterGPUStorageMode  value)
constexpr

Definition at line 25 of file formats.h.

26 {
27 switch (value) {
28 case FlutterGPUStorageMode::kHostVisible:
30 case FlutterGPUStorageMode::kDevicePrivate:
32 case FlutterGPUStorageMode::kDeviceTransient:
34 }
35}

References impeller::kDevicePrivate, kDevicePrivate, impeller::kDeviceTransient, kDeviceTransient, impeller::kHostVisible, kHostVisible, and value.

Referenced by InternalFlutterGpu_DeviceBuffer_Initialize(), InternalFlutterGpu_Texture_Initialize(), and ToImpellerStorageMode().

◆ ToImpellerStorageMode() [2/2]

constexpr impeller::StorageMode flutter::gpu::ToImpellerStorageMode ( int  value)
constexpr

Definition at line 37 of file formats.h.

37 {
38 return ToImpellerStorageMode(static_cast<FlutterGPUStorageMode>(value));
39}
FlutterGPUStorageMode
Definition formats.h:19
constexpr impeller::StorageMode ToImpellerStorageMode(FlutterGPUStorageMode value)
Definition formats.h:25

References ToImpellerStorageMode(), and value.

◆ ToImpellerStoreAction() [1/2]

constexpr impeller::StoreAction flutter::gpu::ToImpellerStoreAction ( FlutterGPUStoreAction  value)
constexpr

Definition at line 358 of file formats.h.

359 {
360 switch (value) {
361 case FlutterGPUStoreAction::kDontCare:
363 case FlutterGPUStoreAction::kStore:
365 case FlutterGPUStoreAction::kMultisampleResolve:
367 case FlutterGPUStoreAction::kStoreAndMultisampleResolve:
369 }
370}

References impeller::kDontCare, kDontCare, impeller::kMultisampleResolve, kMultisampleResolve, impeller::kStore, kStore, impeller::kStoreAndMultisampleResolve, kStoreAndMultisampleResolve, and value.

Referenced by InternalFlutterGpu_RenderPass_SetColorAttachment(), InternalFlutterGpu_RenderPass_SetDepthStencilAttachment(), and ToImpellerStoreAction().

◆ ToImpellerStoreAction() [2/2]

constexpr impeller::StoreAction flutter::gpu::ToImpellerStoreAction ( int  value)
constexpr

Definition at line 372 of file formats.h.

372 {
373 return ToImpellerStoreAction(static_cast<FlutterGPUStoreAction>(value));
374}
constexpr impeller::StoreAction ToImpellerStoreAction(FlutterGPUStoreAction value)
Definition formats.h:358
FlutterGPUStoreAction
Definition formats.h:351

References ToImpellerStoreAction(), and value.

◆ ToImpellerWindingOrder() [1/2]

constexpr impeller::WindingOrder flutter::gpu::ToImpellerWindingOrder ( FlutterGPUWindingOrder  value)
constexpr

Definition at line 618 of file formats.h.

619 {
620 switch (value) {
621 case FlutterGPUWindingOrder::kClockwise:
623 case FlutterGPUWindingOrder::kCounterClockwise:
625 }
626}

References impeller::kClockwise, kClockwise, impeller::kCounterClockwise, kCounterClockwise, and value.

Referenced by InternalFlutterGpu_RenderPass_SetWindingOrder(), and ToImpellerWindingOrder().

◆ ToImpellerWindingOrder() [2/2]

constexpr impeller::WindingOrder flutter::gpu::ToImpellerWindingOrder ( int  value)
constexpr

Definition at line 628 of file formats.h.

628 {
629 return ToImpellerWindingOrder(static_cast<FlutterGPUWindingOrder>(value));
630}
FlutterGPUWindingOrder
Definition formats.h:613
constexpr impeller::WindingOrder ToImpellerWindingOrder(FlutterGPUWindingOrder value)
Definition formats.h:618

References ToImpellerWindingOrder(), and value.

◆ ToShaderStage()

static impeller::ShaderStage flutter::gpu::ToShaderStage ( impeller::fb::shaderbundle::ShaderStage  stage)
static

Definition at line 55 of file shader_library.cc.

56 {
57 switch (stage) {
58 case impeller::fb::shaderbundle::ShaderStage::kVertex:
60 case impeller::fb::shaderbundle::ShaderStage::kFragment:
62 case impeller::fb::shaderbundle::ShaderStage::kCompute:
64 }
66}

References FML_UNREACHABLE, impeller::kCompute, impeller::kFragment, and impeller::kVertex.

Referenced by ParseShaderBundle().