Custom render mode, light pass accumulator buffer

Hi,

I have a custom render mode where I need to change how light is rendered. The important part is in DefferedLightingCommon.ush in AccumulateDynamicLighting method. I would like to store some of light data of the currently rendered light to be available for the next light. I enabled CustomData GBuffer and thought i could use it as an intermediate buffer, but if I do something like “GBuffer.CustomData.x = Shadow.SurfaceShadow;” it looks like the value is not written into the Gbuffer custom Data.

Does this mean g-buffer data can’t be modified after base pass or I’m doing something wrong?

FLightAccumulator AccumulateDynamicLighting(
                //.....
		/*check condition for previous GBuffer.CustomData.x val
		...
		*/		
		LightAccumulator_AddSplit(LightAccumulator, Lighting.Diffuse, Lighting.Specular, Lighting.Diffuse, MaskedLightColor * Shadow.SurfaceShadow, bNeedsSeparateSubsurfaceLightAccumulation);
		LightAccumulator_AddSplit(LightAccumulator, Lighting.Transmission, 0.0f, Lighting.Transmission, MaskedLightColor * Shadow.TransmissionShadow, bNeedsSeparateSubsurfaceLightAccumulation);

		GBuffer.CustomData.x = Shadow.SurfaceShadow;
		
		LightAccumulator.EstimatedCost += 0.4f;		// add the cost of the lighting computations (should sum up to 1 form one light)
	#endif

Thank you.