MCPcopy Create free account
hub / github.com/alecazam/kram / NeedsFunction

Method NeedsFunction

hlslparser/src/HLSLTree.cpp:410–443  ·  view source on GitHub ↗

TODO: Nothing calling this?

Source from the content-addressed store, hash-verified

408
409// TODO: Nothing calling this?
410bool HLSLTree::NeedsFunction(const char *name)
411{
412 // Early out
413 if (!GetContainsString(name))
414 return false;
415
416 struct NeedsFunctionVisitor : HLSLTreeVisitor {
417 const char *name;
418 bool result;
419
420 virtual ~NeedsFunctionVisitor() {}
421
422 virtual void VisitTopLevelStatement(HLSLStatement *node)
423 {
424 if (!node->hidden)
425 HLSLTreeVisitor::VisitTopLevelStatement(node);
426 }
427
428 virtual void VisitFunctionCall(HLSLFunctionCall *node)
429 {
430 result = result || String_Equal(name, node->function->name);
431
432 HLSLTreeVisitor::VisitFunctionCall(node);
433 }
434 };
435
436 NeedsFunctionVisitor visitor;
437 visitor.name = name;
438 visitor.result = false;
439
440 visitor.VisitRoot(m_root);
441
442 return visitor.result;
443}
444
445// Returns dimension, 0 if invalid.
446int HLSLTree::GetExpressionValue(HLSLExpression *expression, float values[4])

Callers

nothing calls this directly

Calls 1

VisitRootMethod · 0.80

Tested by

no test coverage detected