diff --git a/CMSceneGraph b/CMSceneGraph index 3031a9e4..c22c92c6 160000 --- a/CMSceneGraph +++ b/CMSceneGraph @@ -1 +1 @@ -Subproject commit 3031a9e4e4881060352475686cb6b9b6b84e9b24 +Subproject commit c22c92c64779b91745103c1f552d78e8c9784a85 diff --git a/example/2dVector/line.cpp b/example/2dVector/line.cpp index 41655eb4..14aa55c3 100644 --- a/example/2dVector/line.cpp +++ b/example/2dVector/line.cpp @@ -35,9 +35,9 @@ private: Camera cam; - MaterialParameters * material_instance =nullptr; + MaterialInstance * material_instance =nullptr; RenderableInstance *render_instance =nullptr; - GPUBuffer * ubo_camera_info =nullptr; + GPUBuffer * ubo_camera_info =nullptr; GPUBuffer * ubo_color_material =nullptr; GPUBuffer * ubo_line_config =nullptr; @@ -69,13 +69,6 @@ private: if(!ubo) return(nullptr); - if(!material_instance->BindUBO(name,ubo)) - { - std::cerr<<"Bind UBO<"< to material failed!"<Update(); + { + MaterialParameters *mp_global=material_instance->GetMP(DescriptorSetsType::Global); + + if(!mp_global) + return(false); + + ubo_camera_info =db->CreateUBO(sizeof(CameraInfo), &cam.info); + + mp_global->BindUBO("g_camera",ubo_camera_info); + mp_global->Update(); + } + + { + + MaterialParameters *mp_value=material_instance->GetMP(DescriptorSetsType::Value); + + if(!mp_value) + return(false); + + ubo_color_material =db->CreateUBO(sizeof(Vector4f), &color); + ubo_line_config =db->CreateUBO(sizeof(Line2DConfig), &line_2d_config); + + mp_value->BindUBO("color_material",ubo_color_material); + mp_value->BindUBO("line2d_config",ubo_line_config); + mp_value->Update(); + } + return(true); } diff --git a/example/Vulkan/first_triangle.cpp b/example/Vulkan/first_triangle.cpp index 963b20f5..9676a72d 100644 --- a/example/Vulkan/first_triangle.cpp +++ b/example/Vulkan/first_triangle.cpp @@ -56,8 +56,6 @@ private: bool InitUBO() { - MVPMatrix *mvp=new MVPMatrix; - const VkExtent2D extent=sc_render_target->GetExtent(); cam.width=extent.width; diff --git a/res b/res index cff431d2..bb3e05f4 160000 --- a/res +++ b/res @@ -1 +1 @@ -Subproject commit cff431d24a2e511112e26b6d75b74286cf697dfd +Subproject commit bb3e05f43bcbc2e2cafa1e1e639a8d626e0af738