Added function to compile built in shaders
This commit is contained in:
parent
54796773b2
commit
4eaa15d999
|
@ -139,4 +139,17 @@ namespace SHADE
|
|||
|
||||
return {};
|
||||
}
|
||||
|
||||
std::optional<std::string> SHShaderSourceCompiler::CompileShaderFromString
|
||||
(std::string const& string, AssetPath path, SH_SHADER_TYPE type) noexcept
|
||||
{
|
||||
auto const data = CompileShaderSourceToMemory(string, path.filename().string(), type);
|
||||
|
||||
if (data == nullptr)
|
||||
{
|
||||
return{};
|
||||
}
|
||||
|
||||
return CompileShaderSourceToBinary(path, *data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,5 +24,7 @@ namespace SHADE
|
|||
|
||||
public:
|
||||
static std::optional<std::string> LoadAndCompileShader(AssetPath path) noexcept;
|
||||
static std::optional<std::string> CompileShaderFromString
|
||||
(std::string const& string, AssetPath path, SH_SHADER_TYPE type) noexcept;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -82,6 +82,7 @@ namespace SHADE
|
|||
|
||||
static std::vector<SHAssetData const*> GetAllDataOfType(AssetType type) noexcept;
|
||||
static std::vector<SHAsset> GetAllRecordOfType(AssetType type) noexcept;
|
||||
|
||||
private:
|
||||
/****************************************************************************
|
||||
* \brief Load resource data into memory
|
||||
|
|
Loading…
Reference in New Issue