Public called API, it is entrance.
Read file as bytes.
Compile to spv.
Create shader module.
Read file as bytes.
Compile to spv.
Create shader module.
25 {
27
28 bool isFind = false;
29 std::string filePath;
30 for (auto& it : ResourceSystem::GetSearchFolder())
31 {
34 {
35 isFind = true;
36 break;
37 }
38 }
39 if (!isFind)
40 {
41 std::stringstream ss;
42 ss << "Shader: " << fileName << "file is not found";
43
44 SPICES_CORE_WARN(ss.str());
45
46 return false;
47 }
48
52 std::ifstream stream(filePath);
53 std::stringstream strStream;
54 strStream << stream.rdbuf();
55
59 std::vector<uint8_t> spirv;
61
66
67 return true;
68 }
#define SPICES_PROFILE_ZONE
static bool FileLibrary_Exists(const char *path)
Determine whether the given string is existing a file.
static void CompileToSPV(const std::string &data, const ShaderStage &stage, const std::string &name, std::vector< uint8_t > &spirv)
Compile glsl to spv.
static std::string ToString(ShaderStage stage)
Convert ShaderStage to String.
static VulkanState & GetState()
Get VulkanState in use.
const std::string defaultShaderPath
Const variable: Original Shader File Path.