Bind ViewportInfo to Global in VulkanAppFramework

This commit is contained in:
hyzboy 2023-03-22 02:40:26 +08:00
parent f2c6c24ddf
commit ee061e4a1a
No known key found for this signature in database
GPG Key ID: 067EE4525D4FB6D3

View File

@ -20,6 +20,7 @@
#include<hgl/graph/VKRenderTarget.h>
#include<hgl/graph/VKRenderResource.h>
#include<hgl/graph/RenderList.h>
#include<hgl/graph/mtl/StdMaterial.h>
#include<hgl/color/Color.h>
#include<hgl/Time.h>
@ -67,6 +68,7 @@ protected:
protected:
ViewportInfo vp_info;
DeviceBuffer * ubo_vp_info =nullptr;
public:
@ -135,14 +137,21 @@ public:
win->Join(this);
{
vp_info.Set(w,h);
ubo_vp_info=db->CreateUBO(sizeof(ViewportInfo),&vp_info);
db->SetGlobal(GlobalShaderUBO::ViewportInfo,ubo_vp_info);
}
return(true);
}
virtual void Resize(int w,int h)
{
vp_info.Set(w,h);
ubo_vp_info->Write(&vp_info);
}
void SetClearColor(const Color4f &cc)