Lugdunum  0.1.0
SkyBox.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 
13 SkyBox::SkyBox(Renderer& renderer) : DescriptorSetPool(renderer) {}
14 
15 const DescriptorSet* SkyBox::allocate(const ::lug::Graphics::Vulkan::Render::Texture* skyBox) {
16  const auto& result = DescriptorSetPool::allocate(
17  reinterpret_cast<size_t>(static_cast<VkImage>(skyBox->getImage())),
19  );
20 
21  if (std::get<0>(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>(skyBox->getSampler()),
29  /* imageView */ static_cast<VkImageView>(skyBox->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
static const API::GraphicsPipeline & getPipeline()
Definition: SkyBox.inl:1
const DescriptorSet * allocate(const ::lug::Graphics::Vulkan::Render::Texture *skyBox)
Definition: SkyBox.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...