UKismetRenderingLibrary::ReleaseRenderTarget2D
#include "Kismet/KismetRenderingLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Manually releases the GPU resources of a render target instead of waiting for the garbage collector, useful when creating many short-lived render targets at runtime.
Caveats & Gotchas
- • The UObject itself is not destroyed, only its GPU-side resource; using the render target afterward for drawing or reading will not work correctly until it is recreated.
- • Intended for platforms with tight GPU memory budgets where waiting for GC-driven cleanup of many render targets would cause memory pressure spikes.
- • Calling this on a render target that is still actively bound as an output (e.g. mid-draw) can produce rendering artifacts or a crash.
Signature
static void ReleaseRenderTarget2D(UTextureRenderTarget2D* TextureRenderTarget); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| TextureRenderTarget | UTextureRenderTarget2D* | The render target whose GPU resources should be released immediately. | — |
Return Type
void Example
Release after use C++
UKismetRenderingLibrary::ReleaseRenderTarget2D(TempRenderTarget);
TempRenderTarget = nullptr; Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?