|
|
|
|
@ -34,6 +34,10 @@
|
|
|
|
|
#include "Implementation/ShaderProgramState.h" |
|
|
|
|
#include "Implementation/State.h" |
|
|
|
|
|
|
|
|
|
#if defined(CORRADE_TARGET_NACL_NEWLIB) || defined(CORRADE_TARGET_ANDROID) || defined(__MINGW32__) |
|
|
|
|
#include <sstream> |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
namespace Magnum { |
|
|
|
|
|
|
|
|
|
Int AbstractShaderProgram::maxVertexAttributes() { |
|
|
|
|
@ -289,13 +293,25 @@ bool AbstractShaderProgram::link(std::initializer_list<std::reference_wrapper<Ab
|
|
|
|
|
glGetProgramInfoLog(shader._id, message.size(), nullptr, &message[0]); |
|
|
|
|
message.resize(std::max(logLength, 1)-1); |
|
|
|
|
|
|
|
|
|
/** @todo Remove when this is fixed everywhere (also the include above) */ |
|
|
|
|
#if defined(CORRADE_TARGET_NACL_NEWLIB) || defined(CORRADE_TARGET_ANDROID) || defined(__MINGW32__) |
|
|
|
|
std::ostringstream converter; |
|
|
|
|
converter << i; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
/* Show error log */ |
|
|
|
|
if(!success) { |
|
|
|
|
Error out; |
|
|
|
|
out.setFlag(Debug::NewLineAtTheEnd, false); |
|
|
|
|
out.setFlag(Debug::SpaceAfterEachValue, false); |
|
|
|
|
out << "AbstractShaderProgram::link(): linking"; |
|
|
|
|
if(shaders.size() != 1) out << " of shader " << std::to_string(i); |
|
|
|
|
if(shaders.size() != 1) { |
|
|
|
|
#if !defined(CORRADE_TARGET_NACL_NEWLIB) && !defined(CORRADE_TARGET_ANDROID) && !defined(__MINGW32__) |
|
|
|
|
out << " of shader " << std::to_string(i); |
|
|
|
|
#else |
|
|
|
|
out << " of shader " << converter.str(); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
out << " failed with the following message:\n" |
|
|
|
|
<< message; |
|
|
|
|
|
|
|
|
|
@ -305,7 +321,13 @@ bool AbstractShaderProgram::link(std::initializer_list<std::reference_wrapper<Ab
|
|
|
|
|
out.setFlag(Debug::NewLineAtTheEnd, false); |
|
|
|
|
out.setFlag(Debug::SpaceAfterEachValue, false); |
|
|
|
|
out << "AbstractShaderProgram::link(): linking"; |
|
|
|
|
if(shaders.size() != 1) out << " of shader " << std::to_string(i); |
|
|
|
|
if(shaders.size() != 1) { |
|
|
|
|
#if !defined(CORRADE_TARGET_NACL_NEWLIB) && !defined(CORRADE_TARGET_ANDROID) && !defined(__MINGW32__) |
|
|
|
|
out << " of shader " << std::to_string(i); |
|
|
|
|
#else |
|
|
|
|
out << " of shader " << converter.str(); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
out << " succeeded with the following message:\n" |
|
|
|
|
<< message; |
|
|
|
|
} |
|
|
|
|
|