3832.diff (29,747 bytes)
Index: Plugins/NoesisGUI/Source/NoesisBlueprint/Private/K2Node_NoesisAssignAndNotify.cpp
===================================================================
--- Plugins/NoesisGUI/Source/NoesisBlueprint/Private/K2Node_NoesisAssignAndNotify.cpp (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisBlueprint/Private/K2Node_NoesisAssignAndNotify.cpp (revision 14747)
@@ -114,7 +114,11 @@
// See if the native property has a tooltip
SubTooltip = PropertyTooltip;
FString TooltipName = FString::Printf(TEXT("%s.%s"), *VarName.ToString(), *TooltipMetaKey.ToString());
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
FText::FindText(*VariableProperty->GetFullGroupName(true), *TooltipName, SubTooltip);
+#else
+ FText::FindTextInLiveTable_Advanced(*VariableProperty->GetFullGroupName(true), *TooltipName, SubTooltip);
+#endif
}
}
else if (SourceClass)
Index: Plugins/NoesisGUI/Source/NoesisEditor/Private/NoesisRiveThumbnailRenderer.cpp
===================================================================
--- Plugins/NoesisGUI/Source/NoesisEditor/Private/NoesisRiveThumbnailRenderer.cpp (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisEditor/Private/NoesisRiveThumbnailRenderer.cpp (revision 14747)
@@ -33,7 +33,7 @@
if (Rive != nullptr)
{
FIntRect ViewportRect(X, Y, X + Width, Y + Height);
- const FTexture2DRHIRef& BackBuffer = Viewport->GetRenderTargetTexture();
+ const FTextureRHIRef& BackBuffer = Viewport->GetRenderTargetTexture();
Rive->RenderThumbnail(ViewportRect, BackBuffer);
}
}
Index: Plugins/NoesisGUI/Source/NoesisEditor/Private/NoesisXamlThumbnailRenderer.cpp
===================================================================
--- Plugins/NoesisGUI/Source/NoesisEditor/Private/NoesisXamlThumbnailRenderer.cpp (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisEditor/Private/NoesisXamlThumbnailRenderer.cpp (revision 14747)
@@ -32,7 +32,7 @@
if (Xaml != nullptr)
{
FIntRect ViewportRect(X, Y, X + Width, Y + Height);
- const FTexture2DRHIRef& BackBuffer = Viewport->GetRenderTargetTexture();
+ const FTextureRHIRef& BackBuffer = Viewport->GetRenderTargetTexture();
Xaml->RenderThumbnail(ViewportRect, BackBuffer);
}
}
Index: Plugins/NoesisGUI/Source/NoesisRuntime/Classes/NoesisRive.h
===================================================================
--- Plugins/NoesisGUI/Source/NoesisRuntime/Classes/NoesisRive.h (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisRuntime/Classes/NoesisRive.h (revision 14747)
@@ -48,7 +48,7 @@
#endif
#if WITH_EDITOR
- void RenderThumbnail(FIntRect ViewportRect, const FTexture2DRHIRef& BackBuffer);
+ void RenderThumbnail(FIntRect ViewportRect, const FTextureRHIRef& BackBuffer);
void DestroyThumbnailRenderData();
#endif
Index: Plugins/NoesisGUI/Source/NoesisRuntime/Classes/NoesisXaml.h
===================================================================
--- Plugins/NoesisGUI/Source/NoesisRuntime/Classes/NoesisXaml.h (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisRuntime/Classes/NoesisXaml.h (revision 14747)
@@ -76,7 +76,7 @@
FString GetXamlUri() const;
#if WITH_EDITOR
- void RenderThumbnail(FIntRect, const FTexture2DRHIRef&);
+ void RenderThumbnail(FIntRect, const FTextureRHIRef&);
void DestroyThumbnailRenderData();
#endif
Index: Plugins/NoesisGUI/Source/NoesisRuntime/Private/Extensions/BackgroundImage.cpp
===================================================================
--- Plugins/NoesisGUI/Source/NoesisRuntime/Private/Extensions/BackgroundImage.cpp (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisRuntime/Private/Extensions/BackgroundImage.cpp (revision 14747)
@@ -34,7 +34,7 @@
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-void BackgroundImage::SetBackgroundImageTexture(FRHITexture2D* Texture)
+void BackgroundImage::SetBackgroundImageTexture(FRHITexture* Texture)
{
if (!NoesisBackgroundImageTexture || FNoesisRenderDevice::GetRHITexture(NoesisBackgroundImageTexture) != Texture)
{
Index: Plugins/NoesisGUI/Source/NoesisRuntime/Private/Extensions/LocTextExtension.cpp
===================================================================
--- Plugins/NoesisGUI/Source/NoesisRuntime/Private/Extensions/LocTextExtension.cpp (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisRuntime/Private/Extensions/LocTextExtension.cpp (revision 14747)
@@ -6,6 +6,9 @@
#include "Extensions/LocTextExtension.h"
#include "NsGui/ContentPropertyMetaData.h"
+// Core includes
+#include "Misc/EngineVersionComparison.h"
+
////////////////////////////////////////////////////////////////////////////////////////////////////
class LocTextExpression : public Noesis::Expression
{
@@ -108,7 +111,11 @@
}
FText Text;
FString Source(UTF8_TO_TCHAR(GetSource()));
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
FText::FindText(UTF8_TO_TCHAR(ns), UTF8_TO_TCHAR(GetKey()), Text, &Source);
+#else
+ FText::FindTextInLiveTable_Advanced(UTF8_TO_TCHAR(ns), UTF8_TO_TCHAR(GetKey()), Text, &Source);
+#endif
return Text.ToString();
}
Index: Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisFunctionLibrary.cpp
===================================================================
--- Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisFunctionLibrary.cpp (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisFunctionLibrary.cpp (revision 14747)
@@ -195,7 +195,11 @@
// Since NewItem isn't really an int, step the stack manually
const FProperty* InnerProp = ArrayProperty->Inner;
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
const int32 PropertySize = InnerProp->ElementSize * InnerProp->ArrayDim;
+#else
+ const int32 PropertySize = InnerProp->GetElementSize() * InnerProp->ArrayDim;
+#endif
void* StorageSpace = FMemory_Alloca(PropertySize);
InnerProp->InitializeValue(StorageSpace);
@@ -226,7 +230,11 @@
// Since NewItem isn't really an int, step the stack manually
const FProperty* InnerProp = ArrayProperty->Inner;
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
const int32 PropertySize = InnerProp->ElementSize * InnerProp->ArrayDim;
+#else
+ const int32 PropertySize = InnerProp->GetElementSize() * InnerProp->ArrayDim;
+#endif
void* StorageSpace = FMemory_Alloca(PropertySize);
InnerProp->InitializeValue(StorageSpace);
@@ -314,7 +322,11 @@
// Since NewItem isn't really an int, step the stack manually
const FProperty* InnerProp = ArrayProperty->Inner;
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
const int32 PropertySize = InnerProp->ElementSize * InnerProp->ArrayDim;
+#else
+ const int32 PropertySize = InnerProp->GetElementSize() * InnerProp->ArrayDim;
+#endif
void* StorageSpace = FMemory_Alloca(PropertySize);
InnerProp->InitializeValue(StorageSpace);
@@ -372,7 +384,11 @@
}
// Since Item isn't really an int, step the stack manually
const FProperty* InnerProp = ArrayProperty->Inner;
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
const int32 PropertySize = InnerProp->ElementSize * InnerProp->ArrayDim;
+#else
+ const int32 PropertySize = InnerProp->GetElementSize() * InnerProp->ArrayDim;
+#endif
void* StorageSpace = FMemory_Alloca(PropertySize);
InnerProp->InitializeValue(StorageSpace);
@@ -385,7 +401,11 @@
const FBoolProperty* BoolProperty = CastField<const FBoolProperty>(InnerProp);
if (BoolProperty)
{
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
ensure((BoolProperty->ElementSize * BoolProperty->ArrayDim) == sizeof(uint8));
+#else
+ ensure((BoolProperty->GetElementSize() * BoolProperty->ArrayDim) == sizeof(uint8));
+#endif
BoolProperty->SetPropertyValue(ItemPtr, 0 != *(reinterpret_cast<uint8*>(ItemPtr)));
}
P_NATIVE_BEGIN;
@@ -478,7 +498,11 @@
// Since NewItem isn't really an int, step the stack manually
const FProperty* InnerProp = ArrayProperty->Inner;
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
const int32 PropertySize = InnerProp->ElementSize * InnerProp->ArrayDim;
+#else
+ const int32 PropertySize = InnerProp->GetElementSize() * InnerProp->ArrayDim;
+#endif
void* StorageSpace = FMemory_Alloca(PropertySize);
InnerProp->InitializeValue(StorageSpace);
@@ -523,7 +547,11 @@
// Since Key and Value aren't really an int, step the stack manually
const FProperty* CurrKeyProp = MapProperty->KeyProp;
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
const int32 KeyPropertySize = CurrKeyProp->ElementSize * CurrKeyProp->ArrayDim;
+#else
+ const int32 KeyPropertySize = CurrKeyProp->GetElementSize() * CurrKeyProp->ArrayDim;
+#endif
void* KeyStorageSpace = FMemory_Alloca(KeyPropertySize);
CurrKeyProp->InitializeValue(KeyStorageSpace);
@@ -531,7 +559,11 @@
Stack.StepCompiledIn<FProperty>(KeyStorageSpace);
const FProperty* CurrValueProp = MapProperty->ValueProp;
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
const int32 ValuePropertySize = CurrValueProp->ElementSize * CurrValueProp->ArrayDim;
+#else
+ const int32 ValuePropertySize = CurrValueProp->GetElementSize() * CurrValueProp->ArrayDim;
+#endif
void* ValueStorageSpace = FMemory_Alloca(ValuePropertySize);
CurrValueProp->InitializeValue(ValueStorageSpace);
@@ -567,7 +599,11 @@
// Since Key and Value aren't really an int, step the stack manually
const FProperty* CurrKeyProp = MapProperty->KeyProp;
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
const int32 KeyPropertySize = CurrKeyProp->ElementSize * CurrKeyProp->ArrayDim;
+#else
+ const int32 KeyPropertySize = CurrKeyProp->GetElementSize() * CurrKeyProp->ArrayDim;
+#endif
void* KeyStorageSpace = FMemory_Alloca(KeyPropertySize);
CurrKeyProp->InitializeValue(KeyStorageSpace);
Index: Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisInstance.cpp
===================================================================
--- Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisInstance.cpp (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisInstance.cpp (revision 14747)
@@ -142,7 +142,11 @@
FIntRect GViewRect;
FMatrix GViewProjectionMatrix;
uint32 GSlateElementCount = 0;
-FTexture2DRHIRef GDepthStencilTarget;
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
+FTextureRHIRef GDepthStencilTarget;
+#else
+TRefCountPtr<IPooledRenderTarget> GDepthStencilTarget;
+#endif
class FNoesisSlateElement : public ICustomSlateElement
{
@@ -155,7 +159,11 @@
}
// ICustomSlateElement interface
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
virtual void DrawRenderThread(FRHICommandListImmediate& RHICmdList, const void* InWindowBackBuffer) override;
+#else
+ virtual void Draw_RenderThread(FRDGBuilder& GraphBuilder, const FDrawPassInputs& Inputs) override;
+#endif
// End of ICustomSlateElement interface
void UpdateRenderTree() const;
@@ -189,12 +197,14 @@
{
}
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
+
void FNoesisSlateElement::DrawRenderThread(FRHICommandListImmediate& RHICmdList, const void* InWindowBackBuffer)
{
ViewRect = GViewRect;
ViewProjectionMatrix = GViewProjectionMatrix;
- FTexture2DRHIRef ColorTarget = *(FTexture2DRHIRef*)InWindowBackBuffer;
+ FTextureRHIRef ColorTarget = *(FTextureRHIRef*)InWindowBackBuffer;
if (!GDepthStencilTarget.IsValid() || GDepthStencilTarget->GetSizeX() != ColorTarget->GetSizeX() || GDepthStencilTarget->GetSizeY() != ColorTarget->GetSizeY() || GDepthStencilTarget->GetNumSamples() != ColorTarget->GetNumSamples())
{
@@ -239,6 +249,64 @@
RHICmdList.EndRenderPass();
}
+#else
+
+void FNoesisSlateElement::Draw_RenderThread(FRDGBuilder& GraphBuilder, const FDrawPassInputs& Inputs)
+{
+ const FRDGTextureDesc& ColorTargetDesc = Inputs.OutputTexture != nullptr ? Inputs.OutputTexture->Desc : FRDGTextureDesc();
+
+ ViewRect = GViewRect;
+ ViewProjectionMatrix = GViewProjectionMatrix;
+ EngineGamma = (!GIsEditor && (ColorTargetDesc.Format == PF_FloatRGBA)/* && (Params.bIsHDR == false)*/) ? 1.0f : EngineGamma;
+
+ FIntVector ColorTargetSize = ColorTargetDesc.GetSize();
+ if (!GDepthStencilTarget.IsValid() || GDepthStencilTarget->GetDesc().GetSize() != ColorTargetSize)
+ {
+ GDepthStencilTarget.SafeRelease();
+ uint32 SizeX = ColorTargetSize.X;
+ uint32 SizeY = ColorTargetSize.Y;
+ EPixelFormat Format = PF_DepthStencil;
+ uint32 NumMips = 1;
+ uint32 NumSamples = ColorTargetDesc.NumSamples;
+ ETextureCreateFlags TargetableTextureFlags = TexCreate_DepthStencilTargetable | TexCreate_Memoryless;
+ ERHIAccess Access = ERHIAccess::DSVWrite;
+ FClearValueBinding ClearValue(0.f, 0);
+ const TCHAR* Name = TEXT("Noesis.RenderTarget.Onscreen_DS");
+
+ auto DepthStencilTargetDesc = FRHITextureCreateDesc::Create2D(Name)
+ .SetExtent(SizeX, SizeY)
+ .SetFormat(Format)
+ .SetNumMips(NumMips)
+ .SetNumSamples(NumSamples)
+ .SetFlags(TargetableTextureFlags)
+ .SetInitialState(Access)
+ .SetClearValue(ClearValue);
+ auto DepthStencilTarget = RHICreateTexture(DepthStencilTargetDesc);
+
+ NOESIS_BIND_DEBUG_TEXTURE_LABEL(DepthStencilTarget, Name);
+
+ GDepthStencilTarget = CreateRenderTarget(DepthStencilTarget, Name);
+ }
+
+ // Clear the stencil buffer
+ SCOPE_CYCLE_COUNTER(STAT_NoesisInstance_Draw);
+
+ FRenderTargetParameters* PassParameters = GraphBuilder.AllocParameters<FRenderTargetParameters>();
+ {
+ PassParameters->RenderTargets[0] = FRenderTargetBinding(Inputs.OutputTexture, ERenderTargetLoadAction::ELoad);
+ PassParameters->RenderTargets.DepthStencil = FDepthStencilBinding(GraphBuilder.RegisterExternalTexture(GDepthStencilTarget), ERenderTargetLoadAction::ENoAction, ERenderTargetLoadAction::EClear, FExclusiveDepthStencil::DepthNop_StencilWrite);
+ }
+ GraphBuilder.AddPass(RDG_EVENT_NAME("NoesisOnScreen"), PassParameters, ERDGPassFlags::Raster | ERDGPassFlags::NeverCull,
+ [this](FRHICommandListImmediate& RHICmdList)
+ {
+ RHICmdList.SetViewport(Left, Top, 0.0f, Right, Bottom, 1.0f);
+ RenderOnscreen(RHICmdList, false);
+ }
+ );
+}
+
+#endif
+
void FNoesisSlateElement::UpdateRenderTree() const
{
if ((Renderer == nullptr) || (RenderDevice == nullptr))
Index: Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisLangServerRenderer.cpp
===================================================================
--- Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisLangServerRenderer.cpp (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisLangServerRenderer.cpp (revision 14747)
@@ -118,7 +118,7 @@
RenderDevice->ResolveRenderTarget(RenderTarget, &Tile, 1);
Noesis::Texture* Texture = RenderTarget->GetTexture();
- FTexture2DRHIRef ColorTarget = FNoesisRenderDevice::GetRHITexture(Texture);
+ FTextureRHIRef ColorTarget = FNoesisRenderDevice::GetRHITexture(Texture);
uint32 DstStride = Width * 4;
Contents.AddUninitialized(Height * DstStride);
uint8* DstPixels = Contents.GetData();
Index: Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisRive.cpp
===================================================================
--- Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisRive.cpp (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisRive.cpp (revision 14747)
@@ -63,7 +63,7 @@
#endif // WITH_EDITORONLY_DATA
#if WITH_EDITOR
-void UNoesisRive::RenderThumbnail(FIntRect ViewportRect, const FTexture2DRHIRef& BackBuffer)
+void UNoesisRive::RenderThumbnail(FIntRect ViewportRect, const FTextureRHIRef& BackBuffer)
{
if (ThumbnailView == nullptr)
{
Index: Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisRiveControl.cpp
===================================================================
--- Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisRiveControl.cpp (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisRiveControl.cpp (revision 14747)
@@ -5,7 +5,7 @@
#if defined(_MSC_VER)
#pragma warning(push)
-#pragma warning(disable:4426)
+#pragma warning(disable: 4265 4426)
#endif
#pragma push_macro("PI")
Index: Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisThumbnailRenderer.cpp
===================================================================
--- Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisThumbnailRenderer.cpp (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisThumbnailRenderer.cpp (revision 14747)
@@ -40,7 +40,7 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
void FNoesisThumbnailRenderer::RenderView(Noesis::IView* View, UWorld* World, FIntRect ViewportRect,
- const FTexture2DRHIRef& BackBuffer)
+ const FTextureRHIRef& BackBuffer)
{
if (View == nullptr || World == nullptr || BackBuffer == nullptr) return;
@@ -85,12 +85,12 @@
ETextureCreateFlags TargetableTextureFlags = TexCreate_DepthStencilTargetable | TexCreate_Memoryless;
ERHIAccess Access = ERHIAccess::DSVWrite;
FClearValueBinding ClearValue(0.f, 0);
- FTexture2DRHIRef ColorTarget = BackBuffer;
+ FTextureRHIRef ColorTarget = BackBuffer;
const TCHAR* Name = TEXT("Noesis.RenderTarget.Thumbnail_DS");
#if UE_VERSION_OLDER_THAN(5, 1, 0)
FRHIResourceCreateInfo CreateInfo(Name);
CreateInfo.ClearValueBinding = ClearValue;
- FTexture2DRHIRef DepthStencilTarget = RHICreateTexture2D(SizeX, SizeY,
+ FTextureRHIRef DepthStencilTarget = RHICreateTexture2D(SizeX, SizeY,
(uint8)Format, NumMips, NumSamples, TargetableTextureFlags, Access, CreateInfo);
#else
auto DepthStencilTargetDesc = FRHITextureCreateDesc::Create2D(Name)
@@ -101,7 +101,7 @@
.SetFlags(TargetableTextureFlags)
.SetInitialState(Access)
.SetClearValue(ClearValue);
- FTexture2DRHIRef DepthStencilTarget = RHICreateTexture(DepthStencilTargetDesc);
+ FTextureRHIRef DepthStencilTarget = RHICreateTexture(DepthStencilTargetDesc);
#endif
NOESIS_BIND_DEBUG_TEXTURE_LABEL(DepthStencilTarget, Name);
Index: Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisThumbnailRenderer.h
===================================================================
--- Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisThumbnailRenderer.h (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisThumbnailRenderer.h (revision 14747)
@@ -19,7 +19,7 @@
{
static Noesis::Ptr<Noesis::IView> CreateView(Noesis::FrameworkElement* Content);
static void RenderView(Noesis::IView* View, UWorld* World, FIntRect ViewportRect,
- const FTexture2DRHIRef& BackBuffer);
+ const FTextureRHIRef& BackBuffer);
};
Index: Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisTypeClass.cpp
===================================================================
--- Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisTypeClass.cpp (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisTypeClass.cpp (revision 14747)
@@ -15,6 +15,10 @@
#include "UObject/UObjectThreadContext.h"
#include "UObject/FieldIterator.h"
#include "UObject/Package.h"
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
+#else
+#include "StructUtils/UserDefinedStruct.h"
+#endif
// Engine includes
#include "Engine/Texture2D.h"
@@ -30,6 +34,10 @@
#else
#include "MaterialDomain.h"
#endif
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
+#include "Engine/UserDefinedStruct.h"
+#else
+#endif
// MediaAsset includes
#include "MediaTexture.h"
Index: Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisXaml.cpp
===================================================================
--- Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisXaml.cpp (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisRuntime/Private/NoesisXaml.cpp (revision 14747)
@@ -116,7 +116,7 @@
}
#if WITH_EDITOR
-void UNoesisXaml::RenderThumbnail(FIntRect ViewportRect, const FTexture2DRHIRef& BackBuffer)
+void UNoesisXaml::RenderThumbnail(FIntRect ViewportRect, const FTextureRHIRef& BackBuffer)
{
if (ThumbnailView == nullptr)
{
Index: Plugins/NoesisGUI/Source/NoesisRuntime/Private/Render/NoesisRenderDevice.cpp
===================================================================
--- Plugins/NoesisGUI/Source/NoesisRuntime/Private/Render/NoesisRenderDevice.cpp (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisRuntime/Private/Render/NoesisRenderDevice.cpp (revision 14747)
@@ -99,7 +99,7 @@
ShaderResourceTexture = Texture;
}
- FRHITexture2D* GetTexture2D()
+ FRHITexture* GetTexture2D()
{
#if UE_VERSION_OLDER_THAN(5, 1, 0)
if (ShaderResourceTexture != nullptr)
@@ -214,22 +214,22 @@
{
public:
- FNoesisRenderTarget(FRHITexture2D* InShaderResourceTexture, FRHITexture2D* InColorTarget, FRHITexture2D* InDepthStencilTarget)
+ FNoesisRenderTarget(FRHITexture* InShaderResourceTexture, FRHITexture* InColorTarget, FRHITexture* InDepthStencilTarget)
: Texture(Noesis::MakePtr<FNoesisTexture>(InShaderResourceTexture)), ColorTarget(InColorTarget), DepthStencilTarget(InDepthStencilTarget)
{
}
- FRHITexture2D* GetShaderResourceTexture()
+ FRHITexture* GetShaderResourceTexture()
{
return Texture->GetTexture2D();
}
- FRHITexture2D* GetColorTarget()
+ FRHITexture* GetColorTarget()
{
return ColorTarget;
}
- FRHITexture2D* GetDepthStencilTarget()
+ FRHITexture* GetDepthStencilTarget()
{
return DepthStencilTarget;
}
@@ -236,7 +236,7 @@
void SetRenderTarget(FRHICommandList* RHICmdList)
{
- FRHITexture2D* ShaderResourceTexture = Texture->GetTexture2D();
+ FRHITexture* ShaderResourceTexture = Texture->GetTexture2D();
bool NeedsResolve = (ColorTarget != ShaderResourceTexture) && ColorTarget->IsMultisampled();
if (ColorTarget == ShaderResourceTexture)
{
@@ -292,7 +292,7 @@
void ResolveRenderTarget(FRHICommandList* RHICmdList, const Noesis::Tile* Tiles, uint32 NumTiles)
{
RHICmdList->EndRenderPass();
- FRHITexture2D* ShaderResourceTexture = Texture->GetTexture2D();
+ FRHITexture* ShaderResourceTexture = Texture->GetTexture2D();
if (ColorTarget != ShaderResourceTexture)
{
if (!ColorTarget->IsMultisampled())
@@ -336,8 +336,8 @@
private:
Noesis::Ptr<FNoesisTexture> Texture;
- FTexture2DRHIRef ColorTarget;
- FTexture2DRHIRef DepthStencilTarget;
+ FTextureRHIRef ColorTarget;
+ FTextureRHIRef DepthStencilTarget;
};
static TShaderRef<FNoesisMaterialPSBase> GetMaterialPixelShader(const FMaterial* Material, Noesis::Shader::Enum ShaderType, bool IsLinearColor, bool GammaCorrection)
@@ -1810,7 +1810,7 @@
return Noesis::MakePtr<FNoesisTexture>(Texture, IgnoreAlpha);
}
-FRHITexture2D* FNoesisRenderDevice::GetRHITexture(Noesis::Texture* InTexture)
+FRHITexture* FNoesisRenderDevice::GetRHITexture(Noesis::Texture* InTexture)
{
FNoesisTexture* Texture = (FNoesisTexture*)InTexture;
return Texture->GetTexture2D();
@@ -1895,8 +1895,8 @@
bool bForceSeparateTargetAndShaderResource,
bool bForceSharedTargetAndShaderResource,
FClearValueBinding ClearValue,
- FTexture2DRHIRef& OutTargetableTexture,
- FTexture2DRHIRef& OutShaderResourceTexture,
+ FTextureRHIRef& OutTargetableTexture,
+ FTextureRHIRef& OutShaderResourceTexture,
uint32 NumSamples = 1
)
{
@@ -1981,7 +1981,7 @@
}
}
-static Noesis::Ptr<Noesis::RenderTarget> CreateRenderTarget(const TCHAR* Name, uint32 Width, uint32 Height, uint32 SampleCount, FRHITexture2D* DepthStencilTarget, bool IsLinearColor)
+static Noesis::Ptr<Noesis::RenderTarget> CreateRenderTarget(const TCHAR* Name, uint32 Width, uint32 Height, uint32 SampleCount, FRHITexture* DepthStencilTarget, bool IsLinearColor)
{
EPixelFormat Format = PF_R8G8B8A8;
uint32 NumMips = 1;
@@ -1989,8 +1989,8 @@
ETextureCreateFlags TargetableTextureFlags = TexCreate_RenderTargetable | (IsLinearColor ? TexCreate_SRGB : TexCreate_None);
bool bForceSeparateTargetAndShaderResource = false;
FClearValueBinding ClearValue;
- FTexture2DRHIRef ColorTarget;
- FTexture2DRHIRef ShaderResourceTexture;
+ FTextureRHIRef ColorTarget;
+ FTextureRHIRef ShaderResourceTexture;
NoesisCreateTargetableShaderResource2D(Name, Width, Height, Format, NumMips, Flags, TargetableTextureFlags, bForceSeparateTargetAndShaderResource, false, ClearValue, ColorTarget, ShaderResourceTexture, SampleCount);
FNoesisRenderTarget* RenderTarget = new FNoesisRenderTarget(ShaderResourceTexture, ColorTarget, DepthStencilTarget);
@@ -2002,7 +2002,7 @@
{
TStringBuilder<64> Name;
Name.Append(TEXT("Noesis.RenderTarget.")).Append(UTF8_TO_TCHAR(Label));
- FTexture2DRHIRef DepthStencilTarget;
+ FTextureRHIRef DepthStencilTarget;
if (NeedsStencil)
{
@@ -2040,11 +2040,11 @@
Name.Append(TEXT("Noesis.RenderTarget.")).Append(UTF8_TO_TCHAR(Label));
FNoesisRenderTarget* SharedRenderTarget = (FNoesisRenderTarget*)InSharedRenderTarget;
- FRHITexture2D* ColorTarget = SharedRenderTarget->GetColorTarget();
+ FRHITexture* ColorTarget = SharedRenderTarget->GetColorTarget();
uint32 Width = ColorTarget->GetSizeX();
uint32 Height = ColorTarget->GetSizeY();
uint32 SampleCount = ColorTarget->GetNumSamples();
- FRHITexture2D* DepthStencilTarget = SharedRenderTarget->GetDepthStencilTarget();
+ FRHITexture* DepthStencilTarget = SharedRenderTarget->GetDepthStencilTarget();
return ::CreateRenderTarget(*Name, Width, Height, SampleCount, DepthStencilTarget, IsLinearColor);
}
@@ -2063,7 +2063,7 @@
ERHIAccess Access = ERHIAccess::SRVGraphics;
#if UE_VERSION_OLDER_THAN(5, 1, 0)
FRHIResourceCreateInfo CreateInfo(*Name);
- FTexture2DRHIRef ShaderResourceTexture = RHICreateTexture2D(SizeX, SizeY, Format, NumMips, NumSamples, Flags, Access, CreateInfo);
+ FTextureRHIRef ShaderResourceTexture = RHICreateTexture2D(SizeX, SizeY, Format, NumMips, NumSamples, Flags, Access, CreateInfo);
#else
auto ShaderResourceTextureDesc = FRHITextureCreateDesc::Create2D(*Name)
.SetExtent(SizeX, SizeY)
@@ -2072,7 +2072,7 @@
.SetNumSamples(NumSamples)
.SetFlags(Flags)
.SetInitialState(Access);
- FTexture2DRHIRef ShaderResourceTexture = RHICreateTexture(ShaderResourceTextureDesc);
+ FTextureRHIRef ShaderResourceTexture = RHICreateTexture(ShaderResourceTextureDesc);
#endif
NOESIS_BIND_DEBUG_TEXTURE_LABEL(ShaderResourceTexture, *Name);
@@ -2140,9 +2140,15 @@
void FNoesisRenderDevice::SetRenderTarget(Noesis::RenderTarget* Surface)
{
check(RHICmdList);
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
#if WANTS_DRAW_MESH_EVENTS
BEGIN_DRAW_EVENTF(*RHICmdList, SetRenderTarget, SetRenderTargetEvent, TEXT("SetRenderTarget"));
#endif
+#else
+#if WITH_RHI_BREADCRUMBS
+ SetRenderTargetBreadcrumb.Emplace(*RHICmdList, FRHIBreadcrumbData(__FILE__, __LINE__, TStatId(), NAME_None), TEXT("SetRenderTarget"));
+#endif
+#endif
check(Surface);
FNoesisRenderTarget* RenderTarget = (FNoesisRenderTarget*)Surface;
@@ -2149,7 +2155,7 @@
check(RHICmdList->IsOutsideRenderPass());
RenderTarget->SetRenderTarget(RHICmdList);
- FRHITexture2D* ColorTarget = RenderTarget->GetColorTarget();
+ FRHITexture* ColorTarget = RenderTarget->GetColorTarget();
auto ColorTargetSize = ColorTarget->GetSizeXY();
CreateView(0, 0, ColorTargetSize.X, ColorTargetSize.Y, FIntRect(0, 0, ColorTargetSize.X, ColorTargetSize.Y), FMatrix::Identity);
}
@@ -2176,9 +2182,16 @@
FNoesisRenderTarget* RenderTarget = (FNoesisRenderTarget*)Surface;
RenderTarget->ResolveRenderTarget(RHICmdList, Tiles, NumTiles);
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
#if WANTS_DRAW_MESH_EVENTS
STOP_DRAW_EVENT(SetRenderTargetEvent);
#endif
+#else
+#if WITH_RHI_BREADCRUMBS
+ SetRenderTargetBreadcrumb->End(*RHICmdList);
+ SetRenderTargetBreadcrumb.Reset();
+#endif
+#endif
DestroyView();
}
Index: Plugins/NoesisGUI/Source/NoesisRuntime/Private/Render/NoesisRenderDevice.h
===================================================================
--- Plugins/NoesisGUI/Source/NoesisRuntime/Private/Render/NoesisRenderDevice.h (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisRuntime/Private/Render/NoesisRenderDevice.h (revision 14747)
@@ -65,9 +65,15 @@
uint32 BlurConstantsHash = 0;
uint32 ShadowConstantsHash = 0;
+#if UE_VERSION_OLDER_THAN(5, 5, 0)
#if WANTS_DRAW_MESH_EVENTS
FDrawEvent SetRenderTargetEvent;
#endif
+#else
+#if WITH_RHI_BREADCRUMBS
+ TOptional<FRHIBreadcrumbEventManual> SetRenderTargetBreadcrumb;
+#endif
+#endif
FNoesisRenderDevice(bool LinearColor);
virtual ~FNoesisRenderDevice();
@@ -116,7 +122,7 @@
static Noesis::Ptr<Noesis::Texture> CreateTexture(FRHITexture* RHITexture, bool IgnoreAlpha);
static Noesis::Ptr<Noesis::Texture> CreateTexture(class UTexture* Texture);
- static FRHITexture2D* GetRHITexture(Noesis::Texture* Texture); // You need to add a reference if you want to keep the object.
+ static FRHITexture* GetRHITexture(Noesis::Texture* Texture); // You need to add a reference if you want to keep the object.
static void* CreateMaterial(class UMaterialInterface* Material);
static void DestroyMaterial(void* Material);
Index: Plugins/NoesisGUI/Source/NoesisRuntime/Public/Extensions/BackgroundImage.h
===================================================================
--- Plugins/NoesisGUI/Source/NoesisRuntime/Public/Extensions/BackgroundImage.h (revision 14746)
+++ Plugins/NoesisGUI/Source/NoesisRuntime/Public/Extensions/BackgroundImage.h (revision 14747)
@@ -22,7 +22,7 @@
BackgroundImage();
~BackgroundImage();
- static void SetBackgroundImageTexture(FRHITexture2D* Texture);
+ static void SetBackgroundImageTexture(FRHITexture* Texture);
static void SetBackgroundImageSize(const FIntPoint& Size);
private: