Thread entry point, for non-linking asynchronous mode.
| 1211 | // Thread entry point, for non-linking asynchronous mode. |
| 1212 | // |
| 1213 | void 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. |
no test coverage detected