Files
zach harris c8c7fd62ec Various fixes and enhancements to the primitive debugger tool.
- Renamed the command to access the tool from DrawPrimitiveDebugger.Open to PrimitiveDebugger.Open
- Fixed access violations and crashes that occurred when opening and using the tool.
- Fixed issue where the debugger table would not populate until filter text was entered when using it in-game.
- Fixed an issue causing the server to crash if the console command cheat DrawPrimitiveDebugger.Open is used
- Added support for skeletal meshes and other primitives.
- Added a details panel for the currently selected row to declutter the table view and provide more in depth information such as the materials and textures used and the number of available LODs. The data displayed will refresh automatically and display the active location, LOD, and triangle count of the primitive.
- The details panel can force LOD levels, force disable nanite, display bounds, and show skeletal bones. Bounds and bone displays only work in development or debug builds.
- Note that any changes to primitives made by the debugger, as well as pinned and hidden entries, will be reset when the debugger is closed.
- Fixed communication between the game and render threads when handling frame captures.
- Enhanced search functionality. You can now search by primitive name, primitive class, actor name, actor class, material name, and texture used.

#rb daniele.vettorel
[FYI] elizabeth.bunner, nicolas.mercier, bryce.lumpkin
#tests FNTEST-128602

[CL 32064534 by zach harris in ue5-main branch]
2024-03-06 15:16:33 -05:00

77 lines
2.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
// DRAW PRIMITIVE DEBUGGER
//
// This tool allows easy on screen debugging of graphics data, primarily on-screen primitives
//
#pragma once
#include "CoreMinimal.h"
#include "Modules/ModuleInterface.h"
#include "Modules/ModuleManager.h"
#define WITH_PRIMITIVE_DEBUGGER !UE_BUILD_SHIPPING && !UE_SERVER
DECLARE_LOG_CATEGORY_EXTERN(LogDrawPrimitiveDebugger, All, All);
class DRAWPRIMITIVEDEBUGGER_API IDrawPrimitiveDebugger : public IModuleInterface
{
public:
/**
* Singleton-like access to this module's interface. This is just for convenience!
* Beware of calling this during the shutdown phase, though. Your module might have been unloaded already.
*
* @return Returns singleton instance, loading the module on demand if needed
*/
static inline IDrawPrimitiveDebugger& Get()
{
return FModuleManager::LoadModuleChecked< IDrawPrimitiveDebugger >("DrawPrimitiveDebugger");
}
/**
* Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true.
*
* @return True if the module is loaded and ready to use
*/
static inline bool IsAvailable()
{
return FModuleManager::Get().IsModuleLoaded("DrawPrimitiveDebugger");
}
/**
* Instructs the renderer to capture a snapshot for the debugger on the next frame.
*/
virtual void CaptureSingleFrame() = 0;
/**
* Is live data capture enabled for the debugger? This implies that the renderer will capture debug data each frame.
* @return True if live capture is enabled.
*/
virtual bool IsLiveCaptureEnabled() const = 0;
/**
* Enables capturing debug data each frame.
*/
virtual void EnableLiveCapture() = 0;
/**
* Disables capturing debug data each frame.
*/
virtual void DisableLiveCapture() = 0;
/**
* Discards the current snapshot data in memory and resets the debugger window.
*/
virtual void DiscardCaptureData() = 0;
/**
* Opens the graphics debugger window if it is available.
*/
virtual void OpenDebugWindow() = 0;
/**
* Closes the graphics debugger window if it is currently open.
*/
virtual void CloseDebugWindow() = 0;
};