Lugdunum
0.1.0
src
lug
Graphics
Vulkan
Render
DescriptorSetPool
GuiTexture.cpp
Go to the documentation of this file.
1
#include <
lug/Graphics/Vulkan/Render/DescriptorSetPool/GuiTexture.hpp
>
2
3
#include <
lug/Graphics/Vulkan/API/Buffer.hpp
>
4
#include <
lug/Graphics/Vulkan/Render/Texture.hpp
>
5
#include <
lug/Graphics/Vulkan/Renderer.hpp
>
6
7
namespace
lug
{
8
namespace
Graphics {
9
namespace
Vulkan
{
10
namespace
Render {
11
namespace
DescriptorSetPool {
12
13
GuiTexture::GuiTexture
(
Renderer
& renderer) :
DescriptorSetPool
(renderer) {}
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
lug::Graphics::Vulkan::Render::DescriptorSetPool::DescriptorSet
Definition:
DescriptorSet.hpp:14
GuiTexture.hpp
Texture.hpp
Vulkan
Definition:
Vulkan.hpp:155
Buffer.hpp
lug::Graphics::Vulkan::Render::DescriptorSetPool::GuiTexture::allocate
const DescriptorSet * allocate(const API::GraphicsPipeline &pipeline, const ::lug::Graphics::Vulkan::Render::Texture *texture)
Definition:
GuiTexture.cpp:15
lug::Graphics::Vulkan::Render::DescriptorSetPool::DescriptorSetPool::allocate
std::tuple< bool, const DescriptorSet * > allocate(size_t hash, const API::DescriptorSetLayout &descriptorSetLayout)
Definition:
DescriptorSetPool.inl:47
Renderer.hpp
lug
Definition:
Application.hpp:11
lug::Graphics::Vulkan::API::GraphicsPipeline::getLayout
const PipelineLayout * getLayout() const
Definition:
GraphicsPipeline.cpp:53
lug::Graphics::Vulkan::API::PipelineLayout::getDescriptorSetLayouts
const std::vector< DescriptorSetLayout > & getDescriptorSetLayouts() const
Gets the DescriptorSetLayouts of the PipelineLayout. The PipelineLayout owns these DescriptorSetLayou...
Definition:
PipelineLayout.inl:1
lug::Graphics::Vulkan::Renderer
Definition:
Renderer.hpp:21
lug::Graphics::Vulkan::API::GraphicsPipeline
Definition:
GraphicsPipeline.hpp:17
lug::Graphics::Vulkan::Render::DescriptorSetPool::DescriptorSetPool
Definition:
DescriptorSet.hpp:12
lug::Graphics::Vulkan::Render::DescriptorSetPool::GuiTexture::GuiTexture
GuiTexture(Renderer &renderer)
Definition:
GuiTexture.cpp:13
Generated by
1.8.13