ULRE/inc/hgl/graph/RenderList.h

74 lines
2.0 KiB
C
Raw Normal View History

2019-05-25 00:50:04 +08:00
#ifndef HGL_GRAPH_RENDER_LIST_INCLUDE
#define HGL_GRAPH_RENDER_LIST_INCLUDE
#include<hgl/graph/VK.h>
2019-05-25 00:50:04 +08:00
#include<hgl/graph/Camera.h>
#include<hgl/graph/SceneNode.h>
2021-06-10 18:56:23 +08:00
#include<hgl/graph/RenderNode.h>
#include<hgl/graph/VKArrayBuffer.h>
2021-05-24 20:44:20 +08:00
#include<hgl/graph/SceneInfo.h>
#include<hgl/color/Color4f.h>
2022-02-08 11:12:17 +08:00
#include<hgl/type/SortedSets.h>
2019-05-25 00:50:04 +08:00
namespace hgl
{
namespace graph
{
using MVPArrayBuffer=GPUArrayBuffer<MVPMatrix>;
2022-02-08 11:12:17 +08:00
using MaterialSets=SortedSets<Material *>;
2021-04-30 18:56:20 +08:00
/**
* <br>
* mvp用UBO/SSBO等数据RenderCommandBuffer
*/
2019-05-25 00:50:04 +08:00
class RenderList
{
GPUDevice * device;
RenderCmdBuffer *cmd_buf;
2019-05-25 00:50:04 +08:00
private:
CameraInfo camera_info;
RenderNodeList render_node_list; ///<场景节点列表
MaterialSets material_sets; ///<材质合集
RenderNodeComparator render_node_comparator;
private:
MVPArrayBuffer *mvp_array;
List<Renderable *> ri_list;
VkDescriptorSet ds_list[(size_t)DescriptorSetType::RANGE_SIZE];
DescriptorSet *renderable_desc_sets;
uint32_t ubo_offset;
uint32_t ubo_align;
protected:
virtual bool Begin();
virtual bool Expend(SceneNode *);
virtual void End();
private:
2019-05-25 00:50:04 +08:00
2020-10-21 12:47:06 +08:00
Pipeline * last_pipeline;
MaterialParameters *last_mp[(size_t)DescriptorSetType::RANGE_SIZE];
uint32_t last_vbo;
2019-05-25 00:50:04 +08:00
void Render(Renderable *);
2019-05-25 00:50:04 +08:00
public:
RenderList(GPUDevice *);
virtual ~RenderList();
virtual bool Expend(const CameraInfo &,SceneNode *);
virtual bool Render(RenderCmdBuffer *);
};//class RenderList
2019-05-25 00:50:04 +08:00
}//namespace graph
}//namespace hgl
#endif//HGL_GRAPH_RENDER_LIST_INCLUDE