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

Method AddInstrConstantBool

Source/SpireCore/SpirVCodeGen.cpp:2237–2249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2235 }
2236
2237 int AddInstrConstantBool(int value)
2238 {
2239 if (Dictionary_ConstantBoolToID.ContainsKey(value != 0))
2240 return Dictionary_ConstantBoolToID[value != 0].GetValue();
2241
2242 auto Type = GetTypeFromString("bool");
2243 int typeID = DefineType(Type);
2244 ++CurrentID;
2245 CodeGen.OpConstantBool(typeID, CurrentID, value != 0);
2246 IDInfos[CurrentID] = IDInfo::CreateIDInfoForValue(CurrentID, Type, 0, typeID);
2247 Dictionary_ConstantBoolToID[value != 0] = CurrentID;
2248 return CurrentID;
2249 }
2250
2251 int AddInstrConstantFloat(float f)
2252 {

Callers 1

GetOperandValueMethod · 0.80

Calls 3

GetTypeFromStringFunction · 0.85
OpConstantBoolMethod · 0.80
ContainsKeyMethod · 0.45

Tested by

no test coverage detected