ULRE/inc/hgl/graph/RenderList2D.h

87 lines
2.2 KiB
C
Raw Normal View History

2023-03-24 22:14:43 +08:00
#ifndef HGL_GRAPH_RENDER_LIST_2D_INCLUDE
#define HGL_GRAPH_RENDER_LIST_2D_INCLUDE
2023-03-23 21:43:10 +08:00
#include<hgl/graph/VK.h>
#include<hgl/graph/SceneNode.h>
2023-03-24 22:14:43 +08:00
#include<hgl/graph/RenderNode2D.h>
2023-03-23 21:43:10 +08:00
#include<hgl/graph/VKArrayBuffer.h>
2023-03-24 22:14:43 +08:00
#include<hgl/graph/VKMaterial.h>
2023-03-23 21:43:10 +08:00
namespace hgl
{
namespace graph
{
2023-03-29 21:19:06 +08:00
using RenderableList=List<Renderable *>;
struct RenderableList
{
Material *mtl;
RenderableList ri_list;
GPUArrayBuffer *.........array;
};
2023-03-23 21:43:10 +08:00
/**
* <br>
* mvp用UBO/SSBO等数据RenderCommandBuffer
*/
2023-03-24 22:14:43 +08:00
class RenderList2D
2023-03-23 21:43:10 +08:00
{
protected:
2023-03-24 22:14:43 +08:00
GPUDevice * device;
RenderCmdBuffer * cmd_buf;
2023-03-23 21:43:10 +08:00
private:
2023-03-24 22:14:43 +08:00
// GPUArrayBuffer * mvp_array;
RenderNode2DList render_node_list; ///<场景节点列表
MaterialSets material_sets; ///<材质合集
2023-03-23 21:43:10 +08:00
2023-03-24 22:14:43 +08:00
RenderNode2DComparator render_node_comparator;
2023-03-23 21:43:10 +08:00
private:
2023-03-29 21:19:06 +08:00
RenderableList ri_list;
*ri_list_by_mtl;
2023-03-23 21:43:10 +08:00
VkDescriptorSet ds_list[DESCRIPTOR_SET_TYPE_COUNT];
DescriptorSet *renderable_desc_sets;
uint32_t ubo_offset;
uint32_t ubo_align;
protected:
virtual bool Begin();
2023-03-24 22:14:43 +08:00
virtual bool ExpendNode(SceneNode *);
2023-03-23 21:43:10 +08:00
virtual void End();
bool BindPerFrameDescriptor();
bool BindPerMaterialDescriptor();
2023-03-23 21:43:10 +08:00
private:
Material * last_mtl;
2023-03-23 21:43:10 +08:00
Pipeline * last_pipeline;
MaterialParameters *last_mp[DESCRIPTOR_SET_TYPE_COUNT];
uint32_t last_vbo;
void Render(Renderable *);
public:
2023-03-24 22:14:43 +08:00
RenderList2D(GPUDevice *);
virtual ~RenderList2D();
2023-03-23 21:43:10 +08:00
virtual bool Expend(SceneNode *);
2023-03-24 22:14:43 +08:00
virtual bool Render(RenderCmdBuffer *);
};//class RenderList2D
2023-03-23 21:43:10 +08:00
}//namespace graph
}//namespace hgl
2023-03-24 22:14:43 +08:00
#endif//HGL_GRAPH_RENDER_LIST_2D_INCLUDE