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); if(!p)return(false);
vkCmdBindPipeline(cmd_buf, VK_PIPELINE_BIND_POINT_GRAPHICS,*p);
if(p->GetDescriptorSetCount()>0) if(p->GetDescriptorSetCount()>0)
vkCmdBindDescriptorSets(cmd_buf, VK_PIPELINE_BIND_POINT_GRAPHICS, p->GetLayout(), 0, p->GetDescriptorSetCount(),p->GetDescriptorSets(), 0, nullptr); 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); return(true);
} }

View File

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

View File

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