Renderer/UberShaderPreprocessor: Log shader code when failing to compile
This commit is contained in:
parent
b468dbe092
commit
1a8805aad1
|
|
@ -5,6 +5,7 @@
|
||||||
#include <Nazara/Renderer/UberShaderPreprocessor.hpp>
|
#include <Nazara/Renderer/UberShaderPreprocessor.hpp>
|
||||||
#include <Nazara/Core/ErrorFlags.hpp>
|
#include <Nazara/Core/ErrorFlags.hpp>
|
||||||
#include <Nazara/Core/File.hpp>
|
#include <Nazara/Core/File.hpp>
|
||||||
|
#include <Nazara/Core/Log.hpp>
|
||||||
#include <Nazara/Renderer/OpenGL.hpp>
|
#include <Nazara/Renderer/OpenGL.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
@ -85,7 +86,18 @@ namespace Nz
|
||||||
code << shaderStage.source;
|
code << shaderStage.source;
|
||||||
|
|
||||||
stage.SetSource(code);
|
stage.SetSource(code);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
stage.Compile();
|
stage.Compile();
|
||||||
|
}
|
||||||
|
catch (const std::exception&)
|
||||||
|
{
|
||||||
|
ErrorFlags errFlags(ErrorFlag_ThrowExceptionDisabled);
|
||||||
|
|
||||||
|
NazaraError("Shader code failed to compile:\n" + code);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
stageIt = shaderStage.cache.emplace(flags, std::move(stage)).first;
|
stageIt = shaderStage.cache.emplace(flags, std::move(stage)).first;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue