MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / initialize

Method initialize

Source/Falcor/Core/API/Aftermath.cpp:396–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394AftermathContext::~AftermathContext() {}
395
396bool AftermathContext::initialize(AftermathFlags flags)
397{
398 if (mInitialized)
399 return true;
400
401 flags |= AftermathFlags::EnableMarkers;
402 flags |= AftermathFlags::EnableResourceTracking;
403 flags |= AftermathFlags::CallStackCapturing;
404 // flags |= AftermathFlags::GenerateShaderDebugInfo;
405 // flags |= AftermathFlags::EnableShaderErrorReporting;
406
407 switch (mpDevice->getType())
408 {
409#if FALCOR_HAS_D3D12
410 case Device::Type::D3D12:
411 {
412 ID3D12Device* pD3D12Device = mpDevice->getNativeHandle(0).as<ID3D12Device*>();
413 GFSDK_Aftermath_Result result = GFSDK_Aftermath_DX12_Initialize(GFSDK_Aftermath_Version_API, flags, pD3D12Device);
414 if (!GFSDK_Aftermath_SUCCEED(result))
415 {
416 logWarning("Aftermath failed to initialize on D3D12 device: {}", getResultString(result));
417 return false;
418 }
419 }
420 break;
421#endif
422#if FALCOR_HAS_VULKAN
423 case Device::Type::Vulkan:
424 logWarning("Aftermath on Vulkan only supports basic GPU crash dumps.");
425 return false;
426#endif
427 default:
428 logWarning("Aftermath is not supported on this device.");
429 return false;
430 }
431
432 mInitialized = true;
433 return true;
434}
435
436void AftermathContext::addMarker(const LowLevelContextData* pLowLevelContextData, std::string_view name)
437{

Callers 1

DeviceMethod · 0.45

Calls 4

getResultStringFunction · 0.85
logWarningFunction · 0.50
getTypeMethod · 0.45
getNativeHandleMethod · 0.45

Tested by

no test coverage detected