From b61ba18e759cab6a13dff41456840b2a723a72e5 Mon Sep 17 00:00:00 2001 From: Marcus Wassmer Date: Sat, 26 Sep 2015 14:49:15 -0400 Subject: [PATCH] Fix lightshaft ensures. #codereview Ben.Zeigler [CL 2707185 by Marcus Wassmer in Main branch] --- .../Source/Runtime/Renderer/Private/LightShaftRendering.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Engine/Source/Runtime/Renderer/Private/LightShaftRendering.cpp b/Engine/Source/Runtime/Renderer/Private/LightShaftRendering.cpp index 269cd421d52d..a9e714aea209 100644 --- a/Engine/Source/Runtime/Renderer/Private/LightShaftRendering.cpp +++ b/Engine/Source/Runtime/Renderer/Private/LightShaftRendering.cpp @@ -449,6 +449,7 @@ void AllocateOrReuseLightShaftRenderTarget(FRHICommandListImmediate& RHICmdList, const FIntPoint BufferSize = FSceneRenderTargets::Get(RHICmdList).GetBufferSizeXY(); FIntPoint LightShaftSize(FMath::Max(BufferSize.X / GetLightShaftDownsampleFactor(), 1), FMath::Max(BufferSize.Y / GetLightShaftDownsampleFactor(), 1)); FPooledRenderTargetDesc Desc(FPooledRenderTargetDesc::Create2DDesc(LightShaftSize, LightShaftFilterBufferFormat, FClearValueBinding::Black, TexCreate_None, TexCreate_RenderTargetable, false)); + Desc.AutoWritable = false; GRenderTargetPool.FindFreeElement(RHICmdList, Desc, Target, Name); SetRenderTarget(RHICmdList, Target->GetRenderTargetItem().TargetableTexture, FTextureRHIRef(), ESimpleRenderTargetMode::EClearColorExistingDepth); @@ -613,7 +614,7 @@ void ApplyRadialBlurPasses( for (uint32 PassIndex = 0; PassIndex < NumPasses; PassIndex++) { - SetRenderTarget(RHICmdList, LightShaftsDest->GetRenderTargetItem().TargetableTexture, FTextureRHIRef()); + SetRenderTarget(RHICmdList, LightShaftsDest->GetRenderTargetItem().TargetableTexture, FTextureRHIRef(), true); RHICmdList.SetViewport(0, 0, 0.0f, FilterBufferSize.X, FilterBufferSize.Y, 1.0f); RHICmdList.SetBlendState(TStaticBlendState<>::GetRHI()); @@ -658,7 +659,7 @@ void FinishOcclusionTerm(FRHICommandList& RHICmdList, const FViewInfo& View, con const uint32 DownsampledSizeX = View.ViewRect.Width() / DownsampleFactor; const uint32 DownsampledSizeY = View.ViewRect.Height() / DownsampleFactor; - SetRenderTarget(RHICmdList, LightShaftsDest->GetRenderTargetItem().TargetableTexture, FTextureRHIRef()); + SetRenderTarget(RHICmdList, LightShaftsDest->GetRenderTargetItem().TargetableTexture, FTextureRHIRef(), true); RHICmdList.SetViewport(0, 0, 0.0f, FilterBufferSize.X, FilterBufferSize.Y, 1.0f); RHICmdList.SetBlendState(TStaticBlendState<>::GetRHI());