VulkanAppFramework增加SetClearColor函数,并产生对应功能。

This commit is contained in:
2020-10-18 19:12:00 +08:00
parent 217f712ca5
commit 4822c9ce53
3 changed files with 16 additions and 3 deletions

View File

@@ -55,6 +55,8 @@ protected:
vulkan::CommandBuffer ** cmd_buf =nullptr;
Color4f clear_color;
protected:
vulkan::Database * db =nullptr;
@@ -77,6 +79,8 @@ public:
{
hgl_zero(key_status);
clear_color.Zero();
#ifdef _DEBUG
if(!vulkan::CheckStrideBytesByFormat())
return(false);
@@ -187,6 +191,11 @@ public:
cb->End();
}
void SetClearColor(COLOR cc)
{
clear_color.Use(cc,1.0);
}
void BuildCommandBuffer(uint32_t index,vulkan::RenderableInstance *ri)
{
if(!ri)
@@ -196,6 +205,8 @@ public:
vulkan::CommandBuffer *cb=cmd_buf[index];
cb->SetClearColor(0,clear_color.r,clear_color.g,clear_color.b);
cb->Begin();
cb->BindFramebuffer(sc_render_target->GetRenderPass(),sc_render_target->GetFramebuffer(index));
cb->BindPipeline(ri->GetPipeline());