Updated examples to match new shader api

This commit is contained in:
Alejandro Saucedo 2021-02-21 10:06:29 +00:00
parent 92f556ff57
commit 82a56b7e85
10 changed files with 20 additions and 59 deletions

View file

@ -38,7 +38,7 @@ Shader::compile_sources(const std::vector<std::string>& sources,
if (!shader.parse(&glslang::DefaultTBuiltInResource, 100, false, messages))
{
info_log = std::string(shader.getInfoLog()) + "\n" + std::string(shader.getInfoDebugLog());
SPDLOG_ERROR(info_log);
SPDLOG_ERROR("Kompute Shader Error: {}", info_log);
throw std::runtime_error(info_log);
}
@ -49,7 +49,7 @@ Shader::compile_sources(const std::vector<std::string>& sources,
if (!program.link(messages))
{
info_log = std::string(program.getInfoLog()) + "\n" + std::string(program.getInfoDebugLog());
SPDLOG_ERROR(info_log);
SPDLOG_ERROR("Kompute Shader Error: {}", info_log);
throw std::runtime_error(info_log);
}
@ -57,7 +57,7 @@ Shader::compile_sources(const std::vector<std::string>& sources,
if (shader.getInfoLog())
{
info_log += std::string(shader.getInfoLog()) + "\n" + std::string(shader.getInfoDebugLog()) + "\n";
SPDLOG_INFO(info_log);
SPDLOG_INFO("Kompute Shader Information: {}", info_log);
}
glslang::TIntermediate *intermediate = program.getIntermediate(language);
@ -65,7 +65,7 @@ Shader::compile_sources(const std::vector<std::string>& sources,
if (!intermediate)
{
info_log += "Failed to get shared intermediate code.\n";
SPDLOG_ERROR(info_log);
SPDLOG_ERROR("Kompute Shader Error: {}", info_log);
throw std::runtime_error(info_log);
}
@ -76,7 +76,7 @@ Shader::compile_sources(const std::vector<std::string>& sources,
if (shader.getInfoLog())
{
info_log += logger.getAllMessages() + "\n";
SPDLOG_DEBUG(info_log);
SPDLOG_DEBUG("Kompute Shader all result messages: {}", info_log);
}
// Shutdown glslang library.