7 #include "RenderableBase.h"
10 #include "StencilLayersController.h"
14 #define LOG_SORT_KEYS 0
15 #define LOG_MATERIAL_CHANGES 0
16 #define LOG_MATERIAL_CHANGE_COUNT 0
24 class RenderableLess :
public std::binary_function<const RenderableBase*, const RenderableBase*, bool>
27 inline bool operator()(
const RenderableBase* pItemA,
const RenderableBase* pItemB)
const
29 const SortKey& sortKeyA = pItemA->GetSortKey();
30 const SortKey& sortKeyB = pItemB->GetSortKey();
31 return sortKeyA < sortKeyB;
46 inline void BeginEnqueuing()
48 Eegeo_ASSERT(m_inEnqueuePhase ==
false);
49 m_inEnqueuePhase =
true;
50 m_renderables.clear();
57 void EnqueueRenderables(
const std::vector<RenderableBase*>& renderablesToAdd);
63 int GetNumOfRenders()
const
65 return m_numOfRenders;
68 int GetNumOfShaderChanges()
const
70 return m_numOfShaderChanges;
73 int GetNumOfMaterialChanges()
const
75 return m_numOfMaterialChanges;
78 int GetNumOfStateRestores()
const
80 return m_numOfStateRestores;
84 bool m_inEnqueuePhase;
85 typedef std::vector<const RenderableBase*> TRenderables;
86 TRenderables m_renderables;
89 int m_numOfShaderChanges;
90 int m_numOfMaterialChanges;
91 int m_numOfStateRestores;
93 void ClearRenderStats()
96 m_numOfShaderChanges = 0;
97 m_numOfMaterialChanges = 0;
98 m_numOfStateRestores = 0;