diff --git a/example/Vulkan/Atomsphere.cpp b/example/Vulkan/Atomsphere.cpp index cdbdb732..97d6e341 100644 --- a/example/Vulkan/Atomsphere.cpp +++ b/example/Vulkan/Atomsphere.cpp @@ -61,9 +61,6 @@ private: bool InitUBO() { -// if(!material_instance->BindUBO("g_camera",GetCameraInfoBuffer())) -// return(false); - ubo_atomsphere=db->CreateUBO(sizeof(AtmosphereData),&atomsphere_data); if(!ubo_atomsphere) diff --git a/example/Vulkan/RectanglePrimitive.cpp b/example/Vulkan/RectanglePrimitive.cpp index 77706b83..c8f90fe9 100644 --- a/example/Vulkan/RectanglePrimitive.cpp +++ b/example/Vulkan/RectanglePrimitive.cpp @@ -38,10 +38,10 @@ private: Texture2D * texture =nullptr; Sampler * sampler =nullptr; - MaterialParameters * material_instance =nullptr; + MaterialInstance * material_instance =nullptr; Renderable * render_obj =nullptr; RenderableInstance *render_instance =nullptr; - GPUBuffer * ubo_camera_info =nullptr; + GPUBuffer * ubo_camera_info =nullptr; Pipeline * pipeline =nullptr; @@ -60,9 +60,27 @@ private: sampler=db->CreateSampler(); - material_instance->BindSampler("tex",texture,sampler); - material_instance->BindUBO("camera",ubo_camera_info); - material_instance->Update(); + { + MaterialParameters *mp_global=material_instance->GetMP(DescriptorSetType::Global); + + if(!mp_global) + return(false); + + if(!mp_global->BindUBO("g_camera",ubo_camera_info))return(false); + + mp_global->Update(); + } + + { + MaterialParameters *mp_texture=material_instance->GetMP(DescriptorSetType::Value); + + if(!mp_texture) + return(false); + + if(!mp_texture->BindSampler("tex",texture,sampler))return(false); + + mp_texture->Update(); + } db->Add(texture); return(true); diff --git a/res b/res index ef811956..836925e4 160000 --- a/res +++ b/res @@ -1 +1 @@ -Subproject commit ef811956f435a9f694abd43f108f3455c4467506 +Subproject commit 836925e4f0d239347fdd0fe9c5c4c79d8d7107d2