UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
LandscapeTextureStreamingManager.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "CoreMinimal.h"
6
7#if WITH_EDITOR
8
9#include "EditorUndoClient.h"
10
12{
13public:
14 bool bUndoRedoPerformed = false;
15
16private:
17 virtual void PostUndo(bool bSuccess) override
18 {
19 bUndoRedoPerformed = true;
20 };
21
22 virtual void PostRedo(bool bSuccess) override
23 {
24 bUndoRedoPerformed = true;
25 };
26};
27
28#endif // WITH_EDITOR
29
30class UTexture;
31
33{
34public:
35 // Put in a request to have all streamable mips of a texture streamed in.
36 // bWaitForStreaming true will cause it to block until the texture streaming operation completes.
37 // bWaitForStreaming false will asynchronously stream in the textures, and you can check for completion with IsTextureFullyStreamedIn().
38 // The texture will* remain streamed in until you call UnrequestTextureFullyStreamedIn()
39 // Returns true if the texture is currently fully streamed in.
41
42 // Remove a request to have all streamable mips of a texture streamed in.
43 // The texture may still remain streamed in if someone else has a request,
44 // or if the texture manager doesn't see any need to evict it to reclaim texture memory.
46
47 // Request that this texture be fully streamed in for as long as the texture is loaded. No backsies.
48 // bWaitForStreaming will also block until the texture is fully streamed in.
49 // Returns true if the texture is fully streamed.
51
52 // TODO [chris.tchou] : a non-blocking tick to update streaming textures would be more efficient in some looping cases.
53 // void TickStreaming();
54
55 // Synchronously waits for all textures to complete their requested streaming. Returns true if successful.
56 // This necessary if you are requesting streaming and waiting for the textures to be streamed within a local loop.
57 // (normally they don't complete streaming until a certain point in the update tick)
59
60 // Call this post garbage collect to clean up any old entries in tracked TextureStates for textures that have been unloaded without first being Unrequested, and make sure the streaming flags weren't cleared
62
63 // Check that all requested textures are still requested.
65
67
70
71private:
72 struct FTextureState
73 {
74 int32 RequestCount = 0;
75 bool bForever = false;
76
77 bool WantsTextureStreamedIn() const
78 {
79 return bForever || (RequestCount > 0);
80 }
81 };
82
84
85 static TArray<FLandscapeTextureStreamingManager*> AllStreamingManagers;
86 static bool AnyStreamingManagerWantsTextureStreamedIn(TWeakObjectPtr<UTexture> TexturePtr);
87
88#if WITH_EDITOR
90#endif // WITH_EDITOR
91
92};
bool bSuccess
Definition ConvexDecomposition3.cpp:819
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition ContainerAllocationPolicies.h:1660
Definition LandscapeTextureStreamingManager.h:33
bool RequestTextureFullyStreamedIn(UTexture *Texture, bool bWaitForStreaming)
Definition LandscapeTextureStreamingManager.cpp:63
FLandscapeTextureStreamingManager()
Definition LandscapeTextureStreamingManager.cpp:244
void CheckRequestedTextures()
Definition LandscapeTextureStreamingManager.cpp:198
bool WaitForTextureStreaming()
Definition LandscapeTextureStreamingManager.cpp:151
bool RequestTextureFullyStreamedInForever(UTexture *Texture, bool bWaitForStreaming)
Definition LandscapeTextureStreamingManager.cpp:91
static bool IsTextureFullyStreamedIn(UTexture *Texture)
Definition LandscapeTextureStreamingManager.cpp:224
void CleanupPostGarbageCollect()
Definition LandscapeTextureStreamingManager.cpp:177
void UnrequestTextureFullyStreamedIn(UTexture *Texture)
Definition LandscapeTextureStreamingManager.cpp:111
~FLandscapeTextureStreamingManager()
Definition LandscapeTextureStreamingManager.cpp:249
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition Texture.h:1219
Definition WeakObjectPtrTemplates.h:415
Definition WeakObjectPtrTemplates.h:25