ULRE/inc/hgl/graph/RenderList2D.h

65 lines
1.7 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef HGL_GRAPH_RENDER_LIST_2D_INCLUDE
#define HGL_GRAPH_RENDER_LIST_2D_INCLUDE
#include<hgl/graph/VK.h>
#include<hgl/graph/SceneNode.h>
#include<hgl/graph/RenderNode2D.h>
#include<hgl/graph/VKArrayBuffer.h>
#include<hgl/graph/VKMaterial.h>
namespace hgl
{
namespace graph
{
/**
* 渲染对象列表<br>
* 已经展开的渲染对象列表产生mvp用UBO/SSBO等数据最终创建RenderCommandBuffer
*/
class RenderList2D
{
protected:
GPUDevice * device;
RenderCmdBuffer * cmd_buf;
private:
MaterialRenderMap2D mrl_map; ///<按材质分类的渲染列表
RenderNode2DComparator render_node_comparator;
private:
VkDescriptorSet ds_list[DESCRIPTOR_SET_TYPE_COUNT];
DescriptorSet *renderable_desc_sets;
protected:
virtual bool Begin();
virtual bool ExpendNode(SceneNode *);
virtual void End();
bool BindPerFrameDescriptor();
bool BindPerMaterialDescriptor();
private:
Material * last_mtl;
Pipeline * last_pipeline;
MaterialParameters *last_mp[DESCRIPTOR_SET_TYPE_COUNT];
uint32_t last_vbo;
void Render(Renderable *);
public:
RenderList2D(GPUDevice *);
virtual ~RenderList2D();
virtual bool Expend(SceneNode *);
virtual bool Render(RenderCmdBuffer *);
};//class RenderList2D
}//namespace graph
}//namespace hgl
#endif//HGL_GRAPH_RENDER_LIST_2D_INCLUDE