| 37 | namespace Falcor |
| 38 | { |
| 39 | void gfxReportError(const char* api, const char* call, gfx::Result result) |
| 40 | { |
| 41 | const char* resultStr = nullptr; |
| 42 | #if FALCOR_HAS_D3D12 |
| 43 | switch (result) |
| 44 | { |
| 45 | case DXGI_ERROR_DEVICE_REMOVED: |
| 46 | resultStr = "DXGI_ERROR_DEVICE_REMOVED"; |
| 47 | break; |
| 48 | case DXGI_ERROR_DEVICE_HUNG: |
| 49 | resultStr = "DXGI_ERROR_DEVICE_HUNG"; |
| 50 | break; |
| 51 | case DXGI_ERROR_DEVICE_RESET: |
| 52 | resultStr = "DXGI_ERROR_DEVICE_RESET"; |
| 53 | break; |
| 54 | } |
| 55 | #endif |
| 56 | |
| 57 | #if FALCOR_HAS_AFTERMATH |
| 58 | if (!waitForAftermathDumps()) |
| 59 | logError("Aftermath GPU crash dump generation failed."); |
| 60 | #endif |
| 61 | |
| 62 | std::string fullMsg = resultStr ? fmt::format("{} call '{}' failed with error {} ({}).", api, call, result, resultStr) |
| 63 | : fmt::format("{} call '{}' failed with error {}", api, call, result); |
| 64 | |
| 65 | reportFatalErrorAndTerminate(fullMsg); |
| 66 | } |
| 67 | } // namespace Falcor |
nothing calls this directly
no test coverage detected