finished auto bound GlobalDescriptor

This commit is contained in:
2023-03-22 15:58:59 +08:00
parent e1c3b95de7
commit ac42dcdb26
14 changed files with 136 additions and 49 deletions

View File

@@ -8,7 +8,7 @@
#include<hgl/graph/SceneInfo.h>
#include<hgl/graph/VKVertexInputConfig.h>
#include<hgl/graph/VKRenderablePrimitiveCreater.h>
#include<hgl/graph/mtl/2d/VertexColor2DNDC.h>
#include<hgl/graph/mtl/2d/VertexColor2D.h>
using namespace hgl;
using namespace hgl::graph;
@@ -98,7 +98,7 @@ private:
bool InitAutoMaterial()
{
MaterialCreateInfo *mci=mtl::CreateVertexColor2DNDC();
MaterialCreateInfo *mci=mtl::CreateVertexColor2D(CoordinateSystem2D::NDC);
material_instance=db->CreateMaterialInstance(mci,&vil_config);

View File

@@ -5,6 +5,7 @@
#include<hgl/math/Math.h>
#include<hgl/filesystem/FileSystem.h>
#include<hgl/graph/SceneInfo.h>
#include<hgl/graph/mtl/2d/VertexColor2D.h>
using namespace hgl;
using namespace hgl::graph;
@@ -40,8 +41,14 @@ private:
private:
bool InitMaterial()
{
material_instance=db->CreateMaterialInstance(OS_TEXT("res/material/VertexColor2D"));
{
MaterialCreateInfo *mci=mtl::CreateVertexColor2D(CoordinateSystem2D::Ortho);
//material_instance=db->CreateMaterialInstance(OS_TEXT("res/material/VertexColor2D"));
material_instance=db->CreateMaterialInstance(mci);
delete mci;
if(!material_instance)
return(false);

View File

@@ -116,7 +116,7 @@ public:
cili.lunarg.standard_validation = true;
cili.khronos.validation = true;
//cili.RenderDoc.Capture = true;
cili.RenderDoc.Capture = true;
inst=CreateInstance("VulkanTest",nullptr,&cili);
@@ -142,7 +142,7 @@ public:
ubo_vp_info=db->CreateUBO(sizeof(ViewportInfo),&vp_info);
db->SetGlobal(GlobalShaderUBO::ViewportInfo,ubo_vp_info);
db->SetGlobal(GlobalDescriptor::ViewportInfo.name,ubo_vp_info);
}
return(true);