1291 {
1292
1293
1294
1295
1296 this->preprocessProgram();
1297
1298 {
1299 AutoOutputStream outputToHeader(this, &fHeader, &fIndentation);
1300 this->writeEnables();
1301 this->writeStageInputStruct();
1302 this->writeStageOutputStruct();
1303 this->writeUniformsAndBuffers();
1304 this->writeNonBlockUniformsForTests();
1305 }
1306 StringStream body;
1307 {
1308
1309 AutoOutputStream outputToBody(this, &body, &fIndentation);
1310 const FunctionDefinition* mainFunc = nullptr;
1312 this->writeProgramElement(*
e);
1313
1314 if (
e->is<FunctionDefinition>()) {
1315 const FunctionDefinition& func =
e->as<FunctionDefinition>();
1316 if (func.declaration().isMain()) {
1317 mainFunc = &func;
1318 }
1319 }
1320 }
1321
1322
1323
1324
1325 if (mainFunc) {
1326 this->writeEntryPoint(*mainFunc);
1327 }
1328 }
1329
1332
1333 this->writeUniformPolyfills();
1334
1336}
void write_stringstream(const StringStream &s, OutputStream &out)
ElementsCollection elements() const