SpiecsEngine
 
Loading...
Searching...
No Matches
Shader.h
Go to the documentation of this file.
1/**
2* @file Shader.h.
3* @brief The Shader Class Definitions.
4* @author Spices.
5*/
6
7#pragma once
8#include "Core/Core.h"
9#include "Resources/Loader/ShaderLoader.h"
10#include "ShaderHelper.h"
11#include "Render/Vulkan/VulkanShaderModule.h"
12
13namespace Spices {
14
15 /**
16 * @brief Shader Class.
17 */
18 class Shader
19 {
20 public:
21
22 /**
23 * @brief Constructor Function.
24 */
25 Shader() = default;
26
27 /**
28 * @brief Constructor Function.
29 * @param[in] name Shader Name.
30 * @param[in] stage ShaderStage.
31 */
32 Shader(const std::string& name, ShaderStage stage);
33
34 /**
35 * @brief Constructor Function.
36 * @param[in] name Shader Name.
37 * @param[in] stage ShaderStage.
38 */
39 Shader(const std::string& name, const std::string& stage);
40
41 /**
42 * @brief Destructor Function.
43 */
44 virtual ~Shader() = default;
45
46 /**
47 * @brief Deserialize the data from a disk file to this class.
48 */
49 void Deserialize();
50
51 /**
52 * @brief Get VulkanShaderModule.
53 * @return Returns VulkanShaderModule.
54 */
55 std::shared_ptr<VulkanShaderModule>& GetShaderModule() { return m_ShaderModule; }
56
57 private:
58
59 /**
60 * @brief Shader name.
61 */
62 std::string m_ShaderName;
63
64 /**
65 * @brief Shader stage.
66 */
68
69 /**
70 * @brief VulkanShaderModule.
71 */
73
74 friend class ShaderLoader;
75 };
76
77}
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
#define VK_CHECK(expr)
Vulkan Check macro. Verify Vulkan API Effectiveness.
Definition VulkanUtils.h:68
ShaderLoader Class. This class only defines static function for load data from shader file.
std::shared_ptr< VulkanShaderModule > & GetShaderModule()
Get VulkanShaderModule.
Definition Shader.h:55
ShaderStage m_ShaderStage
Shader stage.
Definition Shader.h:67
std::shared_ptr< VulkanShaderModule > m_ShaderModule
VulkanShaderModule.
Definition Shader.h:72
Shader(const std::string &name, ShaderStage stage)
Constructor Function.
Definition Shader.cpp:12
Shader(const std::string &name, const std::string &stage)
Constructor Function.
Definition Shader.cpp:24
virtual ~Shader()=default
Destructor Function.
Shader()=default
Constructor Function.
std::string m_ShaderName
Shader name.
Definition Shader.h:62
void Deserialize()
Deserialize the data from a disk file to this class.
Definition Shader.cpp:36
Shader Class.
Definition Shader.h:19
VulkanComputePipeline(VulkanState &vulkanState, const std::string &pipelineName, const ShaderMap &shaders, const PipelineConfigInfo &config)
Constructor Function. Create VkPipeline.
This class is a wrapper of Compute Pipeline.
VulkanIndirectMeshPipelineNV(VulkanState &vulkanState, const std::string &pipelineName, const std::string &materialName, const std::vector< VkPipeline > &pipelineRef, const PipelineConfigInfo &config)
Constructor Function. Create VkPipeline.
This class is a wrapper of Indirect Mesh Pipeline.
VulkanIndirectPipelineNV(VulkanState &vulkanState, const std::string &pipelineName, const std::string &materialName, const std::vector< VkPipeline > &pipelineRef, const PipelineConfigInfo &config)
Constructor Function. Create VkPipeline.
This class is a wrapper of Indirect Pipeline.
VulkanMeshPipeline(VulkanState &vulkanState, const std::string &pipelineName, const ShaderMap &shaders, const PipelineConfigInfo &config)
Constructor Function. Create VkPipeline.
This class is a wrapper of Mesh Pipeline.
VulkanObject(VulkanState &vulkanState)
Constructor Function. Init member variables.
VulkanObject Class. This class defines the basic behaves of VulkanObject. When we create an new Vulka...
VulkanPipeline(VulkanState &vulkanState)
Constructor Function.
virtual ~VulkanPipeline() override
Destructor Function.
static void DefaultPipelineConfigInfo(PipelineConfigInfo &configInfo)
Create a PipelineConfigInfo with default parameter.
VulkanPipeline(VulkanState &vulkanState, const std::string &pipelineName, const ShaderMap &shaders, const PipelineConfigInfo &config)
Constructor Function. Create VkPipeline.
This class is a wrapper of VkPipelineLayout and VkPipeline.
VulkanRayTracingPipeline(VulkanState &vulkanState, const std::string &pipelineName, const ShaderMap &shaders, const PipelineConfigInfo &config)
Constructor Function. Create VkPipeline.
This class is a wrapper of RayTracing Pipeline.
This Class is a Wrapper of VkShaderModule.
ShaderStage
enum of shader stage.
This struct included all infos usd to create a VkPipeline.
This struct contains all Vulkan object in used global.
Definition VulkanUtils.h:74