SpiecsEngine
 
Loading...
Searching...
No Matches
Spices::GpuCrashTracker Class Reference

Implements GPU crash dump tracking using the Nsight Aftermath API. More...

#include <NsightAftermathGpuCrashTracker.h>

Public Types

typedef std::array< std::map< uint64_t, std::string >, c_MarkerFrameHistoryMarkerMap
 

Public Member Functions

 GpuCrashTracker ()
 Constructor Function.
 
virtual ~GpuCrashTracker ()
 Destructor Function.
 
void Initialize ()
 Initialize the GPU crash dump tracker.
 
void SetFrameCut (uint64_t frameCut)
 Set FrameCut.
 
void SetMarker (uint64_t &markerId, const std::string &info)
 Set Marker.
 
ShaderDataBaseGetShaderDataBase ()
 Get ShaderDataBase.
 

Static Public Member Functions

static void Init ()
 Create single instance of this class.
 
static void AftermathDeviceLostCheck ()
 Aftermath handle device lost function.
 
static GpuCrashTrackerGet ()
 Get single instance of this class.
 

Static Public Attributes

static constexpr unsigned int c_MarkerFrameHistory = 4
 keep four frames worth of marker history.
 

Private Member Functions

void OnCrashDump (const void *pGpuCrashDump, const uint32_t gpuCrashDumpSize)
 Handler for GPU crash dump callbacks from Nsight Aftermath.
 
void OnShaderDebugInfo (const void *pShaderDebugInfo, const uint32_t shaderDebugInfoSize)
 Handler for shader debug information callbacks.
 
void OnResolveMarker (const void *pMarkerData, const uint32_t markerDataSize, void **ppResolvedMarkerData, uint32_t *pResolvedMarkerDataSize)
 Handler for app-managed marker resolve callback.
 
void WriteGpuCrashDumpToFile (const void *pGpuCrashDump, const uint32_t gpuCrashDumpSize)
 Helper for writing a GPU crash dump to a file.
 
void WriteShaderDebugInformationToFile (GFSDK_Aftermath_ShaderDebugInfoIdentifier identifier, const void *pShaderDebugInfo, const uint32_t shaderDebugInfoSize) const
 Helper for writing shader debug information to a file.
 
void OnShaderDebugInfoLookup (const GFSDK_Aftermath_ShaderDebugInfoIdentifier &identifier, PFN_GFSDK_Aftermath_SetData setShaderDebugInfo) const
 Handler for shader debug information lookup callbacks. This is used by the JSON decoder for mapping shader instruction addresses to SPIR-V IL lines or GLSL source lines.
 
void OnShaderLookup (const GFSDK_Aftermath_ShaderBinaryHash &shaderHash, PFN_GFSDK_Aftermath_SetData setShaderBinary) const
 Handler for shader lookup callbacks. This is used by the JSON decoder for mapping shader instruction addresses to SPIR-V IL lines or GLSL source lines. NOTE: If the application loads stripped shader binaries (ie; –strip-all in spirv-remap), Aftermath will require access to both the stripped and the not stripped shader binaries.
 
void OnShaderSourceDebugInfoLookup (const GFSDK_Aftermath_ShaderDebugName &shaderDebugName, PFN_GFSDK_Aftermath_SetData setShaderBinary) const
 Handler for shader source debug info lookup callbacks. This is used by the JSON decoder for mapping shader instruction addresses to GLSL source lines, if the shaders used by the application were compiled with separate debug info data files.
 

Static Private Member Functions

static void OnDescription (PFN_GFSDK_Aftermath_AddGpuCrashDumpDescription addDescription)
 Handler for GPU crash dump description callbacks.
 
static void GpuCrashDumpCallback (const void *pGpuCrashDump, const uint32_t gpuCrashDumpSize, void *pUserData)
 GPU crash dump callback.
 
static void ShaderDebugInfoCallback (const void *pShaderDebugInfo, const uint32_t shaderDebugInfoSize, void *pUserData)
 Shader debug information callback.
 
static void CrashDumpDescriptionCallback (PFN_GFSDK_Aftermath_AddGpuCrashDumpDescription addDescription, void *pUserData)
 GPU crash dump description callback.
 
static void ResolveMarkerCallback (const void *pMarkerData, const uint32_t markerDataSize, void *pUserData, void **ppResolvedMarkerData, uint32_t *pResolvedMarkerDataSize)
 App-managed marker resolve callback.
 
static void ShaderDebugInfoLookupCallback (const GFSDK_Aftermath_ShaderDebugInfoIdentifier *pIdentifier, PFN_GFSDK_Aftermath_SetData setShaderDebugInfo, void *pUserData)
 Shader debug information lookup callback.
 
static void ShaderLookupCallback (const GFSDK_Aftermath_ShaderBinaryHash *pShaderHash, PFN_GFSDK_Aftermath_SetData setShaderBinary, void *pUserData)
 Shader lookup callback.
 
static void ShaderSourceDebugInfoLookupCallback (const GFSDK_Aftermath_ShaderDebugName *pShaderDebugName, PFN_GFSDK_Aftermath_SetData setShaderBinary, void *pUserData)
 Shader source debug info lookup callback.
 

Private Attributes

bool m_Initialized
 Is the GPU crash dump tracker initialized?
 
std::mutex m_Mutex
 For thread-safe access of GPU crash tracker state.
 
std::map< GFSDK_Aftermath_ShaderDebugInfoIdentifier, std::vector< uint8_t > > m_ShaderDebugInfo
 List of Shader Debug Information by ShaderDebugInfoIdentifier.
 
ShaderDataBase m_ShaderDataBase
 The mock shader database.
 
MarkerMap m_MarkerMap
 App-managed marker tracking.
 
uint32_t m_FrameCut
 Frame Count cut.
 

Static Private Attributes

static std::unique_ptr< GpuCrashTrackerm_GpuCrashTracker
 GpuCrashTracker single instance.
 

Detailed Description

Implements GPU crash dump tracking using the Nsight Aftermath API.

Definition at line 21 of file NsightAftermathGpuCrashTracker.h.


The documentation for this class was generated from the following files: