| Flutter Impeller |

Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
impeller::compiler::StructMember Struct Reference

`#include <reflector.h>`

## Public Types
enum | UnderlyingType { UnderlyingType::kPadding, UnderlyingType::kFloat, UnderlyingType::kOther }

## Public Member Functions
| StructMember (std::string p_type, spirv_cross::SPIRType::BaseType p_base_type, std::string p_name, size_t p_offset, size_t p_size, size_t p_byte_length, std::optional< size_t > p_array_elements, size_t p_element_padding, UnderlyingType p_underlying_type=UnderlyingType::kOther)

## Static Public Member Functions
static std::string | BaseTypeToString (spirv_cross::SPIRType::BaseType type)
static UnderlyingType | DetermineUnderlyingType (spirv_cross::SPIRType::BaseType type)

## Public Attributes
std::string | type
spirv_cross::SPIRType::BaseType | base_type
std::string | name
size_t | offset = 0u
size_t | size = 0u
size_t | byte_length = 0u
std::optional< size_t > | array_elements = std::nullopt
size_t | element_padding = 0u
UnderlyingType | underlying_type = UnderlyingType::kOther

## Detailed Description

Definition at line 27 of file reflector.h.

## Member Enumeration Documentation

## ◆ UnderlyingType

enum impeller::compiler::StructMember::UnderlyingType
| strong

Enumerator
kPadding |
kFloat |
kOther |

Definition at line 30 of file reflector.h.

30 {
31 kPadding,
32 kFloat,
33 kOther,
34 };

## Constructor & Destructor Documentation

## ◆ StructMember()

impeller::compiler::StructMember::StructMember | ( | std::string | p_type,
|  | spirv_cross::SPIRType::BaseType | p_base_type,
|  | std::string | p_name,
|  | size_t | p_offset,
|  | size_t | p_size,
|  | size_t | p_byte_length,
|  | std::optional< size_t > | p_array_elements,
|  | size_t | p_element_padding,
|  | UnderlyingType | p_underlying_type = `UnderlyingType::kOther`
| ) |  |
| inline

Definition at line 126 of file reflector.h.

135 : type(std::move(p_type)),
136 base_type(p_base_type),
137 name(std::move(p_name)),
138 offset(p_offset),
139 size(p_size),
140 byte_length(p_byte_length),
141 array_elements(p_array_elements),
142 element_padding(p_element_padding),
143 underlying_type(DetermineUnderlyingType(p_base_type)) {}

## Member Function Documentation

## ◆ BaseTypeToString()

static std::string impeller::compiler::StructMember::BaseTypeToString | ( | spirv_cross::SPIRType::BaseType | type | ) |
| inline static

Definition at line 46 of file reflector.h.

46 {
47 using Type = spirv_cross::SPIRType::BaseType;
48 switch (type) {
49 case Type::Void:
50 return "ShaderType::kVoid";
51 case Type::Boolean:
52 return "ShaderType::kBoolean";
53 case Type::SByte:
54 return "ShaderType::kSignedByte";
55 case Type::UByte:
56 return "ShaderType::kUnsignedByte";
57 case Type::Short:
58 return "ShaderType::kSignedShort";
59 case Type::UShort:
60 return "ShaderType::kUnsignedShort";
61 case Type::Int:
62 return "ShaderType::kSignedInt";
63 case Type::UInt:
64 return "ShaderType::kUnsignedInt";
65 case Type::Int64:
66 return "ShaderType::kSignedInt64";
67 case Type::UInt64:
68 return "ShaderType::kUnsignedInt64";
69 case Type::AtomicCounter:
70 return "ShaderType::kAtomicCounter";
71 case Type::Half:
72 return "ShaderType::kHalfFloat";
73 case Type::Float:
74 return "ShaderType::kFloat";
75 case Type::Double:
76 return "ShaderType::kDouble";
77 case Type::Struct:
78 return "ShaderType::kStruct";
79 case Type::Image:
80 return "ShaderType::kImage";
81 case Type::SampledImage:
82 return "ShaderType::kSampledImage";
83 case Type::Sampler:
84 return "ShaderType::kSampler";
85 default:
86 return "ShaderType::kUnknown";
87 }
88 FML_UNREACHABLE();
89 }

References type.

## ◆ DetermineUnderlyingType()

static UnderlyingType impeller::compiler::StructMember::DetermineUnderlyingType | ( | spirv_cross::SPIRType::BaseType | type | ) |
| inline static

