|
|
|
@@ -45,7 +45,7 @@ GpuCrashTracker::~GpuCrashTracker()
|
|
|
|
|
// If initialized, disable GPU crash dumps
|
|
|
|
|
if (m_initialized)
|
|
|
|
|
{
|
|
|
|
|
GFSDK_Aftermath_DisableGpuCrashDumps();
|
|
|
|
|
AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_DisableGpuCrashDumps());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -91,7 +91,7 @@ void GpuCrashTracker::OnShaderDebugInfo(const void* pShaderDebugInfo, const uint
|
|
|
|
|
|
|
|
|
|
// Get shader debug information identifier
|
|
|
|
|
GFSDK_Aftermath_ShaderDebugInfoIdentifier identifier = {};
|
|
|
|
|
AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_GetShaderDebugInfoIdentifier(
|
|
|
|
|
AFTERMATH_CHECK_ERROR(PFN_GFSDK_Aftermath_GetShaderDebugInfoIdentifier(
|
|
|
|
|
GFSDK_Aftermath_Version_API,
|
|
|
|
|
pShaderDebugInfo,
|
|
|
|
|
shaderDebugInfoSize,
|
|
|
|
@@ -124,7 +124,7 @@ void GpuCrashTracker::WriteGpuCrashDumpToFile(const void* pGpuCrashDump, const u
|
|
|
|
|
{
|
|
|
|
|
// Create a GPU crash dump decoder object for the GPU crash dump.
|
|
|
|
|
GFSDK_Aftermath_GpuCrashDump_Decoder decoder = {};
|
|
|
|
|
AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_GpuCrashDump_CreateDecoder(
|
|
|
|
|
AFTERMATH_CHECK_ERROR(PFN_GFSDK_Aftermath_GpuCrashDump_CreateDecoder(
|
|
|
|
|
GFSDK_Aftermath_Version_API,
|
|
|
|
|
pGpuCrashDump,
|
|
|
|
|
gpuCrashDumpSize,
|
|
|
|
@@ -133,19 +133,19 @@ void GpuCrashTracker::WriteGpuCrashDumpToFile(const void* pGpuCrashDump, const u
|
|
|
|
|
// Use the decoder object to read basic information, like application
|
|
|
|
|
// name, PID, etc. from the GPU crash dump.
|
|
|
|
|
GFSDK_Aftermath_GpuCrashDump_BaseInfo baseInfo = {};
|
|
|
|
|
AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_GpuCrashDump_GetBaseInfo(decoder, &baseInfo));
|
|
|
|
|
AFTERMATH_CHECK_ERROR(PFN_GFSDK_Aftermath_GpuCrashDump_GetBaseInfo(decoder, &baseInfo));
|
|
|
|
|
|
|
|
|
|
// Use the decoder object to query the application name that was set
|
|
|
|
|
// in the GPU crash dump description.
|
|
|
|
|
uint32_t applicationNameLength = 0;
|
|
|
|
|
AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_GpuCrashDump_GetDescriptionSize(
|
|
|
|
|
AFTERMATH_CHECK_ERROR(PFN_GFSDK_Aftermath_GpuCrashDump_GetDescriptionSize(
|
|
|
|
|
decoder,
|
|
|
|
|
GFSDK_Aftermath_GpuCrashDumpDescriptionKey_ApplicationName,
|
|
|
|
|
&applicationNameLength));
|
|
|
|
|
|
|
|
|
|
std::vector<char> applicationName(applicationNameLength, '\0');
|
|
|
|
|
|
|
|
|
|
AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_GpuCrashDump_GetDescription(
|
|
|
|
|
AFTERMATH_CHECK_ERROR(PFN_GFSDK_Aftermath_GpuCrashDump_GetDescription(
|
|
|
|
|
decoder,
|
|
|
|
|
GFSDK_Aftermath_GpuCrashDumpDescriptionKey_ApplicationName,
|
|
|
|
|
uint32_t(applicationName.size()),
|
|
|
|
@@ -176,7 +176,7 @@ void GpuCrashTracker::WriteGpuCrashDumpToFile(const void* pGpuCrashDump, const u
|
|
|
|
|
// Decode the crash dump to a JSON string.
|
|
|
|
|
// Step 1: Generate the JSON and get the size.
|
|
|
|
|
uint32_t jsonSize = 0;
|
|
|
|
|
AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_GpuCrashDump_GenerateJSON(
|
|
|
|
|
AFTERMATH_CHECK_ERROR(PFN_GFSDK_Aftermath_GpuCrashDump_GenerateJSON(
|
|
|
|
|
decoder,
|
|
|
|
|
GFSDK_Aftermath_GpuCrashDumpDecoderFlags_ALL_INFO,
|
|
|
|
|
GFSDK_Aftermath_GpuCrashDumpFormatterFlags_NONE,
|
|
|
|
@@ -188,7 +188,7 @@ void GpuCrashTracker::WriteGpuCrashDumpToFile(const void* pGpuCrashDump, const u
|
|
|
|
|
&jsonSize));
|
|
|
|
|
// Step 2: Allocate a buffer and fetch the generated JSON.
|
|
|
|
|
std::vector<char> json(jsonSize);
|
|
|
|
|
AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_GpuCrashDump_GetJSON(
|
|
|
|
|
AFTERMATH_CHECK_ERROR(PFN_GFSDK_Aftermath_GpuCrashDump_GetJSON(
|
|
|
|
|
decoder,
|
|
|
|
|
uint32_t(json.size()),
|
|
|
|
|
json.data()));
|
|
|
|
@@ -203,7 +203,7 @@ void GpuCrashTracker::WriteGpuCrashDumpToFile(const void* pGpuCrashDump, const u
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Destroy the GPU crash dump decoder object.
|
|
|
|
|
AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_GpuCrashDump_DestroyDecoder(decoder));
|
|
|
|
|
AFTERMATH_CHECK_ERROR(PFN_GFSDK_Aftermath_GpuCrashDump_DestroyDecoder(decoder));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Helper for writing shader debug information to a file
|
|
|
|
|