Skip to content

Commit

Permalink
Part 2 of the experiment to remove doug_lea_allocator.
Browse files Browse the repository at this point in the history
  • Loading branch information
intorr authored and Xottab-DUTY committed Dec 24, 2017
1 parent a9eb04f commit 7ceaaf0
Show file tree
Hide file tree
Showing 20 changed files with 53 additions and 113 deletions.
8 changes: 4 additions & 4 deletions src/Layers/xrRender/D3DXRenderBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class D3DXRenderBase : public IRender, public pureFrame
BOOL val_bRecordMP; // record nearest for multi-pass
R_feedback* val_feedback; // feedback for geometry being rendered
u32 val_feedback_breakp; // breakpoint
xr_vector<Fbox3, render_alloc<Fbox3>>* val_recorder; // coarse structure recorder
xr_vector<Fbox3>* val_recorder; // coarse structure recorder
u32 phase;
u32 marker;
bool pmask[2];
Expand All @@ -47,8 +47,8 @@ class D3DXRenderBase : public IRender, public pureFrame
R_dsgraph::mapSorted_T mapHUDEmissive;
#endif

xr_vector<R_dsgraph::_LodItem, render_alloc<R_dsgraph::_LodItem>> lstLODs;
xr_vector<int, render_alloc<int>> lstLODgroups;
xr_vector<R_dsgraph::_LodItem> lstLODs;
xr_vector<int> lstLODgroups;
xr_vector<ISpatial*> lstRenderables;
xr_vector<ISpatial*> lstSpatial;

Expand All @@ -75,7 +75,7 @@ class D3DXRenderBase : public IRender, public pureFrame
val_feedback_breakp = id;
val_feedback = V;
}
void set_Recorder(xr_vector<Fbox3, render_alloc<Fbox3>>* dest)
void set_Recorder(xr_vector<Fbox3>* dest)
{
val_recorder = dest;
if (dest)
Expand Down
12 changes: 0 additions & 12 deletions src/Layers/xrRender/RenderAllocator.cpp

This file was deleted.

14 changes: 0 additions & 14 deletions src/Layers/xrRender/RenderAllocator.hpp

This file was deleted.

30 changes: 15 additions & 15 deletions src/Layers/xrRender/r__dsgraph_render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ template <class T> IC bool cmp_textures_lexN(const T &lhs, const T &rhs)
return std::lexicographical_compare(t1->begin(), t1->end(), t2->begin(), t2->end());
}

