Helper for writing shader debug information to a file.
Aftermath file folder.
Create a unique file name.
Aftermath file folder.
Create a unique file name.
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);
399 }
400 }
#define SPICES_PROFILE_ZONE
std::string to_string(GFSDK_Aftermath_Result result)
Convert GFSDK_Aftermath_Result to string.