Flutter Engine
The Flutter Engine
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 class  UnderlyingType { kPadding , kFloat , 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 25 of file reflector.h.

Member Enumeration Documentation

◆ UnderlyingType

Enumerator
kPadding 
kFloat 
kOther 

Definition at line 28 of file reflector.h.

28 {
30 kFloat,
31 kOther,
32 };
constexpr auto kPadding

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 124 of file reflector.h.

133 : type(std::move(p_type)),
134 base_type(p_base_type),
135 name(std::move(p_name)),
136 offset(p_offset),
137 size(p_size),
138 byte_length(p_byte_length),
139 array_elements(p_array_elements),
140 element_padding(p_element_padding),
UnderlyingType underlying_type
Definition: reflector.h:42
std::optional< size_t > array_elements
Definition: reflector.h:40
static UnderlyingType DetermineUnderlyingType(spirv_cross::SPIRType::BaseType type)
Definition: reflector.h:89
spirv_cross::SPIRType::BaseType base_type
Definition: reflector.h:35

Member Function Documentation

◆ BaseTypeToString()

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

Definition at line 44 of file reflector.h.

44 {
45 using Type = spirv_cross::SPIRType::BaseType;
46 switch (type) {
47 case Type::Void:
48 return "ShaderType::kVoid";
49 case Type::Boolean:
50 return "ShaderType::kBoolean";
51 case Type::SByte:
52 return "ShaderType::kSignedByte";
53 case Type::UByte:
54 return "ShaderType::kUnsignedByte";
55 case Type::Short:
56 return "ShaderType::kSignedShort";
57 case Type::UShort:
58 return "ShaderType::kUnsignedShort";
59 case Type::Int:
60 return "ShaderType::kSignedInt";
61 case Type::UInt:
62 return "ShaderType::kUnsignedInt";
63 case Type::Int64:
64 return "ShaderType::kSignedInt64";
65 case Type::UInt64:
66 return "ShaderType::kUnsignedInt64";
67 case Type::AtomicCounter:
68 return "ShaderType::kAtomicCounter";
69 case Type::Half:
70 return "ShaderType::kHalfFloat";
71 case Type::Float:
72 return "ShaderType::kFloat";
73 case Type::Double:
74 return "ShaderType::kDouble";
75 case Type::Struct:
76 return "ShaderType::kStruct";
77 case Type::Image:
78 return "ShaderType::kImage";
79 case Type::SampledImage:
80 return "ShaderType::kSampledImage";
81 case Type::Sampler:
82 return "ShaderType::kSampler";
83 default:
84 return "ShaderType::kUnknown";
85 }
87 }
#define FML_UNREACHABLE()
Definition: logging.h:109
std::function< ProfileSample(void)> Sampler
Sampler is run during SamplingProfiler::SampleRepeatedly. Each platform should implement its version ...
CanvasImage Image
Definition: dart_ui.cc:55

◆ DetermineUnderlyingType()

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

Definition at line 89 of file reflector.h.

90 {
91 switch (type) {
92 case spirv_cross::SPIRType::Void:
94 case spirv_cross::SPIRType::Float:
96 case spirv_cross::SPIRType::Unknown:
97 case spirv_cross::SPIRType::Boolean:
98 case spirv_cross::SPIRType::SByte:
99 case spirv_cross::SPIRType::UByte:
100 case spirv_cross::SPIRType::Short:
101 case spirv_cross::SPIRType::UShort:
102 case spirv_cross::SPIRType::Int:
103 case spirv_cross::SPIRType::UInt:
104 case spirv_cross::SPIRType::Int64:
105 case spirv_cross::SPIRType::UInt64:
106 case spirv_cross::SPIRType::AtomicCounter:
107 case spirv_cross::SPIRType::Half:
108 case spirv_cross::SPIRType::Double:
109 case spirv_cross::SPIRType::Struct:
111 case spirv_cross::SPIRType::SampledImage:
113 case spirv_cross::SPIRType::AccelerationStructure:
114 case spirv_cross::SPIRType::RayQuery:
115 case spirv_cross::SPIRType::ControlPointArray:
116 case spirv_cross::SPIRType::Interpolant:
117 case spirv_cross::SPIRType::Char:
118 default:
120 }
122 }

Member Data Documentation

◆ array_elements

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

Definition at line 40 of file reflector.h.

◆ base_type

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

Definition at line 35 of file reflector.h.

◆ byte_length

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

Definition at line 39 of file reflector.h.

◆ element_padding

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

Definition at line 41 of file reflector.h.

◆ name

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

Definition at line 36 of file reflector.h.

◆ offset

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

Definition at line 37 of file reflector.h.

◆ size

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

Definition at line 38 of file reflector.h.

◆ type

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

Definition at line 34 of file reflector.h.

◆ underlying_type

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

Definition at line 42 of file reflector.h.


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