added first_set. but we don't support disorder descriptorSet
This commit is contained in:
parent
12dd8cf649
commit
2852003a71
@ -114,11 +114,11 @@ public:
|
||||
return(true);
|
||||
}
|
||||
|
||||
bool BindDescriptorSets(VkPipelineLayout pipeline_layout,const VkDescriptorSet *ds_list,const uint32_t ds_count,const uint32_t *offset,const uint32_t offset_count)
|
||||
bool BindDescriptorSets(VkPipelineLayout pipeline_layout,const uint32_t first_set,const VkDescriptorSet *ds_list,const uint32_t ds_count,const uint32_t *offset,const uint32_t offset_count)
|
||||
{
|
||||
if(!ds_list||ds_count<=0)return(false);
|
||||
|
||||
vkCmdBindDescriptorSets(cmd_buf,VK_PIPELINE_BIND_POINT_GRAPHICS,pipeline_layout,0,ds_count,ds_list,offset_count,offset);
|
||||
vkCmdBindDescriptorSets(cmd_buf,VK_PIPELINE_BIND_POINT_GRAPHICS,pipeline_layout,first_set,ds_count,ds_list,offset_count,offset);
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
@ -214,7 +214,8 @@ namespace hgl
|
||||
}
|
||||
|
||||
{
|
||||
int ds_count=0;
|
||||
uint32_t ds_count=0;
|
||||
uint32_t first_set=0;
|
||||
MaterialParameters *mp;
|
||||
|
||||
for(int i=(int)DescriptorSetType::BEGIN_RANGE;
|
||||
@ -223,9 +224,9 @@ namespace hgl
|
||||
{
|
||||
mp=ri->GetMP((DescriptorSetType)i);
|
||||
|
||||
// if(last_mp[i]!=mp)
|
||||
if(last_mp[i]!=mp)
|
||||
{
|
||||
//last_mp[i]=mp;
|
||||
last_mp[i]=mp;
|
||||
|
||||
if(mp)
|
||||
{
|
||||
@ -233,6 +234,11 @@ namespace hgl
|
||||
++ds_count;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(mp)
|
||||
++first_set;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
@ -243,11 +249,11 @@ namespace hgl
|
||||
ds_list[ds_count]=mp->GetVkDescriptorSet();
|
||||
++ds_count;
|
||||
|
||||
cmd_buf->BindDescriptorSets(ri->GetPipelineLayout(),ds_list,ds_count,&ubo_offset,1);
|
||||
cmd_buf->BindDescriptorSets(ri->GetPipelineLayout(),first_set,ds_list,ds_count,&ubo_offset,1);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmd_buf->BindDescriptorSets(ri->GetPipelineLayout(),ds_list,ds_count,nullptr,0);
|
||||
cmd_buf->BindDescriptorSets(ri->GetPipelineLayout(),first_set,ds_list,ds_count,nullptr,0);
|
||||
}
|
||||
|
||||
ubo_offset+=ubo_align;
|
||||
|
Loading…
x
Reference in New Issue
Block a user