add DescriptorSets at RenderableInstance class. and renamed RenderableInstance::GetMIDescSets instead of GetDescriptorSets.

This commit is contained in:
2021-05-12 19:03:08 +08:00
parent 015a4d0b8e
commit 199cc5f6b1
4 changed files with 9 additions and 3 deletions

View File

@@ -184,7 +184,7 @@ public:
cb->SetClearColor(0,clear_color.r,clear_color.g,clear_color.b); cb->SetClearColor(0,clear_color.r,clear_color.g,clear_color.b);
cb->BeginRenderPass(); cb->BeginRenderPass();
cb->BindPipeline(ri->GetPipeline()); cb->BindPipeline(ri->GetPipeline());
cb->BindDescriptorSets(ri->GetDescriptorSets()); cb->BindDescriptorSets(ri->GetMIDescSets());
cb->BindVAB(ri); cb->BindVAB(ri);
if (ib) if (ib)

View File

@@ -16,6 +16,8 @@ class RenderableInstance
MaterialInstance * mat_inst; MaterialInstance * mat_inst;
Renderable * render_obj; Renderable * render_obj;
DescriptorSets * descriptor_sets; ///<渲染实例专用描述符合集一般用于存LocalToWorld等等
uint32_t buffer_count; uint32_t buffer_count;
VkBuffer * buffer_list; VkBuffer * buffer_list;
VkDeviceSize * buffer_size; VkDeviceSize * buffer_size;
@@ -42,7 +44,8 @@ public:
const uint32_t GetIndexBufferOffset()const{return render_obj->GetIndexBufferOffset();} const uint32_t GetIndexBufferOffset()const{return render_obj->GetIndexBufferOffset();}
const uint32_t GetDrawCount ()const{return render_obj->GetDrawCount();} const uint32_t GetDrawCount ()const{return render_obj->GetDrawCount();}
DescriptorSets * GetDescriptorSets ()const{return mat_inst->GetDescriptorSets();} DescriptorSets * GetMIDescSets ()const{return mat_inst->GetDescriptorSets();}
DescriptorSets * GetRIDescSets ()const{return descriptor_sets;}
public: public:

2
res

Submodule res updated: bab8e14717...45e1523727

View File

@@ -10,6 +10,8 @@ RenderableInstance::RenderableInstance(Renderable *r,MaterialInstance *mi,Pipeli
mat_inst=mi; mat_inst=mi;
pipeline=p; pipeline=p;
descriptor_sets=nullptr;
buffer_count=count; buffer_count=count;
buffer_list=bl; buffer_list=bl;
buffer_size=bs; buffer_size=bs;
@@ -17,6 +19,7 @@ RenderableInstance::RenderableInstance(Renderable *r,MaterialInstance *mi,Pipeli
RenderableInstance::~RenderableInstance() RenderableInstance::~RenderableInstance()
{ {
SAFE_CLEAR(descriptor_sets);
//需要在这里添加删除pipeline/desc_sets/render_obj引用计数的代码 //需要在这里添加删除pipeline/desc_sets/render_obj引用计数的代码
delete[] buffer_list; delete[] buffer_list;