removed PerObject of DescriptorSetType

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2023-04-21 20:27:28 +08:00
parent 011fbdb55d
commit 0e589e8bcd
3 changed files with 4 additions and 17 deletions

View File

@ -1,5 +1,5 @@
#ifndef HGL_GRAPH_VULKAN_DESCRIPTOR_SETS_LAYOUT_INCLUDE #ifndef HGL_GRAPH_VULKAN_DESCRIPTOR_SET_INCLUDE
#define HGL_GRAPH_VULKAN_DESCRIPTOR_SETS_LAYOUT_INCLUDE #define HGL_GRAPH_VULKAN_DESCRIPTOR_SET_INCLUDE
#include<hgl/graph/VK.h> #include<hgl/graph/VK.h>
#include<hgl/type/Map.h> #include<hgl/type/Map.h>
@ -64,4 +64,4 @@ public:
void Update(); void Update();
};//class DescriptorSet };//class DescriptorSet
VK_NAMESPACE_END VK_NAMESPACE_END
#endif//HGL_GRAPH_VULKAN_DESCRIPTOR_SETS_LAYOUT_INCLUDE #endif//HGL_GRAPH_VULKAN_DESCRIPTOR_SET_INCLUDE

View File

@ -40,7 +40,6 @@ public:
#define MP_TYPE_IS(name) const bool is##name()const{return set_type==DescriptorSetType::name;} #define MP_TYPE_IS(name) const bool is##name()const{return set_type==DescriptorSetType::name;}
MP_TYPE_IS(Instance) MP_TYPE_IS(Instance)
MP_TYPE_IS(PerObject)
MP_TYPE_IS(PerMaterial) MP_TYPE_IS(PerMaterial)
MP_TYPE_IS(PerFrame) MP_TYPE_IS(PerFrame)
MP_TYPE_IS(Global) MP_TYPE_IS(Global)

View File

@ -105,9 +105,6 @@ bool RenderCmdBuffer::BindDescriptorSets(Renderable *ri)
{ {
if(!ri)return(false); if(!ri)return(false);
uint32_t *dynamic_offset=nullptr;
uint32_t dynamic_count=0;
{ {
uint32_t count=0; uint32_t count=0;
@ -122,13 +119,6 @@ bool RenderCmdBuffer::BindDescriptorSets(Renderable *ri)
{ {
ds[count]=mp->GetVkDescriptorSet(); ds[count]=mp->GetVkDescriptorSet();
++count; ++count;
if((DescriptorSetType)i==DescriptorSetType::PerObject)
{
dynamic_count=mp->GetBoundCount();
dynamic_offset=hgl_zero_new<uint32_t>(dynamic_count);
}
} }
} }
@ -136,9 +126,7 @@ bool RenderCmdBuffer::BindDescriptorSets(Renderable *ri)
{ {
pipeline_layout=ri->GetPipelineLayout(); pipeline_layout=ri->GetPipelineLayout();
vkCmdBindDescriptorSets(cmd_buf,VK_PIPELINE_BIND_POINT_GRAPHICS,pipeline_layout,0,count,ds,dynamic_count,dynamic_offset); vkCmdBindDescriptorSets(cmd_buf,VK_PIPELINE_BIND_POINT_GRAPHICS,pipeline_layout,0,count,ds,0,0);
SAFE_CLEAR_ARRAY(dynamic_offset);
} }
} }