17#ifndef _FGE_SHADER_MANAGER_HPP_INCLUDED
18#define _FGE_SHADER_MANAGER_HPP_INCLUDED
20#include "FastEngine/fge_extern.hpp"
22#include "FastEngine/manager/C_baseManager.hpp"
23#include "FastEngine/vulkan/C_shader.hpp"
25#define FGE_SHADER_BAD FGE_MANAGER_BAD
26#define FGE_SHADER_DEFAULT_VERTEX "FGE:VERTEX"
27#define FGE_SHADER_DEFAULT_NOTEXTURE_FRAGMENT "FGE:NT_FRAG"
28#define FGE_SHADER_DEFAULT_FRAGMENT "FGE:FRAG"
36enum class ShaderInputTypes
53 using BaseManager::BaseManager;
69 [[nodiscard]]
bool isInitialized()
override;
70 void uninitialize()
override;
89 fge::vulkan::Shader::Type type,
90 ShaderInputTypes input,
91 bool debugBuild =
false);
103 std::filesystem::path path,
104 fge::vulkan::Shader::Type type,
105 ShaderInputTypes input,
106 bool debugBuild =
false);
134 char const* shaderIn,
136 std::vector<uint32_t>& shaderOut,
137 char const* shaderName,
138 char const* entryPointName,
142FGE_API
bool SaveSpirVToBinaryFile(std::vector<uint32_t>
const& spirv, std::filesystem::path
const& path);
Base class for all managers.
Definition C_baseManager.hpp:63
Manage shaders.
Definition shader_manager.hpp:51
bool initialize() override
Initialize the shader manager.
bool loadFromFile(std::string_view name, std::filesystem::path path, fge::vulkan::Shader::Type type, ShaderInputTypes input, bool debugBuild=false)
Load a shader from a file.
bool loadFromMemory(std::string_view name, void const *data, int size, fge::vulkan::Shader::Type type, ShaderInputTypes input, bool debugBuild=false)
Load a shader from the memory.
FGE_API bool CompileAndLinkShader(fge::vulkan::Shader::Type type, char const *shaderIn, int shaderInSize, std::vector< uint32_t > &shaderOut, char const *shaderName, char const *entryPointName, bool debugBuild, bool isHlsl)
Public API access to glslang.
FGE_API ShaderManager gManager
The global shader manager.
Definition C_baseManager.hpp:42
Definition shader_manager.hpp:34