Lugdunum  0.1.0
GraphicsPipeline.cpp
Go to the documentation of this file.
2 
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 
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 
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 
36  destroy();
37 }
38 
42 
43  if (_pipeline != VK_NULL_HANDLE) {
44  vkDestroyPipeline(static_cast<VkDevice>(*_device), _pipeline, nullptr);
45  _pipeline = VK_NULL_HANDLE;
46  }
47 }
48 
50  return &_renderPass;
51 }
52 
54  return &_pipelineLayout;
55 }
56 
57 } // API
58 } // Vulkan
59 } // Graphics
60 } // lug
GraphicsPipeline & operator=(const GraphicsPipeline &)=delete
const PipelineLayout * getLayout() const