27 lines
808 B
C++
27 lines
808 B
C++
#pragma once
|
|
|
|
#include "Base/Utils.hpp"
|
|
#include "Base/Wrapper.hpp"
|
|
|
|
#include <shaderc/shaderc.hpp>
|
|
|
|
namespace OpenVulkano
|
|
{
|
|
class ShaderCompiler
|
|
{
|
|
public:
|
|
/**
|
|
* @param absPath - absolute path of the shader that needs to be compiled
|
|
* @param incPath - include path that will be used to resolve includes
|
|
* @param entryPoint - the name of the void function in the shader
|
|
* @param shaderStage - type of the shader that needs to be compiled
|
|
*/
|
|
static Array<uint32_t> CompileGLSLToSpirv(const std::string& absPath, bool hasIncludes,
|
|
const std::string& incPath = std::string(), const std::string& entryPoint = "main")
|
|
#if defined(HAS_SHADERC)
|
|
;
|
|
#else
|
|
{ throw std::runtime_error("Shader compiler is not available on this platform"); }
|
|
#endif
|
|
};
|
|
} |