This commit is contained in:
HuYingzhuo 2019-04-28 18:45:26 +08:00
parent cd331365fe
commit e53a57fe00
3 changed files with 6 additions and 5 deletions

View File

@ -71,10 +71,11 @@ bool CommandBuffer::Bind(Pipeline *p)
{
if(!p)return(false);
vkCmdBindPipeline(cmd_buf, VK_PIPELINE_BIND_POINT_GRAPHICS,*p);
if(p->GetDescriptorSetCount()>0)
vkCmdBindDescriptorSets(cmd_buf, VK_PIPELINE_BIND_POINT_GRAPHICS, p->GetLayout(), 0, p->GetDescriptorSetCount(),p->GetDescriptorSets(), 0, nullptr);
vkCmdBindPipeline(cmd_buf, VK_PIPELINE_BIND_POINT_GRAPHICS,*p);
return(true);
}

View File

@ -26,8 +26,8 @@ public:
VkPipelineLayout GetLayout(){return pipeline_layout;}
const uint32_t GetDescriptorSetCount()const{return desc_sets->GetCount();}
const VkDescriptorSet * GetDescriptorSets()const{return desc_sets->GetData();}
const uint32_t GetDescriptorSetCount ()const{return desc_sets->GetCount();}
const VkDescriptorSet * GetDescriptorSets ()const{return desc_sets->GetData();}
};//class GraphicsPipeline
class Shader;

View File

@ -172,7 +172,7 @@ private:
if(!ubo_mvp)
return(false);
return material_instance->UpdateUBO("world",*ubo_mvp);
}
@ -259,7 +259,7 @@ int main(int,char **)
app.AcquireNextFrame();
app.Draw();
//wait_seconds(0.1);
wait_seconds(0.5);
return 0;
}