MCPcopy Create free account
hub / github.com/KhronosGroup/glslang / handleSelectionAttributes

Method handleSelectionAttributes

glslang/MachineIndependent/attribute.cpp:169–193  ·  view source on GitHub ↗

Selection attributes

Source from the content-addressed store, hash-verified

167// Selection attributes
168//
169void TParseContext::handleSelectionAttributes(const TAttributes& attributes, TIntermNode* node)
170{
171 TIntermSelection* selection = node->getAsSelectionNode();
172 if (selection == nullptr)
173 return;
174
175 for (auto it = attributes.begin(); it != attributes.end(); ++it) {
176 if (it->size() > 0) {
177 warn(node->getLoc(), "attribute with arguments not recognized, skipping", "", "");
178 continue;
179 }
180
181 switch (it->name) {
182 case EatFlatten:
183 selection->setFlatten();
184 break;
185 case EatBranch:
186 selection->setDontFlatten();
187 break;
188 default:
189 warn(node->getLoc(), "attribute does not apply to a selection", "", "");
190 break;
191 }
192 }
193}
194
195//
196// Switch attributes

Callers 1

yyparseFunction · 0.45

Calls 6

beginMethod · 0.80
endMethod · 0.80
getAsSelectionNodeMethod · 0.45
sizeMethod · 0.45
setFlattenMethod · 0.45
setDontFlattenMethod · 0.45

Tested by

no test coverage detected