diff options
Diffstat (limited to 'src/gui/opengl/qopenglshaderprogram.cpp')
-rw-r--r-- | src/gui/opengl/qopenglshaderprogram.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp index 2ae9c6d327..6d7aecac6f 100644 --- a/src/gui/opengl/qopenglshaderprogram.cpp +++ b/src/gui/opengl/qopenglshaderprogram.cpp @@ -496,6 +496,13 @@ static const char redefineHighp[] = "#endif\n"; #endif +// Boiler-plate header to have the layout attributes available we need later +static const char blendEquationAdvancedHeader[] = + "#ifdef GL_KHR_blend_equation_advanced\n" + "#extension GL_ARB_fragment_coord_conventions : enable\n" + "#extension GL_KHR_blend_equation_advanced : enable\n" + "#endif\n"; + struct QVersionDirectivePosition { Q_DECL_CONSTEXPR QVersionDirectivePosition(int position = 0, int line = -1) @@ -636,6 +643,10 @@ bool QOpenGLShader::compileSourceCode(const char *source) } } } + if (d->shaderType == Fragment) { + sourceChunks.append(blendEquationAdvancedHeader); + sourceChunkLengths.append(GLint(sizeof(blendEquationAdvancedHeader) - 1)); + } // The precision qualifiers are useful on OpenGL/ES systems, // but usually not present on desktop systems. |