template <class T> void sort_tlist(xr_vector<T::template TNode*, render_alloc<T::template TNode*>>& lst, T& textures)
template <class T> void sort_tlist(xr_vector<T::template TNode*>& lst, T& textures)
{
int amount = textures.begin()->key->size();

Expand All @@ -82,7 +82,7 @@ template <class T> void sort_tlist(xr_vector<T::template TNode*, render_alloc<T:
}
else
{
xr_vector<T::template TNode*, render_alloc<T::template TNode*>> temp;
xr_vector<T::template TNode*> temp;

// Split into 2 parts
for (auto &it : textures)
Expand Down Expand Up @@ -123,7 +123,7 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
{
mapNormalVS& vs = mapNormalPasses[_priority][iPass];

xr_vector<mapNormalVS::TNode*, render_alloc<mapNormalVS::TNode*>> nrmVS;
xr_vector<mapNormalVS::TNode*> nrmVS;
vs.getANY_P(nrmVS);
std::sort(nrmVS.begin(), nrmVS.end(), cmp_val_ssa<mapNormalVS::TNode*>);
for (auto & vs_it : nrmVS)
Expand All @@ -134,7 +134,7 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
// GS setup
mapNormalGS& gs = vs_it->val;

xr_vector<mapNormalGS::TNode*, render_alloc<mapNormalGS::TNode*>> nrmGS;
xr_vector<mapNormalGS::TNode*> nrmGS;
gs.getANY_P(nrmGS);
std::sort(nrmGS.begin(), nrmGS.end(), cmp_val_ssa<mapNormalGS::TNode*>);
for (auto & gs_it : nrmGS)
Expand All @@ -145,7 +145,7 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
#else // USE_DX10
mapNormalPS& ps = vs_it->val;
#endif // USE_DX10
xr_vector<mapNormalPS::TNode*, render_alloc<mapNormalPS::TNode*>> nrmPS;
xr_vector<mapNormalPS::TNode*> nrmPS;
ps.getANY_P(nrmPS);
std::sort(nrmPS.begin(), nrmPS.end(), cmp_ps_val_ssa<mapNormalPS::TNode*>);
for (auto &ps_it : nrmPS)
Expand All @@ -159,7 +159,7 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
#else
mapNormalCS& cs = ps_it->val;
#endif
xr_vector<mapNormalCS::TNode*, render_alloc<mapNormalCS::TNode*>> nrmCS;
xr_vector<mapNormalCS::TNode*> nrmCS;
cs.getANY_P(nrmCS);
std::sort(nrmCS.begin(), nrmCS.end(), cmp_val_ssa<mapNormalCS::TNode*>);
for (auto &cs_it : nrmCS)
Expand All @@ -168,7 +168,7 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)

mapNormalStates& states = cs_it->val;

xr_vector<mapNormalStates::TNode*, render_alloc<mapNormalStates::TNode*>> nrmStates;
xr_vector<mapNormalStates::TNode*> nrmStates;
states.getANY_P(nrmStates);
std::sort(nrmStates.begin(), nrmStates.end(), cmp_val_ssa<mapNormalStates::TNode*>);
for (auto &state_it : nrmStates)
Expand All @@ -177,7 +177,7 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)

mapNormalTextures& tex = state_it->val;

xr_vector<mapNormalTextures::TNode*, render_alloc<mapNormalTextures::TNode*>> nrmTextures;
xr_vector<mapNormalTextures::TNode*> nrmTextures;
sort_tlist<mapNormalTextures>(nrmTextures, tex);
for (auto &tex_it : nrmTextures)
{
Expand Down Expand Up @@ -221,7 +221,7 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
{
mapMatrixVS& vs = mapMatrixPasses[_priority][iPass];

xr_vector<mapMatrixVS::TNode*, render_alloc<mapMatrixVS::TNode*>> matVS;
xr_vector<mapMatrixVS::TNode*> matVS;
vs.getANY_P(matVS);
std::sort(matVS.begin(), matVS.end(), cmp_val_ssa<mapMatrixVS::TNode*>);
for (auto &vs_id : matVS)
Expand All @@ -231,7 +231,7 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
#if defined(USE_DX10) || defined(USE_DX11)
mapMatrixGS& gs = vs_id->val;

xr_vector<mapMatrixGS::TNode*, render_alloc<mapMatrixGS::TNode*>> matGS;
xr_vector<mapMatrixGS::TNode*> matGS;
gs.getANY_P(matGS);
std::sort(matGS.begin(), matGS.end(), cmp_val_ssa<mapMatrixGS::TNode*>);
for (auto &gs_it : matGS)
Expand All @@ -242,7 +242,7 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
#else // USE_DX10
mapMatrixPS& ps = vs_id->val;
#endif // USE_DX10
xr_vector<mapMatrixPS::TNode *, render_alloc<mapMatrixPS::TNode *>> matPS;
xr_vector<mapMatrixPS::TNode *> matPS;
ps.getANY_P(matPS);
std::sort(matPS.begin(), matPS.end(), cmp_ps_val_ssa<mapMatrixPS::TNode *>);
for (auto &ps_it : matPS)
Expand All @@ -256,7 +256,7 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
#else
mapMatrixCS& cs = ps_it->val;
#endif
xr_vector<mapMatrixCS::TNode*, render_alloc<mapMatrixCS::TNode*>> matCS;
xr_vector<mapMatrixCS::TNode*> matCS;
cs.getANY_P(matCS);
std::sort(matCS.begin(), matCS.end(), cmp_val_ssa<mapMatrixCS::TNode*>);
for (auto &cs_it : matCS)
Expand All @@ -265,7 +265,7 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)

mapMatrixStates& states = cs_it->val;

xr_vector<mapMatrixStates::TNode*, render_alloc<mapMatrixStates::TNode*>> matStates;
xr_vector<mapMatrixStates::TNode*> matStates;
states.getANY_P(matStates);
std::sort(matStates.begin(), matStates.end(), cmp_val_ssa<mapMatrixStates::TNode*>);
for (auto &state_it : matStates)
Expand All @@ -274,7 +274,7 @@ void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)

mapMatrixTextures& tex = state_it->val;

xr_vector<mapMatrixTextures::TNode*, render_alloc<mapMatrixTextures::TNode*>> matTextures;
xr_vector<mapMatrixTextures::TNode*> matTextures;
sort_tlist<mapMatrixTextures>(matTextures, tex);
for (auto &tex_it : matTextures)
{
Expand Down Expand Up @@ -603,7 +603,7 @@ void D3DXRenderBase::r_dsgraph_render_subspace(IRender_Sector* _sector, CFrustum

void D3DXRenderBase::r_dsgraph_render_R1_box(IRender_Sector* S, Fbox& BB, int sh)
{
xr_vector<dxRender_Visual*, render_alloc<dxRender_Visual*>> lstVisuals;
xr_vector<dxRender_Visual*> lstVisuals;
lstVisuals.push_back(((CSector*)S)->root());

for (auto &it : lstVisuals)
Expand Down
45 changes: 22 additions & 23 deletions src/Layers/xrRender/r__dsgraph_types.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#include "xrCore/fixedmap.h"
#include "Layers/xrRender/RenderAllocator.hpp"
#include "xrCore/FixedMap.h"

class dxRender_Visual;

Expand Down Expand Up @@ -61,24 +60,24 @@ using ps_type = ID3DPixelShader* ;
#endif

// NORMAL
using mapNormalDirect = xr_vector<_NormalItem, render_allocator::helper<_NormalItem>::result>;
using mapNormalDirect = xr_vector<_NormalItem>;

struct mapNormalItems : public mapNormalDirect
{
float ssa;
};

struct mapNormalTextures : public FixedMAP<STextureList*, mapNormalItems, render_allocator>
struct mapNormalTextures : public FixedMAP<STextureList*, mapNormalItems>
{
float ssa;
};

struct mapNormalStates : public FixedMAP<ID3DState*, mapNormalTextures, render_allocator>
struct mapNormalStates : public FixedMAP<ID3DState*, mapNormalTextures>
{
float ssa;
};

struct mapNormalCS : public FixedMAP<R_constant_table*, mapNormalStates, render_allocator>
struct mapNormalCS : public FixedMAP<R_constant_table*, mapNormalStates>
{
float ssa;
};
Expand All @@ -91,50 +90,50 @@ struct mapNormalAdvStages
mapNormalCS mapCS;
};

struct mapNormalPS : public FixedMAP<ps_type, mapNormalAdvStages, render_allocator>
struct mapNormalPS : public FixedMAP<ps_type, mapNormalAdvStages>
{
float ssa;
};
#else
struct mapNormalPS : public FixedMAP<ps_type, mapNormalCS, render_allocator>
struct mapNormalPS : public FixedMAP<ps_type, mapNormalCS>
{
float ssa;
};
#endif // USE_DX11

#if defined(USE_DX10) || defined(USE_DX11)
struct mapNormalGS : public FixedMAP<gs_type, mapNormalPS, render_allocator>
struct mapNormalGS : public FixedMAP<gs_type, mapNormalPS>
{
float ssa;
};

struct mapNormalVS : public FixedMAP<vs_type, mapNormalGS, render_allocator> {};
struct mapNormalVS : public FixedMAP<vs_type, mapNormalGS> {};
#else // USE_DX10
struct mapNormalVS : public FixedMAP<vs_type, mapNormalPS, render_allocator> {};
struct mapNormalVS : public FixedMAP<vs_type, mapNormalPS> {};
#endif // USE_DX10

using mapNormal_T = mapNormalVS;
using mapNormalPasses_T = mapNormal_T[SHADER_PASSES_MAX];

// MATRIX
using mapMatrixDirect = xr_vector<_MatrixItem, render_allocator::helper<_MatrixItem>::result>;
using mapMatrixDirect = xr_vector<_MatrixItem>;

struct mapMatrixItems : public mapMatrixDirect
{
float ssa;
};

struct mapMatrixTextures : public FixedMAP<STextureList*, mapMatrixItems, render_allocator>
struct mapMatrixTextures : public FixedMAP<STextureList*, mapMatrixItems>
{
float ssa;
};

struct mapMatrixStates : public FixedMAP<ID3DState*, mapMatrixTextures, render_allocator>
struct mapMatrixStates : public FixedMAP<ID3DState*, mapMatrixTextures>
{
float ssa;
};

struct mapMatrixCS : public FixedMAP<R_constant_table*, mapMatrixStates, render_allocator>
struct mapMatrixCS : public FixedMAP<R_constant_table*, mapMatrixStates>
{
float ssa;
};
Expand All @@ -147,38 +146,38 @@ struct mapMatrixAdvStages
mapMatrixCS mapCS;
};

struct mapMatrixPS : public FixedMAP<ps_type, mapMatrixAdvStages, render_allocator>
struct mapMatrixPS : public FixedMAP<ps_type, mapMatrixAdvStages>
{
float ssa;
};
#else
struct mapMatrixPS : public FixedMAP<ps_type, mapMatrixCS, render_allocator>
struct mapMatrixPS : public FixedMAP<ps_type, mapMatrixCS>
{
float ssa;
};
#endif // USE_DX11

#if defined(USE_DX10) || defined(USE_DX11)
struct mapMatrixGS : public FixedMAP<gs_type, mapMatrixPS, render_allocator>
struct mapMatrixGS : public FixedMAP<gs_type, mapMatrixPS>
{
float ssa;
};

struct mapMatrixVS : public FixedMAP<vs_type, mapMatrixGS, render_allocator> {};
struct mapMatrixVS : public FixedMAP<vs_type, mapMatrixGS> {};
#else // USE_DX10
struct mapMatrixVS : public FixedMAP<vs_type, mapMatrixPS, render_allocator> {};
struct mapMatrixVS : public FixedMAP<vs_type, mapMatrixPS> {};
#endif // USE_DX10

using mapMatrix_T = mapMatrixVS;
using mapMatrixPasses_T = mapMatrix_T[SHADER_PASSES_MAX];

// Top level
using mapSorted_T = FixedMAP<float, _MatrixItemS, render_allocator>;
using mapSorted_T = FixedMAP<float, _MatrixItemS>;
using mapSorted_Node = mapSorted_T::TNode;

using mapHUD_T = FixedMAP<float, _MatrixItemS, render_allocator>;
using mapHUD_T = FixedMAP<float, _MatrixItemS>;
using mapHUD_Node = mapHUD_T::TNode;

using mapLOD_T = FixedMAP<float, _LodItem, render_allocator>;
using mapLOD_T = FixedMAP<float, _LodItem>;
using mapLOD_Node = mapLOD_T::TNode;
}
2 changes: 0 additions & 2 deletions src/Layers/xrRenderPC_R1/xrRender_R1.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
<ClInclude Include="..\xrRender\ParticleEffectDef.h" />
<ClInclude Include="..\xrRender\ParticleGroup.h" />
<ClInclude Include="..\xrRender\PSLibrary.h" />
<ClInclude Include="..\xrRender\RenderAllocator.hpp" />
<ClInclude Include="..\xrRender\ResourceManager.h" />
<ClInclude Include="..\xrRender\R_Backend.h" />
<ClInclude Include="..\xrRender\R_Backend_hemi.h" />
Expand Down Expand Up @@ -372,7 +371,6 @@
<ClCompile Include="..\xrRender\ParticleEffectDef.cpp" />
<ClCompile Include="..\xrRender\ParticleGroup.cpp" />
<ClCompile Include="..\xrRender\PSLibrary.cpp" />
<ClCompile Include="..\xrRender\RenderAllocator.cpp" />
<ClCompile Include="..\xrRender\ResourceManager.cpp" />
<ClCompile Include="..\xrRender\ResourceManager_Loader.cpp" />
<ClCompile Include="..\xrRender\ResourceManager_Reset.cpp" />
Expand Down
6 changes: 0 additions & 6 deletions src/Layers/xrRenderPC_R1/xrRender_R1.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,6 @@
<ClInclude Include="..\xrRender\D3DXRenderBase.h">
<Filter>Core</Filter>
</ClInclude>
<ClInclude Include="..\xrRender\RenderAllocator.hpp">
<Filter>Core</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
Expand Down Expand Up @@ -968,9 +965,6 @@
<ClCompile Include="..\xrRender\ParticleGroup.cpp">
<Filter>Models\Visuals</Filter>
</ClCompile>
<ClCompile Include="..\xrRender\RenderAllocator.cpp">
<Filter>Core</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Text Include="Pipeline.txt" />
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_R2/r2.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class CRender : public D3DXRenderBase
light_Package LP_normal;
light_Package LP_pending;

xr_vector<Fbox3, render_alloc<Fbox3>> main_coarse_structure;
xr_vector<Fbox3> main_coarse_structure;

shared_str c_sbase;
shared_str c_lmaterial;
Expand Down
Loading

0 comments on commit 7ceaaf0

Please sign in to comment.