|
evan 2026.1.4
Evan
|
The GPUShader class represents a shader used in rendering. More...
#include <headers/evan/GPUShader.hpp>


Public Member Functions | |
| GPUShader (VkDevice device, const utility::graphic::Shader &shader) | |
| Constructs a GPUShader object with the given vertex and fragment shader code. | |
| void | destroy () |
| Destroys the shader modules associated with this GPUShader object. | |
| VkShaderModule | getVertexShaderModule () const |
| Retrieves the vertex shader module. | |
| VkShaderModule | getFragmentShaderModule () const |
| Retrieves the fragment shader module. | |
Protected Member Functions | |
| void | cleanup () |
| Releases the Vulkan shader modules owned by this shader. | |
Protected Attributes | |
| VkShaderModule | _vertexShaderModule = VK_NULL_HANDLE |
| VkShaderModule | _fragmentShaderModule = VK_NULL_HANDLE |
| std::vector< uint32_t > | _vertexCode |
| std::vector< uint32_t > | _fragmentCode |
| VkDevice | _logicalDevice = VK_NULL_HANDLE |
The GPUShader class represents a shader used in rendering.
The GPUShader class encapsulates the vertex and fragment shader modules, as well as the SPIR-V code for both shaders. It provides methods to retrieve the shader modules and to destroy the shader modules when they are no longer needed.
Definition at line 28 of file GPUShader.hpp.
Constructs a GPUShader object with the given vertex and fragment shader code.
| device | The Vulkan device used to create the shader modules. |
| shader | A reference to the utility::graphic::Shader object containing the shader data. |
|
protected |
Releases the Vulkan shader modules owned by this shader.
Idempotent: modules are null-checked and reset after destruction.
| void evan::GPUShader::destroy | ( | ) |
| VkShaderModule evan::GPUShader::getFragmentShaderModule | ( | ) | const |
Retrieves the fragment shader module.
| VkShaderModule evan::GPUShader::getVertexShaderModule | ( | ) | const |
Retrieves the vertex shader module.
|
protected |
SPIR-V code for the fragment shader
Definition at line 95 of file GPUShader.hpp.
|
protected |
Vulkan shader module for the fragment shader
Definition at line 85 of file GPUShader.hpp.
|
protected |
Vulkan logical device used to create and manage shader modules
Definition at line 100 of file GPUShader.hpp.
|
protected |
SPIR-V code for the vertex shader
Definition at line 90 of file GPUShader.hpp.
|
protected |
Vulkan shader module for the vertex shader
Definition at line 80 of file GPUShader.hpp.