evan 2026.1.4
Evan
Loading...
Searching...
No Matches
GPUShader.hpp
1/*
2** ETIB PROJECT, 2025
3** evan
4** File description:
5** GPUShader
6*/
7
8#pragma once
9
10#include <utility/graphic/shader.hpp>
11
12#include <utility/logging/loggable.hpp>
13#include <utility/logging/default_logger.hpp>
14
15#include "evan/EvanPlatform.hpp"
16
17namespace evan
18{
28 class GPUShader:
29 protected utility::logging::Loggable<GPUShader,
30 utility::logging::DefaultLogger>
31 {
32 public:
41 GPUShader(VkDevice device, const utility::graphic::Shader &shader);
42
43 ~GPUShader();
44
53 void destroy();
54
60 VkShaderModule getVertexShaderModule() const;
61
67 VkShaderModule getFragmentShaderModule() const;
68
69 protected:
75 void cleanup();
76
80 VkShaderModule _vertexShaderModule = VK_NULL_HANDLE;
81
85 VkShaderModule _fragmentShaderModule = VK_NULL_HANDLE;
86
90 std::vector<uint32_t> _vertexCode;
91
95 std::vector<uint32_t> _fragmentCode;
96
100 VkDevice _logicalDevice = VK_NULL_HANDLE;
101 };
102} // namespace evan
The GPUShader class represents a shader used in rendering.
Definition GPUShader.hpp:31
std::vector< uint32_t > _fragmentCode
Definition GPUShader.hpp:95
void cleanup()
Releases the Vulkan shader modules owned by this shader.
VkDevice _logicalDevice
void destroy()
Destroys the shader modules associated with this GPUShader object.
std::vector< uint32_t > _vertexCode
Definition GPUShader.hpp:90
GPUShader(VkDevice device, const utility::graphic::Shader &shader)
Constructs a GPUShader object with the given vertex and fragment shader code.
VkShaderModule getFragmentShaderModule() const
Retrieves the fragment shader module.
VkShaderModule _fragmentShaderModule
Definition GPUShader.hpp:85
VkShaderModule _vertexShaderModule
Definition GPUShader.hpp:80
VkShaderModule getVertexShaderModule() const
Retrieves the vertex shader module.