Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
impeller::ShaderStageIOSlot Struct Reference

#include <shader_types.h>

Public Member Functions

constexpr size_t GetHash () const
 
constexpr bool operator== (const ShaderStageIOSlot &other) const
 
constexpr VertexAttributeFormat GetVertexAttributeFormat () const
 Derives the flat vertex attribute format from this slot's scalar type, bit width, and component count.
 

Public Attributes

const char * name
 
size_t location
 
size_t set
 
size_t binding
 
ShaderType type
 
size_t bit_width
 
size_t vec_size
 
size_t columns
 
size_t offset
 
bool relaxed_precision
 

Detailed Description

Definition at line 221 of file shader_types.h.

Member Function Documentation

◆ GetHash()

◆ GetVertexAttributeFormat()

constexpr VertexAttributeFormat impeller::ShaderStageIOSlot::GetVertexAttributeFormat ( ) const
inlineconstexpr

Derives the flat vertex attribute format from this slot's scalar type, bit width, and component count.

Returns kInvalid for matrices, component counts outside 1 to 4, mismatched bit widths, and scalar kinds that are not valid vertex inputs (boolean, 64-bit integers, and doubles).

Definition at line 258 of file shader_types.h.

258 {
259 if (columns != 1u || vec_size < 1u || vec_size > 4u) {
261 }
262 auto pick = [vec_size = vec_size](
265 switch (vec_size) {
266 case 1:
267 return x1;
268 case 2:
269 return x2;
270 case 3:
271 return x3;
272 case 4:
273 return x4;
274 default:
276 }
277 };
278 switch (type) {
280 return bit_width == 32u ? pick(VertexAttributeFormat::kFloat32,
286 return bit_width == 16u ? pick(VertexAttributeFormat::kFloat16,
292 return bit_width == 8u ? pick(VertexAttributeFormat::kSInt8,
298 return bit_width == 8u ? pick(VertexAttributeFormat::kUInt8,
304 return bit_width == 16u ? pick(VertexAttributeFormat::kSInt16,
310 return bit_width == 16u ? pick(VertexAttributeFormat::kUInt16,
316 return bit_width == 32u ? pick(VertexAttributeFormat::kSInt32,
322 return bit_width == 32u ? pick(VertexAttributeFormat::kUInt32,
339 }
341 }
#define FML_UNREACHABLE()
Definition logging.h:128
VertexAttributeFormat
The format of a single vertex attribute, combining its scalar kind, bit width, and component count.

References bit_width, columns, FML_UNREACHABLE, impeller::kAtomicCounter, impeller::kBoolean, impeller::kDouble, impeller::kFloat, impeller::kFloat16, impeller::kFloat16x2, impeller::kFloat16x3, impeller::kFloat16x4, impeller::kFloat32, impeller::kFloat32x2, impeller::kFloat32x3, impeller::kFloat32x4, impeller::kHalfFloat, impeller::kImage, impeller::kInvalid, impeller::kSampledImage, impeller::kSampler, impeller::kSignedByte, impeller::kSignedInt, impeller::kSignedInt64, impeller::kSignedShort, impeller::kSInt16, impeller::kSInt16x2, impeller::kSInt16x3, impeller::kSInt16x4, impeller::kSInt32, impeller::kSInt32x2, impeller::kSInt32x3, impeller::kSInt32x4, impeller::kSInt8, impeller::kSInt8x2, impeller::kSInt8x3, impeller::kSInt8x4, impeller::kStruct, impeller::kUInt16, impeller::kUInt16x2, impeller::kUInt16x3, impeller::kUInt16x4, impeller::kUInt32, impeller::kUInt32x2, impeller::kUInt32x3, impeller::kUInt32x4, impeller::kUInt8, impeller::kUInt8x2, impeller::kUInt8x3, impeller::kUInt8x4, impeller::kUnknown, impeller::kUnsignedByte, impeller::kUnsignedInt, impeller::kUnsignedInt64, impeller::kUnsignedShort, impeller::kVoid, type, and vec_size.

◆ operator==()

constexpr bool impeller::ShaderStageIOSlot::operator== ( const ShaderStageIOSlot other) const
inlineconstexpr

Definition at line 238 of file shader_types.h.

238 {
239 return name == other.name && //
240 location == other.location && //
241 set == other.set && //
242 binding == other.binding && //
243 type == other.type && //
244 bit_width == other.bit_width && //
245 vec_size == other.vec_size && //
246 columns == other.columns && //
247 offset == other.offset && //
248 relaxed_precision == other.relaxed_precision //
249 ;
250 }

References binding, bit_width, columns, location, name, offset, relaxed_precision, set, type, and vec_size.

Member Data Documentation

◆ binding

◆ bit_width

◆ columns

◆ location

◆ name

◆ offset

◆ relaxed_precision

bool impeller::ShaderStageIOSlot::relaxed_precision

◆ set

◆ type

◆ vec_size


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