@@ -43,6 +43,7 @@ void CRender::render_lights(light_Package& LP)
4343 }
4444 }
4545
46+ // 2. refactor
4647 {
4748 xr_vector<light*>& source = LP.v_shadowed ;
4849 xr_vector<light*> refactored;
@@ -129,14 +130,14 @@ void CRender::render_lights(light_Package& LP)
129130 }
130131 };
131132
132- const auto & flush_lights = [] (CRender& render, xr_vector<task_data_t >& lights_queue)
133+ const auto & flush_lights = [] (xr_vector<task_data_t >& lights_queue)
133134 {
134135 for (const auto & [L, task, batch_id] : lights_queue)
135136 {
136137 VERIFY (task);
137138 TaskScheduler->Wait (*task);
138139
139- auto & dsgraph = render .get_context (batch_id);
140+ auto & dsgraph = RImplementation .get_context (batch_id);
140141
141142 const bool bNormal = !dsgraph.mapNormalPasses [0 ][0 ].empty () || !dsgraph.mapMatrixPasses [0 ][0 ].empty ();
142143 const bool bSpecial = !dsgraph.mapNormalPasses [1 ][0 ].empty () || !dsgraph.mapMatrixPasses [1 ][0 ].empty () ||
@@ -145,27 +146,27 @@ void CRender::render_lights(light_Package& LP)
145146 {
146147 PIX_EVENT_CTX (dsgraph.cmd_list , SHADOWED_LIGHT);
147148
148- render .Stats .s_merged ++;
149+ RImplementation .Stats .s_merged ++;
149150 L_spot_s.push_back (L);
150- render .Target ->phase_smap_spot (dsgraph.cmd_list , L);
151+ RImplementation .Target ->phase_smap_spot (dsgraph.cmd_list , L);
151152 dsgraph.cmd_list .set_xform_world (Fidentity);
152153 dsgraph.cmd_list .set_xform_view (L->X .S .view );
153154 dsgraph.cmd_list .set_xform_project (L->X .S .project );
154155 dsgraph.render_graph (0 );
155156 if (ps_r2_ls_flags.test (R2FLAG_SUN_DETAILS))
156157 {
157- if (check_grass_shadow (L, render .ViewBase ))
158+ if (check_grass_shadow (L, RImplementation .ViewBase ))
158159 {
159- render .Details ->fade_distance = -1 ; // Use light position to calc "fade"
160- render .Details ->light_position .set (L->position );
161- render .Details ->Render (dsgraph.cmd_list );
160+ RImplementation .Details ->fade_distance = -1 ; // Use light position to calc "fade"
161+ RImplementation .Details ->light_position .set (L->position );
162+ RImplementation .Details ->Render (dsgraph.cmd_list );
162163 }
163164 }
164165 L->X .S .transluent = FALSE ;
165166 if (bSpecial)
166167 {
167168 L->X .S .transluent = TRUE ;
168- render .Target ->phase_smap_spot_tsh (dsgraph.cmd_list , L);
169+ RImplementation .Target ->phase_smap_spot_tsh (dsgraph.cmd_list , L);
169170 PIX_EVENT_CTX (dsgraph.cmd_list , SHADOWED_LIGHTS_RENDER_GRAPH);
170171 dsgraph.render_graph (1 ); // normal level, secondary priority
171172 PIX_EVENT_CTX (dsgraph.cmd_list , SHADOWED_LIGHTS_RENDER_SORTED);
@@ -174,7 +175,7 @@ void CRender::render_lights(light_Package& LP)
174175 }
175176 else
176177 {
177- render .Stats .s_finalclip ++;
178+ RImplementation .Stats .s_finalclip ++;
178179 }
179180
180181 L->svis [batch_id].end (); // NOTE(DX11): occqs are fetched here, this should be done on the imm context only
@@ -206,7 +207,7 @@ void CRender::render_lights(light_Package& LP)
206207 if (batch_id == R_dsgraph_structure::INVALID_CONTEXT_ID)
207208 {
208209 VERIFY (!lights_queue.empty ());
209- flush_lights (* this , lights_queue);
210+ flush_lights (lights_queue);
210211 continue ;
211212 }
212213
@@ -228,7 +229,7 @@ void CRender::render_lights(light_Package& LP)
228229 }
229230 lights_queue.emplace_back (data);
230231 }
231- flush_lights (* this , lights_queue); // in case if something left
232+ flush_lights (lights_queue); // in case if something left
232233
233234 cmd_list.Invalidate ();
234235
0 commit comments