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

Method handleSwitchAttributes

glslang/MachineIndependent/attribute.cpp:198–222  ·  view source on GitHub ↗

Switch attributes

Source from the content-addressed store, hash-verified

196// Switch attributes
197//
198void TParseContext::handleSwitchAttributes(const TAttributes& attributes, TIntermNode* node)
199{
200 TIntermSwitch* selection = node->getAsSwitchNode();
201 if (selection == nullptr)
202 return;
203
204 for (auto it = attributes.begin(); it != attributes.end(); ++it) {
205 if (it->size() > 0) {
206 warn(node->getLoc(), "attribute with arguments not recognized, skipping", "", "");
207 continue;
208 }
209
210 switch (it->name) {
211 case EatFlatten:
212 selection->setFlatten();
213 break;
214 case EatBranch:
215 selection->setDontFlatten();
216 break;
217 default:
218 warn(node->getLoc(), "attribute does not apply to a switch", "", "");
219 break;
220 }
221 }
222}
223
224//
225// Loop attributes

Callers 1

yyparseFunction · 0.45

Calls 6

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

Tested by

no test coverage detected