From 3d7d52e779fe40c0352870f5def19e9b98e3081d Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Fri, 13 May 2022 20:17:06 +0200 Subject: [PATCH] Fix Vulkan crash when using Blur Panel in Screen Space canvas --- Source/Engine/Graphics/Textures/GPUTexture.h | 3 ++- Source/Engine/Render2D/Render2D.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/Engine/Graphics/Textures/GPUTexture.h b/Source/Engine/Graphics/Textures/GPUTexture.h index 28007196d..6c4d03063 100644 --- a/Source/Engine/Graphics/Textures/GPUTexture.h +++ b/Source/Engine/Graphics/Textures/GPUTexture.h @@ -36,7 +36,8 @@ protected: _parent = parent; _format = format; _msaa = msaa; - LastRenderTime = &parent->LastRenderTime; + if (parent) + LastRenderTime = &parent->LastRenderTime; } public: diff --git a/Source/Engine/Render2D/Render2D.cpp b/Source/Engine/Render2D/Render2D.cpp index 8c6760ba8..9f0c40367 100644 --- a/Source/Engine/Render2D/Render2D.cpp +++ b/Source/Engine/Render2D/Render2D.cpp @@ -1053,10 +1053,10 @@ void DrawBatch(int32 startIndex, int32 count) } // Skip if no chance to render anything + renderTargetWidth = Math::AlignDown(renderTargetWidth, 4); + renderTargetHeight = Math::AlignDown(renderTargetHeight, 4); if (renderTargetWidth <= 0 || renderTargetHeight <= 0) - { return; - } // Get temporary textures auto desc = GPUTextureDescription::New2D(renderTargetWidth, renderTargetHeight, PS_Blur_Format);