UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SlateShaderResource.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Stats/Stats.h"
7#include "SlateGlobals.h"
10
12
14
38
39
44{
45public:
46
52 virtual uint32 GetWidth() const = 0;
53
59 virtual uint32 GetHeight() const = 0;
60
67
71 virtual bool IsResourceValid() const { return true; };
72
77
81 virtual bool RequiresVirtualTextureFeedback() const { return false; }
82
83#if SLATE_CHECK_UOBJECT_RENDER_RESOURCES
84 virtual void CheckForStaleResources() const { }
85 bool Debug_IsDestroyed() const { return DestroyState != 0x21; }
86
88 virtual ~FSlateShaderResource() { DestroyState = 0x84; }
89#else
90 inline void CheckForStaleResources() const { }
91 bool Debug_IsDestroyed() const { return false; }
92
94 virtual ~FSlateShaderResource() = default;
95#endif
96
97
98#if SLATE_CHECK_UOBJECT_RENDER_RESOURCES
99private:
100 // Use an int, instead of a bool, to make sure the value is "exactly" what it's set in the destructor.
101 uint8 DestroyState = 0x21;
102#endif
103};
104
121
129{
130public:
131
134
137
140
143
146
149 : StartUV(0.0f, 0.0f)
150 , SizeUV(1.0f, 1.0f)
151 , Resource(nullptr)
152 , ActualSize(0, 0)
153 { }
154
156 {
157 if( HandleData.IsValid() )
158 {
159 // Handles exist for this proxy.
160 // Null out the proxy to invalidate all handles
161 HandleData->Proxy = nullptr;
162 }
163 }
164};
165
166
170template <typename ResourceType>
172 : public FSlateShaderResource
173{
174public:
175
178
187
188 virtual ~TSlateTexture() { }
189
190public:
191
197 ResourceType& GetTypedResource()
198 {
199 return ShaderResource;
200 }
201
202public:
203
204 // FSlateShaderResource interface
205 virtual ESlateShaderResource::Type GetType() const override
206 {
208 }
209
210protected:
211
212 // Holds the resource.
213 ResourceType ShaderResource;
214};
215
216class UE_DEPRECATED(5.5, "This is no longer used.") IViewportRenderTargetProvider
217{
218public:
219 virtual FSlateShaderResource* GetViewportRenderTargetTexture() = 0;
220};
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
#define DECLARE_MEMORY_STAT_EXTERN(CounterName, StatId, GroupId, API)
Definition Stats.h:687
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
ESlatePostRT
Definition SlateRendererTypes.h:15
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition SlateShaderResource.h:129
~FSlateShaderResourceProxy()
Definition SlateShaderResource.h:155
FSlateShaderResourceProxy()
Definition SlateShaderResource.h:148
FVector2f SizeUV
Definition SlateShaderResource.h:136
FIntPoint ActualSize
Definition SlateShaderResource.h:142
FSlateShaderResource * Resource
Definition SlateShaderResource.h:139
TSharedPtr< FSlateSharedHandleData > HandleData
Definition SlateShaderResource.h:145
FVector2f StartUV
Definition SlateShaderResource.h:133
Definition SlateShaderResource.h:44
virtual uint32 GetHeight() const =0
virtual ~FSlateShaderResource()=default
virtual uint32 GetWidth() const =0
void CheckForStaleResources() const
Definition SlateShaderResource.h:90
virtual ESlatePostRT GetUsedSlatePostBuffers() const
Definition SlateShaderResource.h:76
virtual bool RequiresVirtualTextureFeedback() const
Definition SlateShaderResource.h:81
bool Debug_IsDestroyed() const
Definition SlateShaderResource.h:91
virtual bool IsResourceValid() const
Definition SlateShaderResource.h:71
virtual ESlateShaderResource::Type GetType() const =0
Definition SlateShaderResource.h:111
FSlateSharedHandleData(FSlateShaderResourceProxy *InProxy=nullptr)
Definition SlateShaderResource.h:113
FSlateShaderResourceProxy * Proxy
Definition SlateShaderResource.h:119
Definition SharedPointer.h:692
UE_FORCEINLINE_HINT const bool IsValid() const
Definition SharedPointer.h:1085
Definition SlateShaderResource.h:173
ResourceType ShaderResource
Definition SlateShaderResource.h:213
ResourceType & GetTypedResource()
Definition SlateShaderResource.h:197
virtual ~TSlateTexture()
Definition SlateShaderResource.h:188
virtual ESlateShaderResource::Type GetType() const override
Definition SlateShaderResource.h:205
TSlateTexture(ResourceType &InShaderResource)
Definition SlateShaderResource.h:184
TSlateTexture()
Definition SlateShaderResource.h:177
Definition SlateShaderResource.h:16
Type
Definition SlateShaderResource.h:21
@ Material
Definition SlateShaderResource.h:29
@ Invalid
Definition SlateShaderResource.h:35
@ PostProcess
Definition SlateShaderResource.h:32
@ TextureObject
Definition SlateShaderResource.h:26
@ NativeTexture
Definition SlateShaderResource.h:23
Definition IntPoint.h:25