Lugdunum  0.1.0
GuiTexture.cpp
Go to the documentation of this file.
2 
6 
7 namespace lug {
8 namespace Graphics {
9 namespace Vulkan {
10 namespace Render {
11 namespace DescriptorSetPool {
12 
14 
15 const DescriptorSet* GuiTexture::allocate(const API::GraphicsPipeline& pipeline, const ::lug::Graphics::Vulkan::Render::Texture* texture) {
16  const auto& result = DescriptorSetPool::allocate(
17  reinterpret_cast<size_t>(static_cast<VkImage>(texture->getImage())),
18  pipeline.getLayout()->getDescriptorSetLayouts()[0]
19  );
20 
21  if (std::get<0>(result) && std::get<1>(result)) {
22  std::get<1>(result)->getDescriptorSet().updateImages(
23  0,
24  0,
25  VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
26  {
27  {
28  /* sampler */ static_cast<VkSampler>(texture->getSampler()),
29  /* imageView */ static_cast<VkImageView>(texture->getImageView()),
30  /* imageLayout */ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
31  }
32  }
33  );
34  }
35 
36  return std::get<1>(result);
37 }
38 
39 } // DescriptorSetPool
40 } // Render
41 } // Vulkan
42 } // Graphics
43 } // lug
const DescriptorSet * allocate(const API::GraphicsPipeline &pipeline, const ::lug::Graphics::Vulkan::Render::Texture *texture)
Definition: GuiTexture.cpp:15
std::tuple< bool, const DescriptorSet * > allocate(size_t hash, const API::DescriptorSetLayout &descriptorSetLayout)
const PipelineLayout * getLayout() const
const std::vector< DescriptorSetLayout > & getDescriptorSetLayouts() const
Gets the DescriptorSetLayouts of the PipelineLayout. The PipelineLayout owns these DescriptorSetLayou...