| 317 | } |
| 318 | |
| 319 | bool Program::link() const |
| 320 | { |
| 321 | while (1) |
| 322 | { |
| 323 | // Create the program |
| 324 | std::string log; |
| 325 | auto pVersion = mpDevice->getProgramManager()->createProgramVersion(*this, log); |
| 326 | |
| 327 | if (pVersion == nullptr) |
| 328 | { |
| 329 | std::string msg = "Failed to link program:\n" + getProgramDescString() + "\n\n" + log; |
| 330 | bool showMessageBox = is_set(getErrorDiagnosticFlags(), ErrorDiagnosticFlags::ShowMessageBoxOnError); |
| 331 | if (showMessageBox && reportErrorAndAllowRetry(msg)) |
| 332 | continue; |
| 333 | FALCOR_THROW(msg); |
| 334 | } |
| 335 | else |
| 336 | { |
| 337 | if (!log.empty()) |
| 338 | { |
| 339 | logWarning("Warnings in program:\n{}\n{}", getProgramDescString(), log); |
| 340 | } |
| 341 | |
| 342 | mpActiveVersion = pVersion; |
| 343 | return true; |
| 344 | } |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | void Program::reset() |
| 349 | { |
nothing calls this directly
no test coverage detected