Definition at line 91 of file reflector.h.

92 {
93 switch (type) {
94 case spirv_cross::SPIRType::Void:
95 return UnderlyingType::kPadding;
96 case spirv_cross::SPIRType::Float:
97 return UnderlyingType::kFloat;
98 case spirv_cross::SPIRType::Unknown:
99 case spirv_cross::SPIRType::Boolean:
100 case spirv_cross::SPIRType::SByte:
101 case spirv_cross::SPIRType::UByte:
102 case spirv_cross::SPIRType::Short:
103 case spirv_cross::SPIRType::UShort:
104 case spirv_cross::SPIRType::Int:
105 case spirv_cross::SPIRType::UInt:
106 case spirv_cross::SPIRType::Int64:
107 case spirv_cross::SPIRType::UInt64:
108 case spirv_cross::SPIRType::AtomicCounter:
109 case spirv_cross::SPIRType::Half:
110 case spirv_cross::SPIRType::Double:
111 case spirv_cross::SPIRType::Struct:
112 case spirv_cross::SPIRType::Image:
113 case spirv_cross::SPIRType::SampledImage:
114 case spirv_cross::SPIRType::Sampler:
115 case spirv_cross::SPIRType::AccelerationStructure:
116 case spirv_cross::SPIRType::RayQuery:
117 case spirv_cross::SPIRType::ControlPointArray:
118 case spirv_cross::SPIRType::Interpolant:
119 case spirv_cross::SPIRType::Char:
120 default:
121 return UnderlyingType::kOther;
122 }
123 FML_UNREACHABLE();
124 }

References kFloat, kOther, kPadding, and type.

## Member Data Documentation

## ◆ array_elements

std::optional<size_t> impeller::compiler::StructMember::array_elements = std::nullopt

Definition at line 42 of file reflector.h.

## ◆ base_type

spirv_cross::SPIRType::BaseType impeller::compiler::StructMember::base_type

Definition at line 37 of file reflector.h.

## ◆ byte_length

size_t impeller::compiler::StructMember::byte_length = 0u

Definition at line 41 of file reflector.h.

## ◆ element_padding

size_t impeller::compiler::StructMember::element_padding = 0u

Definition at line 43 of file reflector.h.

## ◆ name

std::string impeller::compiler::StructMember::name

Definition at line 38 of file reflector.h.

## ◆ offset

size_t impeller::compiler::StructMember::offset = 0u

Definition at line 39 of file reflector.h.

## ◆ size

size_t impeller::compiler::StructMember::size = 0u

Definition at line 40 of file reflector.h.

## ◆ type

std::string impeller::compiler::StructMember::type

Definition at line 36 of file reflector.h.

Referenced by BaseTypeToString(), and DetermineUnderlyingType().

## ◆ underlying_type

UnderlyingType impeller::compiler::StructMember::underlying_type = UnderlyingType::kOther

Definition at line 44 of file reflector.h.

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

- impeller/compiler/reflector.h

impeller::kFloat
@ kFloat
Definition: runtime_types.h:23
impeller::compiler::StructMember::offset
size_t offset
Definition: reflector.h:39
impeller::compiler::StructMember::type
std::string type
Definition: reflector.h:36
impeller::compiler::StructMember::array_elements
std::optional< size_t > array_elements
Definition: reflector.h:42
impeller::compiler::StructMember::byte_length
size_t byte_length
Definition: reflector.h:41
impeller::compiler::StructMember::UnderlyingType::kFloat
@ kFloat
impeller::compiler::StructMember::UnderlyingType::kOther
@ kOther
impeller::compiler::StructMember::UnderlyingType::kPadding
@ kPadding
impeller::compiler::StructMember::underlying_type
UnderlyingType underlying_type
Definition: reflector.h:44
impeller::kPadding
constexpr auto kPadding
Definition: typographer_context_skia.cc:30
impeller::compiler::StructMember::element_padding
size_t element_padding
Definition: reflector.h:43
impeller::compiler::StructMember::base_type
spirv_cross::SPIRType::BaseType base_type
Definition: reflector.h:37
impeller::compiler::StructMember::size
size_t size
Definition: reflector.h:40
impeller::compiler::StructMember::name
std::string name
Definition: reflector.h:38
impeller::compiler::StructMember::DetermineUnderlyingType
static UnderlyingType DetermineUnderlyingType(spirv_cross::SPIRType::BaseType type)
Definition: reflector.h:91