From 33ce17c3fa9041997b81c8e67562791e57b23f64 Mon Sep 17 00:00:00 2001 From: VNC <52937757+VNNCC@users.noreply.github.com> Date: Fri, 29 Jan 2021 16:18:00 +0100 Subject: [PATCH] Set minimum width and height for texture description in motion blur The calculation `motionVectorsWidth / tileSize` can return a result of 0. Set minimum width and height to 1. --- Source/Engine/Renderer/MotionBlurPass.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/Engine/Renderer/MotionBlurPass.cpp b/Source/Engine/Renderer/MotionBlurPass.cpp index 46b2ccd8f..065a9c53c 100644 --- a/Source/Engine/Renderer/MotionBlurPass.cpp +++ b/Source/Engine/Renderer/MotionBlurPass.cpp @@ -339,6 +339,13 @@ void MotionBlurPass::Render(RenderContext& renderContext, GPUTexture*& input, GP // Downscale motion vectors texture down to tileSize/tileSize (with max velocity calculation NxN kernel) rtDesc.Width = motionVectorsWidth / tileSize; rtDesc.Height = motionVectorsHeight / tileSize; + + if (rtDesc.Width < 1) + rtDesc.Width = 1; + + if (rtDesc.Height < 1) + rtDesc.Height = 1; + auto vMaxBuffer = RenderTargetPool::Get(rtDesc); context->ResetRenderTarget(); context->SetRenderTarget(vMaxBuffer->View());