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

Method OpVariable

Source/SpireCore/SpirVCodeGen.cpp:1378–1401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1376 streamFunctionBody.Add(variableID);
1377 }
1378 void OpVariable(const int ID, const int typeID, StorageClass store)
1379 {
1380 StringBuilder instrBuilder;
1381 instrBuilder << LR"(%)" << ID << LR"( = OpVariable %)" << typeID << LR"( )" << StorageClassToString(store) << EndLine;
1382 if (store == StorageClass::Function)
1383 sbTextFunctionVariable << instrBuilder.ProduceString() << EndLine;
1384 else
1385 sbTextTypeDefinition << instrBuilder.ProduceString() << EndLine;
1386
1387 if (store == StorageClass::Function)
1388 {
1389 streamFunctionVariable.Add(59 + (4 << 16));
1390 streamFunctionVariable.Add(typeID);
1391 streamFunctionVariable.Add(ID);
1392 streamFunctionVariable.Add((int)store);
1393 }
1394 else
1395 {
1396 streamTypeDefinition.Add(59 + (4 << 16));
1397 streamTypeDefinition.Add(typeID);
1398 streamTypeDefinition.Add(ID);
1399 streamTypeDefinition.Add((int)store);
1400 }
1401 }
1402 void OpAccessChain(const int ID, const int typeID, const int structID, const int indexID)
1403 {
1404 sbTextFunctionBody << LR"(%)" << ID << LR"( = OpAccessChain %)" << typeID

Callers 1

Calls 3

StorageClassToStringFunction · 0.85
ProduceStringMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected