@@ -70,7 +70,7 @@ template <class T> IC bool cmp_textures_lexN(const T &lhs, const T &rhs)
7070 return std::lexicographical_compare (t1->begin (), t1->end (), t2->begin (), t2->end ());
7171}
7272
73- template <class T > void sort_tlist (xr_vector<T::template TNode*>& lst, T& textures)
73+ template <class T > void sort_tlist (xr_vector<T::template TNode*>& lst, xr_vector<T:: template TNode*>& temp, T& textures)
7474{
7575 int amount = textures.begin ()->key ->size ();
7676
@@ -82,8 +82,6 @@ template <class T> void sort_tlist(xr_vector<T::template TNode*>& lst, T& textur
8282 }
8383 else
8484 {
85- xr_vector<T::template TNode*> temp;
86-
8785 // Split into 2 parts
8886 for (auto &it : textures)
8987 {
@@ -123,7 +121,6 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
123121 {
124122 mapNormalVS& vs = mapNormalPasses[_priority][iPass];
125123
126- xr_vector<mapNormalVS::TNode*> nrmVS;
127124 vs.getANY_P (nrmVS);
128125 std::sort (nrmVS.begin (), nrmVS.end (), cmp_val_ssa<mapNormalVS::TNode*>);
129126 for (auto & vs_it : nrmVS)
@@ -133,8 +130,8 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
133130#if defined(USE_DX10) || defined(USE_DX11)
134131 // GS setup
135132 mapNormalGS& gs = vs_it->val ;
133+ gs.ssa = 0 ;
136134
137- xr_vector<mapNormalGS::TNode*> nrmGS;
138135 gs.getANY_P (nrmGS);
139136 std::sort (nrmGS.begin (), nrmGS.end (), cmp_val_ssa<mapNormalGS::TNode*>);
140137 for (auto & gs_it : nrmGS)
@@ -145,7 +142,8 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
145142#else // USE_DX10
146143 mapNormalPS& ps = vs_it->val ;
147144#endif // USE_DX10
148- xr_vector<mapNormalPS::TNode*> nrmPS;
145+ ps.ssa = 0 ;
146+
149147 ps.getANY_P (nrmPS);
150148 std::sort (nrmPS.begin (), nrmPS.end (), cmp_ps_val_ssa<mapNormalPS::TNode*>);
151149 for (auto &ps_it : nrmPS)
@@ -159,32 +157,34 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
159157#else
160158 mapNormalCS& cs = ps_it->val ;
161159#endif
162- xr_vector<mapNormalCS::TNode*> nrmCS;
160+ cs.ssa = 0 ;
161+
163162 cs.getANY_P (nrmCS);
164163 std::sort (nrmCS.begin (), nrmCS.end (), cmp_val_ssa<mapNormalCS::TNode*>);
165164 for (auto &cs_it : nrmCS)
166165 {
167166 RCache.set_Constants (cs_it->key );
168167
169168 mapNormalStates& states = cs_it->val ;
169+ states.ssa = 0 ;
170170
171- xr_vector<mapNormalStates::TNode*> nrmStates;
172171 states.getANY_P (nrmStates);
173172 std::sort (nrmStates.begin (), nrmStates.end (), cmp_val_ssa<mapNormalStates::TNode*>);
174173 for (auto &state_it : nrmStates)
175174 {
176175 RCache.set_States (state_it->key );
177176
178177 mapNormalTextures& tex = state_it->val ;
178+ tex.ssa = 0 ;
179179
180- xr_vector<mapNormalTextures::TNode*> nrmTextures;
181- sort_tlist<mapNormalTextures>(nrmTextures, tex);
180+ sort_tlist<mapNormalTextures>(nrmTextures, nrmTexturesTemp, tex);
182181 for (auto &tex_it : nrmTextures)
183182 {
184183 RCache.set_Textures (tex_it->key );
185184 RImplementation.apply_lmaterial ();
186185
187186 mapNormalItems& items = tex_it->val ;
187+ items.ssa = 0 ;
188188
189189 std::sort (items.begin (), items.end (), cmp_ssa<_NormalItem>);
190190 for (auto &it_it : items)
@@ -197,18 +197,25 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
197197 }
198198 items.clear ();
199199 }
200+ nrmTexturesTemp.clear ();
201+ nrmTextures.clear ();
200202 tex.clear ();
201203 }
204+ nrmStates.clear ();
202205 states.clear ();
203206 }
207+ nrmCS.clear ();
204208 cs.clear ();
205209 }
210+ nrmPS.clear ();
206211 ps.clear ();
207212#if defined(USE_DX10) || defined(USE_DX11)
208213 }
214+ nrmGS.clear ();
209215 gs.clear ();
210216#endif // USE_DX10
211217 }
218+ nrmVS.clear ();
212219 vs.clear ();
213220 }
214221 }
@@ -221,7 +228,6 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
221228 {
222229 mapMatrixVS& vs = mapMatrixPasses[_priority][iPass];
223230
224- xr_vector<mapMatrixVS::TNode*> matVS;
225231 vs.getANY_P (matVS);
226232 std::sort (matVS.begin (), matVS.end (), cmp_val_ssa<mapMatrixVS::TNode*>);
227233 for (auto &vs_id : matVS)
@@ -230,8 +236,8 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
230236
231237#if defined(USE_DX10) || defined(USE_DX11)
232238 mapMatrixGS& gs = vs_id->val ;
239+ gs.ssa = 0 ;
233240
234- xr_vector<mapMatrixGS::TNode*> matGS;
235241 gs.getANY_P (matGS);
236242 std::sort (matGS.begin (), matGS.end (), cmp_val_ssa<mapMatrixGS::TNode*>);
237243 for (auto &gs_it : matGS)
@@ -242,7 +248,8 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
242248#else // USE_DX10
243249 mapMatrixPS& ps = vs_id->val ;
244250#endif // USE_DX10
245- xr_vector<mapMatrixPS::TNode *> matPS;
251+ ps.ssa = 0 ;
252+
246253 ps.getANY_P (matPS);
247254 std::sort (matPS.begin (), matPS.end (), cmp_ps_val_ssa<mapMatrixPS::TNode *>);
248255 for (auto &ps_it : matPS)
@@ -256,32 +263,34 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
256263#else
257264 mapMatrixCS& cs = ps_it->val ;
258265#endif
259- xr_vector<mapMatrixCS::TNode*> matCS;
266+ cs.ssa = 0 ;
267+
260268 cs.getANY_P (matCS);
261269 std::sort (matCS.begin (), matCS.end (), cmp_val_ssa<mapMatrixCS::TNode*>);
262270 for (auto &cs_it : matCS)
263271 {
264272 RCache.set_Constants (cs_it->key );
265273
266274 mapMatrixStates& states = cs_it->val ;
275+ states.ssa = 0 ;
267276
268- xr_vector<mapMatrixStates::TNode*> matStates;
269277 states.getANY_P (matStates);
270278 std::sort (matStates.begin (), matStates.end (), cmp_val_ssa<mapMatrixStates::TNode*>);
271279 for (auto &state_it : matStates)
272280 {
273281 RCache.set_States (state_it->key );
274282
275283 mapMatrixTextures& tex = state_it->val ;
284+ tex.ssa = 0 ;
276285
277- xr_vector<mapMatrixTextures::TNode*> matTextures;
278- sort_tlist<mapMatrixTextures>(matTextures, tex);
286+ sort_tlist<mapMatrixTextures>(matTextures, matTexturesTemp, tex);
279287 for (auto &tex_it : matTextures)
280288 {
281289 RCache.set_Textures (tex_it->key );
282290 RImplementation.apply_lmaterial ();
283291
284292 mapMatrixItems& items = tex_it->val ;
293+ items.ssa = 0 ;
285294
286295 std::sort (items.begin (), items.end (), cmp_ssa<_MatrixItem>);
287296 for (auto &ni_it : items)
@@ -298,18 +307,25 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
298307 }
299308 items.clear ();
300309 }
310+ matTexturesTemp.clear ();
311+ matTextures.clear ();
301312 tex.clear ();
302313 }
314+ matStates.clear ();
303315 states.clear ();
304316 }
317+ matCS.clear ();
305318 cs.clear ();
306319 }
320+ matPS.clear ();
307321 ps.clear ();
308322#if defined(USE_DX10) || defined(USE_DX11)
309323 }
324+ matGS.clear ();
310325 gs.clear ();
311326#endif // USE_DX10
312327 }
328+ matVS.clear ();
313329 vs.clear ();
314330 }
315331
@@ -603,7 +619,7 @@ void D3DXRenderBase::r_dsgraph_render_subspace(IRender_Sector* _sector, CFrustum
603619
604620void D3DXRenderBase::r_dsgraph_render_R1_box (IRender_Sector* S, Fbox& BB, int sh)
605621{
606- xr_vector<dxRender_Visual*> lstVisuals;
622+ lstVisuals. clear () ;
607623 lstVisuals.push_back (((CSector*)S)->root ());
608624
609625 for (auto &it : lstVisuals)
0 commit comments