Lugdunum
0.1.0
src
lug
Graphics
Vulkan
API
ShaderModule.cpp
Go to the documentation of this file.
1
#include <
lug/Graphics/Vulkan/API/ShaderModule.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
ShaderModule::ShaderModule
(VkShaderModule shaderModule,
const
Device
* device) : _shaderModule(shaderModule), _device(device) {}
11
12
ShaderModule::ShaderModule
(
ShaderModule
&& shaderModule) {
13
_shaderModule
= shaderModule._shaderModule;
14
_device
= shaderModule.
_device
;
15
shaderModule._shaderModule = VK_NULL_HANDLE;
16
shaderModule._device =
nullptr
;
17
}
18
19
ShaderModule
&
ShaderModule::operator=
(
ShaderModule
&& shaderModule) {
20
destroy
();
21
22
_shaderModule
= shaderModule._shaderModule;
23
_device
= shaderModule.
_device
;
24
shaderModule._shaderModule = VK_NULL_HANDLE;
25
shaderModule._device =
nullptr
;
26
27
return
*
this
;
28
}
29
30
ShaderModule::~ShaderModule
() {
31
destroy
();
32
}
33
34
void
ShaderModule::destroy
() {
35
if
(
_shaderModule
!= VK_NULL_HANDLE) {
36
vkDestroyShaderModule(static_cast<VkDevice>(*
_device
),
_shaderModule
,
nullptr
);
37
_shaderModule
= VK_NULL_HANDLE;
38
}
39
}
40
41
}
// API
42
}
// Vulkan
43
}
// Graphics
44
}
// lug
lug::Graphics::Vulkan::API::ShaderModule
Definition:
ShaderModule.hpp:17
Device.hpp
lug::Graphics::Vulkan::API::ShaderModule::operator=
ShaderModule & operator=(const ShaderModule &)=delete
lug::Graphics::Vulkan::API::ShaderModule::~ShaderModule
~ShaderModule()
Definition:
ShaderModule.cpp:30
Vulkan
Definition:
Vulkan.hpp:155
lug::Graphics::Vulkan::API::Device
Definition:
Device.hpp:16
ShaderModule.hpp
lug::Graphics::Vulkan::API::ShaderModule::_shaderModule
VkShaderModule _shaderModule
Definition:
ShaderModule.hpp:41
lug::Graphics::Vulkan::API::ShaderModule::_device
const Device * _device
Definition:
ShaderModule.hpp:42
lug
Definition:
Application.hpp:11
lug::Graphics::Vulkan::API::Device::_device
VkDevice _device
Definition:
Device.hpp:55
lug::Graphics::Vulkan::API::ShaderModule::destroy
void destroy()
Definition:
ShaderModule.cpp:34
lug::Graphics::Vulkan::API::ShaderModule::ShaderModule
ShaderModule()=default
Generated by
1.8.13