ezEngine  Milestone 7
RenderPipeline_inl.h
1 
2 template <typename T>
3 T* ezRenderPipeline::CreateRenderData(ezRenderPassType passType, const ezGameObject* pOwner)
4 {
5  EZ_CHECK_AT_COMPILETIME(EZ_IS_DERIVED_FROM_STATIC(ezRenderData, T));
6 
7  T* pRenderData = EZ_NEW(ezFrameAllocator::GetCurrentAllocator(), T);
8  pRenderData->m_uiSortingKey = 0;
9  pRenderData->m_hOwner = pOwner->GetHandle();
10 
11 #if EZ_ENABLED(EZ_COMPILE_FOR_DEVELOPMENT)
12  pRenderData->m_pOwner = pOwner;
13 #endif
14 
15  PipelineData* pPipelineData = GetPipelineDataForExtraction();
16  if (passType >= pPipelineData->m_PassData.GetCount())
17  {
18  pPipelineData->m_PassData.SetCount(passType + 1);
19  }
20 
21  pPipelineData->m_PassData[passType].m_RenderData.PushBack(pRenderData);
22 
23  return pRenderData;
24 }
25 
26 EZ_FORCE_INLINE ezArrayPtr<const ezRenderData* const> ezRenderPipeline::GetRenderDataWithPassType(ezRenderPassType passType) const
27 {
29 
30  const PipelineData* pPipelineData = GetPipelineDataForRendering();
31  if (pPipelineData->m_PassData.GetCount() > passType)
32  {
33  renderData = pPipelineData->m_PassData[passType].m_RenderData;
34  }
35 
36  return renderData;
37 }
38 
39 // static
40 EZ_FORCE_INLINE const char* ezRenderPipeline::GetPassTypeName(ezRenderPassType passType)
41 {
42  return s_PassTypeData[passType].m_sName.GetString().GetData();
43 }
44 
45 // static
46 EZ_FORCE_INLINE ezProfilingId& ezRenderPipeline::GetPassTypeProfilingID(ezRenderPassType passType)
47 {
48  return s_PassTypeData[passType].m_ProfilingID;
49 }