@@ -21,11 +21,13 @@ void CRenderTarget::phase_scene_prepare()
2121 if (RImplementation.o .advancedpp && (ps_r2_ls_flags.test (R2FLAG_SOFT_PARTICLES | R2FLAG_DOF) ||
2222 ((ps_r_sun_shafts > 0 ) && (fValue >= 0.0001 )) || (ps_r_ssao > 0 )))
2323 {
24+ #ifdef USE_DX11
2425 // TODO: DX11: Check if we need to set RT here.
25- #ifdef USE_OGL
26- u_setrtzb (RCache, rt_Position,rt_MSAADepth);
27- #else
2826 u_setrt (RCache, Device.dwWidth , Device.dwHeight , rt_Position->pRT , 0 , 0 , rt_MSAADepth);
27+ #else
28+ /* TODO investigate: it should be rt_Normal and (maybe) rt_Color
29+ * rt_Position should be always single-sampled */
30+ u_setrtzb (RCache, rt_Position,rt_MSAADepth);
2931#endif
3032
3133 const Fcolor color{}; // black
@@ -64,24 +66,27 @@ void CRenderTarget::phase_scene_prepare()
6466void CRenderTarget::phase_scene_begin ()
6567{
6668 // Targets, use accumulator for temporary storage
67- if (!RImplementation.o .gbuffer_opt )
68- {
69- auto & _3 = RImplementation.o .albedo_wo ? rt_Accumulator : rt_Color;
7069#ifdef USE_OGL
71- u_setrtzb (RCache, rt_Position, rt_Normal, _3, rt_MSAADepth);
70+ // TODO Investigate should be color always
71+ auto & _2 = RImplementation.o .albedo_wo ? rt_Accumulator : rt_Color;
72+ u_setrtzb (RCache, rt_Position, _2, rt_MSAADepth);
7273#else
73- u_setrt (RCache, rt_Position, rt_Normal, _3, rt_MSAADepth);
74- #endif
74+ if (!RImplementation.o .gbuffer_opt )
75+ {
76+ if (RImplementation.o .albedo_wo )
77+ u_setrt (RCache, rt_Position, rt_Normal, rt_Accumulator, rt_MSAADepth);
78+ else
79+ u_setrt (RCache, rt_Position, rt_Normal, rt_Color, rt_MSAADepth);
7580 }
7681 else
7782 {
78- auto & _2 = RImplementation.o .albedo_wo ? rt_Accumulator : rt_Color;
79- #ifdef USE_OGL
80- u_setrtzb (RCache, rt_Position, _2, rt_MSAADepth);
81- #else
82- u_setrt (RCache, rt_Position, _2, nullptr , rt_MSAADepth);
83- #endif
83+ if (RImplementation.o .albedo_wo )
84+ u_setrt (RCache, rt_Position, rt_Accumulator, rt_MSAADepth);
85+ else
86+ u_setrt (RCache, rt_Position, rt_Color, rt_MSAADepth);
87+ // else u_setrt (rt_Position, rt_Color, rt_Normal, rt_MSAADepth);
8488 }
89+ #endif
8590
8691 // Stencil - write 0x1 at pixel pos
8792 RCache.set_Stencil (
0 commit comments