MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / getScalarElementCount

Function getScalarElementCount

source/opt/struct_packing_pass.cpp:141–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141static uint32_t getScalarElementCount(const analysis::Type& type) {
142 switch (type.kind()) {
143 case analysis::Type::kVector:
144 return type.AsVector()->element_count();
145 case analysis::Type::kMatrix:
146 return getScalarElementCount(*type.AsMatrix()->element_type());
147 case analysis::Type::kStruct:
148 assert(0 && "getScalarElementCount() does not recognized struct types");
149 return 0;
150 default:
151 return 1;
152 }
153}
154
155// Aligns the specified value to a multiple of alignment, whereas the
156// alignment must be a power-of-two.

Callers 1

getPackedSizeMethod · 0.85

Calls 5

kindMethod · 0.80
AsVectorMethod · 0.80
AsMatrixMethod · 0.80
element_countMethod · 0.45
element_typeMethod · 0.45

Tested by

no test coverage detected