Lugdunum
0.1.0
src
lug
Graphics
Vulkan
API
GraphicsPipeline.cpp
Go to the documentation of this file.
1
#include <
lug/Graphics/Vulkan/API/GraphicsPipeline.hpp
>
2
3
#include <
lug/Graphics/Vulkan/API/Device.hpp
>
4
5
namespace
lug
{
6
namespace
Graphics {
7
namespace
Vulkan
{
8
namespace
API {
9
10
GraphicsPipeline::GraphicsPipeline
(VkPipeline pipeline,
const
Device
* device,
RenderPass
renderPass,
PipelineLayout
pipelineLayout) :
11
_pipeline(pipeline), _device(device), _renderPass(
std
::move(renderPass)), _pipelineLayout(
std
::move(pipelineLayout)) {}
12
13
GraphicsPipeline::GraphicsPipeline
(
GraphicsPipeline
&& pipeline) {
14
_pipeline
= pipeline._pipeline;
15
_device
= pipeline.
_device
;
16
_pipelineLayout
= std::move(pipeline._pipelineLayout);
17
_renderPass
= std::move(pipeline._renderPass);
18
pipeline._pipeline = VK_NULL_HANDLE;
19
pipeline._device =
nullptr
;
20
}
21
22
GraphicsPipeline
&
GraphicsPipeline::operator=
(
GraphicsPipeline
&& pipeline) {
23
destroy
();
24
25
_pipeline
= pipeline._pipeline;
26
_device
= pipeline.
_device
;
27
_pipelineLayout
= std::move(pipeline._pipelineLayout);
28
_renderPass
= std::move(pipeline._renderPass);
29
pipeline._pipeline = VK_NULL_HANDLE;
30
pipeline._device =
nullptr
;
31
32
return
*
this
;
33
}
34
35
GraphicsPipeline::~GraphicsPipeline
() {
36
destroy
();
37
}
38
39
void
GraphicsPipeline::destroy
() {
40
_pipelineLayout
.
destroy
();
41
_renderPass
.
destroy
();
42
43
if
(
_pipeline
!= VK_NULL_HANDLE) {
44
vkDestroyPipeline(static_cast<VkDevice>(*
_device
),
_pipeline
,
nullptr
);
45
_pipeline
= VK_NULL_HANDLE;
46
}
47
}
48
49
const
RenderPass
*
GraphicsPipeline::getRenderPass
()
const
{
50
return
&
_renderPass
;
51
}
52
53
const
PipelineLayout
*
GraphicsPipeline::getLayout
()
const
{
54
return
&
_pipelineLayout
;
55
}
56
57
}
// API
58
}
// Vulkan
59
}
// Graphics
60
}
// lug
lug::Graphics::Vulkan::API::GraphicsPipeline::getRenderPass
const RenderPass * getRenderPass() const
Definition:
GraphicsPipeline.cpp:49
lug::Graphics::Vulkan::API::GraphicsPipeline::_device
const Device * _device
Definition:
GraphicsPipeline.hpp:45
lug::Graphics::Vulkan::API::GraphicsPipeline::GraphicsPipeline
GraphicsPipeline()=default
lug::Graphics::Vulkan::API::GraphicsPipeline::_pipeline
VkPipeline _pipeline
Definition:
GraphicsPipeline.hpp:44
Device.hpp
lug::Graphics::Vulkan::API::GraphicsPipeline::~GraphicsPipeline
~GraphicsPipeline()
Definition:
GraphicsPipeline.cpp:35
GraphicsPipeline.hpp
lug::Graphics::Vulkan::API::PipelineLayout::destroy
void destroy()
Definition:
PipelineLayout.cpp:44
std
Definition:
Pipeline.hpp:231
lug::Graphics::Vulkan::API::RenderPass
Definition:
RenderPass.hpp:21
lug::Graphics::Vulkan::API::GraphicsPipeline::destroy
void destroy()
Definition:
GraphicsPipeline.cpp:39
lug::Graphics::Vulkan::API::GraphicsPipeline::operator=
GraphicsPipeline & operator=(const GraphicsPipeline &)=delete
Vulkan
Definition:
Vulkan.hpp:155
lug::Graphics::Vulkan::API::Device
Definition:
Device.hpp:16
lug::Graphics::Vulkan::API::PipelineLayout
Definition:
PipelineLayout.hpp:21
lug::Graphics::Vulkan::API::GraphicsPipeline::_renderPass
RenderPass _renderPass
Definition:
GraphicsPipeline.hpp:47
lug
Definition:
Application.hpp:11
lug::Graphics::Vulkan::API::GraphicsPipeline::_pipelineLayout
PipelineLayout _pipelineLayout
Definition:
GraphicsPipeline.hpp:48
lug::Graphics::Vulkan::API::GraphicsPipeline::getLayout
const PipelineLayout * getLayout() const
Definition:
GraphicsPipeline.cpp:53
lug::Graphics::Vulkan::API::Device::_device
VkDevice _device
Definition:
Device.hpp:55
lug::Graphics::Vulkan::API::GraphicsPipeline
Definition:
GraphicsPipeline.hpp:17
lug::Graphics::Vulkan::API::RenderPass::destroy
void destroy()
Definition:
RenderPass.cpp:35
Generated by
1.8.13