Lugdunum  0.1.0
Material.cpp
Go to the documentation of this file.
2 
5 
6 namespace lug {
7 namespace Graphics {
8 namespace Vulkan {
9 namespace Render {
10 namespace DescriptorSetPool {
11 
13 
15  const auto& result = DescriptorSetPool::allocate(
16  reinterpret_cast<size_t>(static_cast<VkBuffer>(*subBuffer.getBuffer())),
17  _renderer.getPipeline(Pipeline::getBaseId())->getPipelineAPI().getLayout()->getDescriptorSetLayouts()[2]
18  );
19 
20  if (std::get<0>(result) && std::get<1>(result)) {
21  std::get<1>(result)->getDescriptorSet().updateBuffers(
22  0,
23  0,
24  VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC,
25  {
26  {
27  static_cast<VkBuffer>(*subBuffer.getBuffer()),
28  0,
29  subBuffer.getSize()
30  }
31  }
32  );
33  }
34 
35  return std::get<1>(result);
36 }
37 
38 } // DescriptorSetPool
39 } // Render
40 } // Vulkan
41 } // Graphics
42 } // lug
Resource::SharedPtr< Render::Pipeline > getPipeline(Render::Pipeline::Id id)
Definition: Renderer.inl:77
std::tuple< bool, const DescriptorSet * > allocate(size_t hash, const API::DescriptorSetLayout &descriptorSetLayout)
const DescriptorSet * allocate(const BufferPool::SubBuffer &subBuffer)
Definition: Material.cpp:14