VulkanEngine 0.1
Graphics engine using Vulkan
Loading...
Searching...
No Matches
ShaderModule.h
1// Copyright (c) 2024 Michael Carlie. All Rights Reserved.
2//
3// This software is released under the MIT License.
4// https://opensource.org/licenses/MIT
5
6#ifndef INCLUDE_VULKANENGINE_SHADERMODULE_H_
7#define INCLUDE_VULKANENGINE_SHADERMODULE_H_
8
9#include <filesystem> // NOLINT(build/c++17)
10#include <string>
11#include <vector>
12#include <vulkan/vulkan.hpp>
13
14namespace VulkanEngine {
15
19 public:
24 ShaderModule(const std::string& shader_string, bool is_filepath,
25 vk::ShaderStageFlagBits shader_stage_flag);
26
29
31 const vk::ShaderStageFlagBits getVkShaderStageFlag() const;
32
34 const vk::ShaderModule& getVkShaderModule() const;
35
36 private:
40 std::vector<uint32_t> readSource(std::filesystem::path file_path);
41
45 std::vector<uint32_t> glslToSPIRV(const std::string& name,
46 const std::string& shader_string);
47
49 vk::ShaderModule vk_shader_module;
50
52 vk::ShaderStageFlagBits vk_shader_stage_flag;
53
54 static bool glslang_initialized;
55};
56
57} // namespace VulkanEngine
58
59#endif // INCLUDE_VULKANENGINE_SHADERMODULE_H_
Definition: ShaderModule.h:18
~ShaderModule()
Destructor.
Definition: ShaderModule.cpp:69
const vk::ShaderModule & getVkShaderModule() const
Definition: ShaderModule.cpp:79
const vk::ShaderStageFlagBits getVkShaderStageFlag() const
Definition: ShaderModule.cpp:74
TODO development of this class is in progress.
Definition: Attribute.h:13