SpiecsEngine
 
Loading...
Searching...
No Matches

◆ Initialize()

void Spices::GpuCrashTracker::Initialize ( )

Initialize the GPU crash dump tracker.

Enable GPU crash dumps and set up the callbacks for crash dump notifications, shader debug information notifications, and providing additional crash dump description data.Only the crash dump callback is mandatory. The other two callbacks are optional and can be omitted, by passing nullptr, if the corresponding functionality is not used. The DeferDebugInfoCallbacks flag enables caching of shader debug information data in memory. If the flag is set, ShaderDebugInfoCallback will be called only in the event of a crash, right before GpuCrashDumpCallback. If the flag is not set, ShaderDebugInfoCallback will be called for every shader that is compiled.

Enable GPU crash dumps and set up the callbacks for crash dump notifications, shader debug information notifications, and providing additional crash dump description data.Only the crash dump callback is mandatory. The other two callbacks are optional and can be omitted, by passing nullptr, if the corresponding functionality is not used. The DeferDebugInfoCallbacks flag enables caching of shader debug information data in memory. If the flag is set, ShaderDebugInfoCallback will be called only in the event of a crash, right before GpuCrashDumpCallback. If the flag is not set, ShaderDebugInfoCallback will be called for every shader that is compiled.

Definition at line 43 of file NsightAftermathGpuCrashTracker.cpp.

44 {
46
58 AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_EnableGpuCrashDumps(
59 GFSDK_Aftermath_Version_API ,
60 GFSDK_Aftermath_GpuCrashDumpWatchedApiFlags_Vulkan ,
61 GFSDK_Aftermath_GpuCrashDumpFeatureFlags_DeferDebugInfoCallbacks , /* @brief Let the Nsight Aftermath library cache shader debug information. */
62 GpuCrashDumpCallback , /* @brief Register callback for GPU crash dumps. */
63 ShaderDebugInfoCallback , /* @brief Register callback for shader debug information. */
64 CrashDumpDescriptionCallback , /* @brief Register callback for GPU crash dump description. */
65 ResolveMarkerCallback , /* @brief Register callback for resolving application-managed markers. */
66 this
67 )); /* @brief Set the GpuCrashTracker object as user data for the above callbacks. */
68
69 m_Initialized = true;
70 }
#define AFTERMATH_CHECK_ERROR(FC)
Helper macro for checking Nsight Aftermath results and throwing exception in case of a failure.
#define SPICES_PROFILE_ZONE
static void CrashDumpDescriptionCallback(PFN_GFSDK_Aftermath_AddGpuCrashDumpDescription addDescription, void *pUserData)
GPU crash dump description callback.
static void ShaderDebugInfoCallback(const void *pShaderDebugInfo, const uint32_t shaderDebugInfoSize, void *pUserData)
Shader debug information callback.
bool m_Initialized
Is the GPU crash dump tracker initialized?
static void GpuCrashDumpCallback(const void *pGpuCrashDump, const uint32_t gpuCrashDumpSize, void *pUserData)
GPU crash dump callback.
static void ResolveMarkerCallback(const void *pMarkerData, const uint32_t markerDataSize, void *pUserData, void **ppResolvedMarkerData, uint32_t *pResolvedMarkerDataSize)
App-managed marker resolve callback.

References m_Initialized.