Fix Vulkan crash when using Blur Panel in Screen Space canvas

This commit is contained in:
Wojtek Figat
2022-05-13 20:17:06 +02:00
parent 94f54abb62
commit 3d7d52e779
2 changed files with 4 additions and 3 deletions

View File

@@ -36,7 +36,8 @@ protected:
_parent = parent;
_format = format;
_msaa = msaa;
LastRenderTime = &parent->LastRenderTime;
if (parent)
LastRenderTime = &parent->LastRenderTime;
}
public:

View File

@@ -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);