V2 progress
This commit is contained in:
parent
d2f5863552
commit
5e1fcd8590
9837 changed files with 790 additions and 1708518 deletions
|
|
@ -34,7 +34,7 @@ namespace Crafter {
|
|||
bool Shader::Check(const fs::path& outputDir) const {
|
||||
return fs::exists((outputDir/path.filename()).generic_string()+".spv") && fs::last_write_time(path.generic_string()+".glsl") < fs::last_write_time((outputDir/path.filename()).generic_string()+".spv");
|
||||
}
|
||||
void Shader::Compile(const fs::path& outputDir) const {
|
||||
std::string Shader::Compile(const fs::path& outputDir) const {
|
||||
glslang::InitializeProcess();
|
||||
EShMessages messages = static_cast<EShMessages>(EShMsgDefault | EShMsgVulkanRules | EShMsgSpvRules);
|
||||
std::ifstream fileStream(path, std::ios::in | std::ios::binary);
|
||||
|
|
@ -89,12 +89,12 @@ namespace Crafter {
|
|||
|
||||
spv::SpvBuildLogger logger;
|
||||
std::vector<std::uint32_t> spirv;
|
||||
std::cout << info_log;
|
||||
glslang::GlslangToSpv(*intermediate, spirv, &logger);
|
||||
std::cout << logger.getAllMessages();
|
||||
std::string errorLog = logger.getAllMessages();
|
||||
glslang::FinalizeProcess();
|
||||
fs::path filename = path.filename().replace_extension("spv");
|
||||
std::ofstream file(outputDir/filename, std::ios::binary);
|
||||
file.write(reinterpret_cast<const char*>(spirv.data()), spirv.size() * sizeof(std::uint32_t));
|
||||
return errorLog;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue