Custom render mode, light pass accumulator buffer

For anyone having the same problem, instead of trying to modify a gbuffer, I created two new textures, one as an input and one as output to a pixel shader. Once the shader writes out to output texture, I copy the content to the input texture and move on to the next pass.

Some relevant files and code:

//////////////////create in and out textures, LightRendering.cpp////////////////
const FRDGTextureDesc OutTextureDesc(FRDGTextureDesc::Create2D(SceneTextureExtent, PF_R32_FLOAT, FClearValueBinding::White, TexCreate_ShaderResource | TexCreate_UAV | TexCreate_RenderTargetable));
FRDGTextureRef OutTexture = GraphBuilder.CreateTexture(OutTextureDesc, TEXT("OutTexture"));
const FRDGTextureDesc InTextureDesc(FRDGTextureDesc::Create2D(SceneTextureExtent, PF_R32_FLOAT, FClearValueBinding::White, TexCreate_ShaderResource | TexCreate_UAV | TexCreate_RenderTargetable));
FRDGTextureRef InTexture = GraphBuilder.CreateTexture(InTextureDesc, TEXT("InTexture"));

//after adding light pass
AddCopyTexturePass(GraphBuilder, OutTexture, InTexture);
////////////////////////////////////////////////////////////////////////////////////////

///////////class FDeferredLightPS : public FGlobalShader/////////////
//add parameters to pixel shader
SHADER_PARAMETER_RDG_TEXTURE(Texture2D, InTexture)
SHADER_PARAMETER_SAMPLER(SamplerState, InTextureSampler)

//FDeferredLightPS::FParameters GetDeferredLightPSParameters
//init params
Out.InTexture = InTexture;
Out.InTextureSampler = TStaticSamplerState<SF_Point, AM_Wrap, AM_Wrap, AM_Wrap>::GetRHI();
///bind out texture
Out.RenderTargets[1] = FRenderTargetBinding(OutTexture, ERenderTargetLoadAction::EClear);
////////////////////////////////////////////////////////////////////////////////////////

///////////DeferredLightPixelShaders.usf/////////////
//declare in texture
Texture2D       InTexture;
SamplerState    InTextureSampler;
//define out texture
void DeferredLightPixelMain(float4 SVPos : SV_POSITION,nointerpolation uint NodeCount  : DISPATCH_NODECOUNT,nointerpolation uint2 Resolution : DISPATCH_RESOLUTION, out float4 OutColor : SV_Target0, out float OutTexture : SV_Target1)
////////////////////////////////////////////////////////////////////////////////////////