28 #ifndef BERSERK_SHADERARCHETYPE_HPP
29 #define BERSERK_SHADERARCHETYPE_HPP
51 auto find = mOptions.find(option);
52 if (find == mOptions.end()) mOptions[option] = mNextOption++;
57 auto find = mOptions.find(option);
58 if (find != mOptions.end())
return find->second;
59 return mOptions[option] = mNextOption++;
64 auto find = mOptions.find(option);
65 return find != mOptions.end();
69 std::unordered_map<StringName, uint32> mOptions;
#define BRK_NS_END
Definition: Config.hpp:48
#define BRK_TEXT(text)
Definition: Config.hpp:53
#define BRK_API
Definition: Config.hpp:32
std::uint32_t uint32
Definition: Typedefs.hpp:44
Handles source code pre-processing of shaders with this archetype.
Definition: ShaderArchetype.hpp:77
virtual BRK_API void DefineFormat(const ShaderCompileOptions &options, MeshFormat &format)=0
virtual BRK_API ~ShaderArchetype()=default
virtual BRK_API const std::vector< RHIShaderLanguage > & GetSupportedLanguages() const =0
virtual BRK_API void DefineOptions(std::vector< ShaderOption > &options) const =0
virtual BRK_API void Process(const InputData &inputData, OutputData &outputData)=0
virtual BRK_API void DefineVariation(const ShaderCompileOptions &options, ShaderVariation &variation)=0
virtual BRK_API bool IsSupportedLanguage(RHIShaderLanguage language) const
Definition: ShaderArchetype.cpp:34
static constexpr const char *const SHADER_PARAMS_BLOCK
Definition: ShaderArchetype.hpp:80
virtual BRK_API const StringName & GetArchetype() const =0
Options passed to compile shader.
Definition: Shader.hpp:67
Assist in building variation key from options.
Definition: ShaderArchetype.hpp:47
BRK_API uint32 GetOption(const StringName &option)
Definition: ShaderArchetype.hpp:56
BRK_API void AddOption(const StringName &option)
Definition: ShaderArchetype.hpp:50
BRK_API bool IsRegistered(const StringName &option)
Definition: ShaderArchetype.hpp:63
Describes variation of compiled shader of the single type (max 64 flags)
Cached shared utf-8 string id.
Definition: StringName.hpp:61
Utf-8 encoded std based default string class.
RHIShaderLanguage
Definition: RHIDefs.hpp:127
Definition: GLDevice.cpp:46
Processing output data.
Definition: ShaderArchetype.hpp:93
bool failed
Definition: ShaderArchetype.hpp:94
RHIShaderLanguage language
Definition: ShaderArchetype.hpp:96
String fragmentCode
Definition: ShaderArchetype.hpp:98
String vertexCode
Definition: ShaderArchetype.hpp:97
String error
Definition: ShaderArchetype.hpp:95