Browse Source

GL: new "angle-chatty-shader-compiler" workaround.

pull/495/head
Vladimír Vondruš 5 years ago
parent
commit
0dc181d846
  1. 3
      doc/changelog.dox
  2. 6
      src/Magnum/GL/AbstractShaderProgram.cpp
  3. 3
      src/Magnum/GL/AbstractShaderProgram.h
  4. 5
      src/Magnum/GL/Implementation/ShaderProgramState.cpp
  5. 9
      src/Magnum/GL/Implementation/driverSpecific.cpp

3
doc/changelog.dox

@ -81,6 +81,9 @@ See also:
happening during EGL initialization in recent NVidia drivers. See
@ref opengl-workarounds and [mosra/magnum#491](https://github.com/mosra/magnum/pull/491)
for more information.
- A new @cpp "angle-chatty-shader-compiler" @ce workarounds for silencing
useless linker output on ANGLE. See @ref opengl-workarounds for more
information.
@subsubsection changelog-latest-new-math Math library

6
src/Magnum/GL/AbstractShaderProgram.cpp

@ -544,6 +544,12 @@ void AbstractShaderProgram::cleanLogImplementationIntelWindows(std::string& mess
}
#endif
#if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL)
void AbstractShaderProgram::cleanLogImplementationAngle(std::string& message) {
if(message == "\n") message = {};
}
#endif
Int AbstractShaderProgram::uniformLocationInternal(const Containers::ArrayView<const char> name) {
const GLint location = glGetUniformLocation(_id, name);
if(location == -1)

3
src/Magnum/GL/AbstractShaderProgram.h

@ -1351,6 +1351,9 @@ class MAGNUM_GL_EXPORT AbstractShaderProgram: public AbstractObject {
#if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_TARGET_GLES)
static MAGNUM_GL_LOCAL void cleanLogImplementationIntelWindows(std::string& message);
#endif
#if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL)
static MAGNUM_GL_LOCAL void cleanLogImplementationAngle(std::string& message);
#endif
void use();

5
src/Magnum/GL/Implementation/ShaderProgramState.cpp

@ -65,6 +65,11 @@ ShaderProgramState::ShaderProgramState(Context& context, std::vector<std::string
cleanLogImplementation = &AbstractShaderProgram::cleanLogImplementationIntelWindows;
} else
#endif
#if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL)
if((context.detectedDriver() & Context::DetectedDriver::Angle) && !context.isDriverWorkaroundDisabled("angle-chatty-shader-compiler")) {
cleanLogImplementation = &AbstractShaderProgram::cleanLogImplementationAngle;
} else
#endif
{
cleanLogImplementation = &AbstractShaderProgram::cleanLogImplementationNoOp;
}

9
src/Magnum/GL/Implementation/driverSpecific.cpp

@ -40,6 +40,13 @@ namespace {
/* Search the code for the following strings to see where they are implemented. */
const char* KnownWorkarounds[]{
/* [workarounds] */
#if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL)
/* ANGLE's shader linker insists on returning a message consisting of a
single newline on success, causing annoying noise in the console. Similar to
"intel-windows-chatty-shader-compiler". */
"angle-chatty-shader-compiler",
#endif
#if defined(CORRADE_TARGET_APPLE) && !defined(MAGNUM_TARGET_GLES)
/* Calling glBufferData(), glMapBuffer(), glMapBufferRange() or glUnmapBuffer()
on ANY buffer when ANY buffer is attached to a currently bound
@ -337,7 +344,7 @@ const char* KnownWorkarounds[]{
"intel-windows-broken-dsa-integer-vertex-attributes",
/* Shader compiler on Intel Windows drivers insists on telling me "No errors."
when it should just stay silent. */
when it should just stay silent. See also "angle-chatty-shader-compiler". */
"intel-windows-chatty-shader-compiler",
/* When using more than just a vertex and fragment shader (geometry shader,

Loading…
Cancel
Save