MCPcopy Create free account
hub / github.com/KhronosGroup/glslang / CompileShaders

Function CompileShaders

StandAlone/StandAlone.cpp:1213–1248  ·  view source on GitHub ↗

Thread entry point, for non-linking asynchronous mode.

Source from the content-addressed store, hash-verified

1211// Thread entry point, for non-linking asynchronous mode.
1212//
1213void CompileShaders(glslang::TWorklist& worklist)
1214{
1215 if (Options & EOptionDebug)
1216 Error("cannot generate debug information unless linking to generate code");
1217
1218 // NOTE: TWorkList::remove is thread-safe
1219 glslang::TWorkItem* workItem;
1220 if (Options & EOptionStdin) {
1221 if (worklist.remove(workItem)) {
1222 ShHandle compiler = ShConstructCompiler(FindLanguage("stdin"), 0);
1223 if (compiler == nullptr)
1224 return;
1225
1226 CompileFile("stdin", compiler);
1227
1228 if (! (Options & EOptionSuppressInfolog))
1229 workItem->results = ShGetInfoLog(compiler);
1230
1231 ShDestruct(compiler);
1232 }
1233 } else {
1234 while (worklist.remove(workItem)) {
1235 ShHandle compiler = ShConstructCompiler(FindLanguage(workItem->name), 0);
1236 if (compiler == nullptr)
1237 return;
1238
1239
1240 CompileFile(workItem->name.c_str(), compiler);
1241
1242 if (! (Options & EOptionSuppressInfolog))
1243 workItem->results = ShGetInfoLog(compiler);
1244
1245 ShDestruct(compiler);
1246 }
1247 }
1248}
1249
1250// Outputs the given string, but only if it is non-null and non-empty.
1251// This prevents erroneous newlines from appearing.

Callers 1

singleMainFunction · 0.85

Calls 8

ErrorFunction · 0.85
ShConstructCompilerFunction · 0.85
FindLanguageFunction · 0.85
CompileFileFunction · 0.85
ShGetInfoLogFunction · 0.85
ShDestructFunction · 0.85
removeMethod · 0.80
c_strMethod · 0.80

Tested by

no test coverage detected