28 #ifndef BERSERK_RHISHADER_HPP
29 #define BERSERK_RHISHADER_HPP
39 #include <unordered_map>
92 BRK_ERROR(
"Failed to find p=\"" << p <<
"\" in shader name=\"" <<
name <<
"\'");
95 return query->second.location;
101 BRK_ERROR(
"Failed to find p=\"" << p <<
"\" in shader name=\"" <<
name <<
"\'");
104 return query->second.slot;
108 std::unordered_map<StringName, InputAttribute>
inputs;
109 std::unordered_map<StringName, DataParam>
params;
111 std::unordered_map<StringName, ObjectParam>
samplers;
#define BRK_NS_END
Definition: Config.hpp:48
#define BRK_API
Definition: Config.hpp:32
std::uint32_t uint32
Definition: Typedefs.hpp:44
std::uint16_t uint16
Definition: Typedefs.hpp:41
Base class for RHI resource.
Definition: RHIResource.hpp:55
Compiled and linked native shader.
Definition: RHIShader.hpp:139
const StringName & GetShaderName() const
Definition: RHIShader.hpp:184
virtual BRK_API Status GetCompilationStatus() const =0
StringName mName
Definition: RHIShader.hpp:194
const std::vector< RHIShaderStageDesc > & GetStages() const
Definition: RHIShader.hpp:190
virtual BRK_API Ref< const RHIShaderMeta > GetShaderMeta() const =0
virtual BRK_API String GetCompilerMessage() const =0
std::vector< RHIShaderStageDesc > mStages
Definition: RHIShader.hpp:200
RHIShaderLanguage GetLanguage() const
Definition: RHIShader.hpp:187
RHIShaderLanguage mLanguage
Definition: RHIShader.hpp:197
Status
Program may have different status (incorrect shaders mush not crash the application)
Definition: RHIShader.hpp:142
@ PendingCompilation
Program pending to be compiled.
@ Compiled
Program successfully compiled.
@ FailedCompile
Failed to compile and link program.
BRK_API ~RHIShader() override=default
Reference counted base object.
Definition: RefCnt.hpp:52
Cached shared utf-8 string id.
Definition: StringName.hpp:61
Utf-8 encoded std based default string class.
#define BRK_ERROR(message)
Definition: Logger.hpp:148
RHIShaderParamType
Definition: RHIDefs.hpp:106
RHIShaderDataType
Definition: RHIDefs.hpp:83
RHIShaderType
Definition: RHIDefs.hpp:122
RHIVertexElementType
Definition: RHIDefs.hpp:71
RHIShaderLanguage
Definition: RHIDefs.hpp:127
Definition: GLDevice.cpp:46
Shader creation descriptor. Allows create from byteCode.
Definition: RHIShader.hpp:127
Ref< Data > byteCode
Definition: RHIShader.hpp:128
RHIShaderLanguage language
Definition: RHIShader.hpp:130
std::vector< RHIShaderStageDesc > stages
Definition: RHIShader.hpp:131
StringName name
Definition: RHIShader.hpp:129
std::function< void(Ref< class RHIShader >)> callback
Definition: RHIShader.hpp:132
Single shader stage.
Definition: RHIShader.hpp:118
RHIShaderType type
Definition: RHIShader.hpp:119
String sourceCode
Definition: RHIShader.hpp:120