File tree Expand file tree Collapse file tree 4 files changed +16
-5
lines changed Expand file tree Collapse file tree 4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -63,8 +63,9 @@ QtNetwork
63
63
QtOpenGL
64
64
--------
65
65
66
- - foo
67
- * bar
66
+ - QGLShaderProgram
67
+ * [QTBUG-12862] Don't #define highp/mediump/lowp if the desktop OpenGL
68
+ implementation has the GL_ARB_ES2_compatibility extension.
68
69
69
70
QtScript
70
71
--------
Original file line number Diff line number Diff line change @@ -4923,6 +4923,8 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions()
4923
4923
glExtensions |= FragmentProgram;
4924
4924
if (extensions.match (" GL_ARB_fragment_shader" ))
4925
4925
glExtensions |= FragmentShader;
4926
+ if (extensions.match (" GL_ARB_ES2_compatibility" ))
4927
+ glExtensions |= ES2Compatibility;
4926
4928
if (extensions.match (" GL_ARB_texture_mirrored_repeat" ))
4927
4929
glExtensions |= MirroredRepeat;
4928
4930
if (extensions.match (" GL_EXT_framebuffer_object" ))
@@ -4941,6 +4943,7 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions()
4941
4943
glExtensions |= FramebufferObject;
4942
4944
glExtensions |= GenerateMipmap;
4943
4945
glExtensions |= FragmentShader;
4946
+ glExtensions |= ES2Compatibility;
4944
4947
#endif
4945
4948
#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL)
4946
4949
if (extensions.match (" GL_OES_framebuffer_object" ))
Original file line number Diff line number Diff line change @@ -291,7 +291,8 @@ class QGLExtensions {
291
291
DDSTextureCompression = 0x00008000 ,
292
292
ETC1TextureCompression = 0x00010000 ,
293
293
PVRTCTextureCompression = 0x00020000 ,
294
- FragmentShader = 0x00040000
294
+ FragmentShader = 0x00040000 ,
295
+ ES2Compatibility = 0x00080000
295
296
};
296
297
Q_DECLARE_FLAGS (Extensions, Extension)
297
298
Original file line number Diff line number Diff line change @@ -97,6 +97,10 @@ QT_BEGIN_NAMESPACE
97
97
to just features that are present in GLSL/ES, and avoid
98
98
standard variable names that only work on the desktop.
99
99
100
+ If the \c{GL_ARB_ES2_compatibility} extension is present,
101
+ then the above prefix is not added because the desktop OpenGL
102
+ implementation supports precision qualifiers.
103
+
100
104
\section1 Simple shader example
101
105
102
106
\snippet doc/src/snippets/code/src_opengl_qglshaderprogram.cpp 1
@@ -390,8 +394,10 @@ bool QGLShader::compileSourceCode(const char *source)
390
394
srclen.append (GLint (headerLen));
391
395
}
392
396
#ifdef QGL_DEFINE_QUALIFIERS
393
- src.append (qualifierDefines);
394
- srclen.append (GLint (sizeof (qualifierDefines) - 1 ));
397
+ if (!(QGLExtensions::glExtensions () & QGLExtensions::ES2Compatibility)) {
398
+ src.append (qualifierDefines);
399
+ srclen.append (GLint (sizeof (qualifierDefines) - 1 ));
400
+ }
395
401
#endif
396
402
#ifdef QGL_REDEFINE_HIGHP
397
403
if (d->shaderType == Fragment) {
You can’t perform that action at this time.
0 commit comments