SpiecsEngine
 
Loading...
Searching...
No Matches

◆ WriteShaderDebugInformationToFile()

void Spices::GpuCrashTracker::WriteShaderDebugInformationToFile ( GFSDK_Aftermath_ShaderDebugInfoIdentifier identifier,
const void * pShaderDebugInfo,
const uint32_t shaderDebugInfoSize ) const
private

Helper for writing shader debug information to a file.

Parameters
[in]identifierGFSDK_Aftermath_ShaderDebugInfoIdentifier.
[in]pShaderDebugInfo.
[in]shaderDebugInfoSize.

Aftermath file folder.

Create a unique file name.

Aftermath file folder.

Create a unique file name.

Definition at line 364 of file NsightAftermathGpuCrashTracker.cpp.

369 {
371
375 time_t timep;
376 tm* p;
377
378 auto error = time(&timep);
379 p = localtime(&timep);
380
381 std::stringstream ss;
382 ss << SPICES_GPUCRASHREPORT_PATH <<
383 p->tm_year + 1900 <<
384 p->tm_mon + 1 <<
385 p->tm_mday << "_" <<
386 p->tm_hour <<
387 p->tm_min << "00" << "/";
388 std::filesystem::create_directories(ss.str());
389
393 const std::string filePath = "shader-" + std::to_string(identifier) + ".nvdbg";
394 std::ofstream f(ss.str() + filePath, std::ios::out | std::ios::binary);
395 if (f)
396 {
397 f.write(static_cast<const char*>(pShaderDebugInfo), shaderDebugInfoSize);
398 f.close();
399 }
400 }
#define SPICES_PROFILE_ZONE
std::string to_string(GFSDK_Aftermath_Result result)
Convert GFSDK_Aftermath_Result to string.