diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-08-26 08:54:33 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-08-26 11:44:42 (GMT) |
commit | de3939532af08c37e709d1bae8cf50a57d6f63be (patch) | |
tree | 9cb6e27b36249f870838620d234e82aadc77192d /src/opengl/qgraphicsshadereffect.cpp | |
parent | 5a22a926f8f10597a431036533550f05fdf52d85 (diff) | |
download | Qt-de3939532af08c37e709d1bae8cf50a57d6f63be.zip Qt-de3939532af08c37e709d1bae8cf50a57d6f63be.tar.gz Qt-de3939532af08c37e709d1bae8cf50a57d6f63be.tar.bz2 |
Added missing precision specifiers to custom shader effect.
The precision specifiers need to be there on OpenGL ES 2.0.
Reviewed-by: Tom
Diffstat (limited to 'src/opengl/qgraphicsshadereffect.cpp')
-rw-r--r-- | src/opengl/qgraphicsshadereffect.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/opengl/qgraphicsshadereffect.cpp b/src/opengl/qgraphicsshadereffect.cpp index d3f52f6..5e37d62 100644 --- a/src/opengl/qgraphicsshadereffect.cpp +++ b/src/opengl/qgraphicsshadereffect.cpp @@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE The specific effect is defined by a fragment of GLSL source code supplied to setPixelShaderFragment(). This source code must define a function with the signature - \c{lowp vec4 customShader(sampler2D imageTexture, vec2 textureCoords)} + \c{lowp vec4 customShader(lowp sampler2D imageTexture, highp vec2 textureCoords)} that returns the source pixel value to use in the paint engine's shader program. The shader fragment is linked with the regular shader code used by the GL2 paint engine @@ -77,7 +77,7 @@ QT_BEGIN_NAMESPACE \code static char const colorizeShaderCode[] = "uniform lowp vec4 effectColor;\n" - "lowp vec4 customShader(sampler2D imageTexture, vec2 textureCoords) {\n" + "lowp vec4 customShader(lowp sampler2D imageTexture, highp vec2 textureCoords) {\n" " vec4 src = texture2D(imageTexture, textureCoords);\n" " float gray = dot(src.rgb, vec3(0.212671, 0.715160, 0.072169));\n" " vec4 colorize = 1.0-((1.0-gray)*(1.0-effectColor));\n" @@ -130,7 +130,7 @@ QT_BEGIN_NAMESPACE */ static const char qglslDefaultImageFragmentShader[] = "\ - lowp vec4 customShader(sampler2D imageTexture, vec2 textureCoords) { \ + lowp vec4 customShader(lowp sampler2D imageTexture, highp vec2 textureCoords) { \ return texture2D(imageTexture, textureCoords); \ }\n"; @@ -215,13 +215,13 @@ QByteArray QGraphicsShaderEffect::pixelShaderFragment() const this shader effect to \a code. The \a code must define a GLSL function with the signature - \c{lowp vec4 customShader(sampler2D imageTexture, vec2 textureCoords)} + \c{lowp vec4 customShader(lowp sampler2D imageTexture, highp vec2 textureCoords)} that returns the source pixel value to use in the paint engine's shader program. The following is the default pixel shader fragment, which draws a pixmap with no effect applied: \code - lowp vec4 customShader(sampler2D imageTexture, vec2 textureCoords) { + lowp vec4 customShader(lowp sampler2D imageTexture, highp vec2 textureCoords) { return texture2D(imageTexture, textureCoords); } \endcode |