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

Method OpConstantBool

Source/SpireCore/SpirVCodeGen.cpp:1243–1261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1241 streamFunctionBody.Add(ID1);
1242 }
1243 void OpConstantBool(const int typeID, const int ID, const bool b)
1244 {
1245 if (b)
1246 {
1247 sbTextTypeDefinition << LR"(%)" << ID << LR"( = OpConstantTrue%)" << EndLine;
1248
1249 streamTypeDefinition.Add(41 + (3 << 16));
1250 streamTypeDefinition.Add(typeID);
1251 streamTypeDefinition.Add(ID);
1252 }
1253 else
1254 {
1255 sbTextTypeDefinition << LR"(%)" << ID << LR"( = OpConstantFalse%)" << EndLine;
1256
1257 streamTypeDefinition.Add(42 + (3 << 16));
1258 streamTypeDefinition.Add(typeID);
1259 streamTypeDefinition.Add(ID);
1260 }
1261 }
1262 void OpConstantFloat(const int ID, const int typeID, float f)
1263 {
1264 sbTextTypeDefinition << LR"(%)" << ID << LR"( = OpConstant %)" << typeID << LR"( )" << SpirVFloatToString(f) << EndLine;

Callers 1

AddInstrConstantBoolMethod · 0.80

Calls 1

AddMethod · 0.45

Tested by

no test coverage detected