UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
RHICoreIntelBreadcrumbs.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#ifndef INTEL_GPU_CRASH_DUMPS
6# define INTEL_GPU_CRASH_DUMPS 0
7#endif
8
9#if INTEL_GPU_CRASH_DUMPS
10
11 #include "RHIBreadcrumbs.h"
12
13 namespace UE::RHICore::Intel::GPUCrashDumps
14 {
15 static bool bEnabled = false;
16 static uint32 Flags = 0;
17
18 // API
19 RHICORE_API bool IsEnabled();
20
21 //
22 // Called on RHICore module startup to load the Intel Extensions library
23 //
24 RHICORE_API void StartupModule();
25
26 //
27 // Called by platform RHIs to activate Intel Breadcrumbs
28 //
30
31 //
32 // Called by platform RHIs when a GPU crash is detected.
33 // Waits for for the processing to finish.
34 //
35 RHICORE_API bool OnGPUCrash();
36
37 static inline constexpr TCHAR RootNodeName[] = TEXT("<root>");
38
39 //
40 // Platform RHI helper for implementing RHIBeginBreadcrumbGPU / RHIEndBreadcrumbGPU
41 //
42 #if WITH_RHI_BREADCRUMBS
43 class FMarker
44 {
45 #if !INTEL_BREADCRUMBS_USE_BREADCRUMB_PTRS
46 FRHIBreadcrumb::FBuffer Buffer;
47 #endif
48
49 void const* Ptr = nullptr;
50 uint32 Size = 0;
51
52 public:
54 {
55 #if INTEL_BREADCRUMBS_USE_BREADCRUMB_PTRS
56 // Intel Breadcrumbs will store a pointer to a breadcrumb node.
57 Ptr = Breadcrumb ? Breadcrumb : FRHIBreadcrumbNode::Sentinel;
58 Size = sizeof( FRHIBreadcrumbNode* ); // pointer size
59 #else
60 // Generate the breadcrumb node name
61 TCHAR const* NameStr = Breadcrumb ? Breadcrumb->GetTCHAR(Buffer) : RootNodeName;
62 Ptr = NameStr;
63 Size = (FCString::Strlen(NameStr) + 1) * sizeof(TCHAR);// Include null terminator
64 #endif
65 }
66
67 operator bool() const { return Ptr != nullptr; }
68
69 void* GetPtr () const { return const_cast<void*>(Ptr); }
70 uint32 GetSize() const { return Size; }
71 };
72 #endif // WITH_RHI_BREADCRUMBS
73 };
74
75#endif // INTEL_GPU_CRASH_DUMPS
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE_FORCEINLINE_HINT uint32 GetPtr() const
Definition LockFreeList.h:15
const bool
Definition NetworkReplayStreaming.h:178
uint32 Size
Definition VulkanMemory.cpp:4034
uint32_t uint32
Definition binka_ue_file_header.h:6
static int32 Strlen(const CharType *String)
Definition CString.h:1047