From 08f51821b777bc756c99d8cdbff618e5a3e72861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Wed, 22 Sep 2010 20:13:01 +0000 Subject: [PATCH] Don't set gl_TextCoord[0] in the vertex shader when the fragment shader doesn't use it. svn path=/trunk/KDE/kdebase/workspace/; revision=1178357 --- effects/blur/blurshader.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/effects/blur/blurshader.cpp b/effects/blur/blurshader.cpp index cdfe2a66f4..7e99dabb7b 100644 --- a/effects/blur/blurshader.cpp +++ b/effects/blur/blurshader.cpp @@ -258,14 +258,14 @@ void GLSLBlurShader::init() stream << "\n"; stream << "void main(void)\n"; stream << "{\n"; - stream << " gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;\n\n"; + stream << " vec2 center = vec4(gl_TextureMatrix[0] * gl_MultiTexCoord0).st;\n\n"; for (int i = 0; i < center; i++) - stream << " samplePos" << i << " = gl_TexCoord[0].st + pixelSize * vec2(" + stream << " samplePos" << i << " = center + pixelSize * vec2(" << -(1.5 + (center - i - 1) * 2.0) << ");\n"; - stream << " samplePos" << center << " = gl_TexCoord[0].st;\n"; + stream << " samplePos" << center << " = center;\n"; for (int i = center + 1; i < size; i++) - stream << " samplePos" << i << " = gl_TexCoord[0].st + pixelSize * vec2(" + stream << " samplePos" << i << " = center + pixelSize * vec2(" << 1.5 + (i - center - 1) * 2.0 << ");\n"; stream << "\n"; stream << " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n";