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

Method OpConstantFloat

Source/SpireCore/SpirVCodeGen.cpp:1262–1271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;
1265
1266 streamTypeDefinition.Add(43 + (4 << 16));
1267 streamTypeDefinition.Add(typeID);
1268 streamTypeDefinition.Add(ID);
1269 streamTypeDefinition.Add(*reinterpret_cast<unsigned int*>(&f));
1270 //printf("%.8f -> %x\n", f, streamTypeDefinition[streamTypeDefinition.Count() - 1]);
1271 }
1272 void OpConstantInt(const int ID, const int typeID, int i)
1273 {
1274 sbTextTypeDefinition << LR"(%)" << ID << LR"( = OpConstant %)" << typeID << LR"( )" << i << EndLine;

Callers 1

AddInstrConstantFloatMethod · 0.80

Calls 2

SpirVFloatToStringFunction · 0.85
AddMethod · 0.45

Tested by

no test coverage detected