MCPcopy Create free account
hub / github.com/csyonghe/Spire / Decorate

Method Decorate

Source/SpireCore/SpirVCodeGen.cpp:996–1021  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

994 }
995 }
996 int Decorate(const Decoration deco, int op1 = 0)
997 {
998 int len = 0;
999 sbTextAnnotation << " " << DecorationToString(deco);
1000 streamAnnotation.Add((int)deco);
1001 len++;
1002 if (deco == Decoration::Location ||
1003 deco == Decoration::Offset ||
1004 deco == Decoration::MatrixStride ||
1005 deco == Decoration::ArrayStride ||
1006 deco == Decoration::DescriptorSet ||
1007 deco == Decoration::Binding)
1008 {
1009 sbTextAnnotation << LR"( )" << op1;
1010 streamAnnotation.Add(op1);
1011 len++;
1012 }
1013 if (deco == Decoration::BuiltIn)
1014 {
1015 BuiltIn builtin = static_cast<BuiltIn>(op1);
1016 sbTextAnnotation << LR"( )" << BuiltinToString(builtin);
1017 streamAnnotation.Add(op1);
1018 len++;
1019 }
1020 return len;
1021 }
1022 void OpDecorate(const int ID, const Decoration deco, int op1 = 0)
1023 {
1024 sbTextAnnotation << LR"(OpDecorate %)" << ID;

Callers

nothing calls this directly

Calls 3

DecorationToStringFunction · 0.85
BuiltinToStringFunction · 0.85
AddMethod · 0.45

Tested by

no test coverage detected