2019-05-25 00:50:04 +08:00
|
|
|
|
#ifndef HGL_GRAPH_RENDER_LIST_INCLUDE
|
|
|
|
|
#define HGL_GRAPH_RENDER_LIST_INCLUDE
|
|
|
|
|
|
2020-10-21 11:43:18 +08:00
|
|
|
|
#include<hgl/graph/VK.h>
|
2019-05-25 00:50:04 +08:00
|
|
|
|
#include<hgl/graph/Camera.h>
|
2019-05-27 16:54:08 +08:00
|
|
|
|
#include<hgl/graph/SceneNode.h>
|
2021-06-10 18:56:23 +08:00
|
|
|
|
#include<hgl/graph/RenderNode.h>
|
2021-04-26 20:36:56 +08:00
|
|
|
|
#include<hgl/graph/VKArrayBuffer.h>
|
2021-05-24 20:44:20 +08:00
|
|
|
|
#include<hgl/graph/SceneInfo.h>
|
2019-05-25 01:06:33 +08:00
|
|
|
|
#include<hgl/type/Color4f.h>
|
2021-02-05 17:15:16 +08:00
|
|
|
|
#include<hgl/type/Sets.h>
|
2019-05-25 00:50:04 +08:00
|
|
|
|
namespace hgl
|
|
|
|
|
{
|
|
|
|
|
namespace graph
|
|
|
|
|
{
|
2021-04-30 18:56:20 +08:00
|
|
|
|
/**
|
|
|
|
|
* 渲染对象列表<br>
|
|
|
|
|
* 已经展开的渲染对象列表,产生mvp用UBO/SSBO等数据,最终创建RenderCommandBuffer
|
|
|
|
|
*/
|
2019-05-25 00:50:04 +08:00
|
|
|
|
class RenderList
|
|
|
|
|
{
|
2020-12-18 16:52:45 +08:00
|
|
|
|
GPUDevice *device;
|
2020-11-09 15:37:00 +08:00
|
|
|
|
RenderCmdBuffer *cmd_buf;
|
2019-05-25 00:50:04 +08:00
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
2021-01-29 20:50:47 +08:00
|
|
|
|
Camera *camera;
|
|
|
|
|
|
2021-06-15 15:36:30 +08:00
|
|
|
|
GPUBuffer *mvp_buffer;
|
|
|
|
|
List<RenderableInstance *> *ri_list;
|
|
|
|
|
|
|
|
|
|
DescriptorSets *renderable_desc_sets;
|
2021-04-26 20:36:56 +08:00
|
|
|
|
|
2021-06-15 15:36:30 +08:00
|
|
|
|
uint32_t ubo_offset;
|
|
|
|
|
uint32_t ubo_align;
|
2020-11-26 17:51:59 +08:00
|
|
|
|
|
2021-04-26 20:36:56 +08:00
|
|
|
|
private:
|
2019-05-25 00:50:04 +08:00
|
|
|
|
|
2020-10-21 12:47:06 +08:00
|
|
|
|
Pipeline * last_pipeline;
|
2021-06-15 15:36:30 +08:00
|
|
|
|
MaterialInstance * last_mi;
|
|
|
|
|
uint32_t last_vbo;
|
2019-05-25 00:50:04 +08:00
|
|
|
|
|
2021-06-10 18:56:23 +08:00
|
|
|
|
void Render(RenderableInstance *);
|
2019-05-25 00:50:04 +08:00
|
|
|
|
|
2020-12-18 16:52:45 +08:00
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
friend class GPUDevice;
|
|
|
|
|
|
|
|
|
|
RenderList(GPUDevice *);
|
|
|
|
|
|
2021-06-15 15:36:30 +08:00
|
|
|
|
friend class SceneTreeToRenderList;
|
|
|
|
|
|
|
|
|
|
void Set(List<RenderableInstance *> *,GPUBuffer *,const uint32_t);
|
|
|
|
|
|
2019-05-25 00:50:04 +08:00
|
|
|
|
public:
|
|
|
|
|
|
2021-06-15 15:36:30 +08:00
|
|
|
|
virtual ~RenderList()=default;
|
2020-11-26 17:51:59 +08:00
|
|
|
|
|
2020-11-09 15:37:00 +08:00
|
|
|
|
bool Render (RenderCmdBuffer *);
|
2021-04-26 20:36:56 +08:00
|
|
|
|
};//class RenderList
|
2019-05-25 00:50:04 +08:00
|
|
|
|
}//namespace graph
|
|
|
|
|
}//namespace hgl
|
|
|
|
|
#endif//HGL_GRAPH_RENDER_LIST_INCLUDE
|