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 1fe30f7e0e..46963f0dbf 100644 --- a/src/gui/opengl/qopenglshaderprogram.cpp +++ b/src/gui/opengl/qopenglshaderprogram.cpp @@ -497,6 +497,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) @@ -637,6 +644,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. |