aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2013-10-19 14:21:31 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-21 19:10:50 +0200
commitde31a57672ec461c2081f65e3631134ee45de887 (patch)
tree98678959c8af0bc36629c97ecf0c2ede77e05db2 /src/particles
parenta3f01331263eddbc502fb88734568ac38df5e316 (diff)
Don't use reserved keyword "texture" as uniform variable name
The "texture" keyword is a function name in OpenGL core profile. This commit is in preparation for making the Qt Quick 2 renderer and materials work with a core profile context. Change-Id: Iad243e64ab8db739fc46b85bb626bdb8b9ceb208 Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/particles')
-rw-r--r--src/particles/qquickimageparticle.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/particles/qquickimageparticle.cpp b/src/particles/qquickimageparticle.cpp
index c550ef8f20..fa828d7b63 100644
--- a/src/particles/qquickimageparticle.cpp
+++ b/src/particles/qquickimageparticle.cpp
@@ -204,7 +204,7 @@ static const char vertexShaderCode[] =
"}\n";
static const char fragmentShaderCode[] =
- "uniform sampler2D texture;\n"
+ "uniform sampler2D _qt_texture;\n"
"uniform lowp float qt_Opacity;\n"
"\n"
"#if defined(SPRITE)\n"
@@ -224,21 +224,21 @@ static const char fragmentShaderCode[] =
"\n"
"void main() {\n"
"#if defined(SPRITE)\n"
- " gl_FragColor = mix(texture2D(texture, fTexS.xy), texture2D(texture, fTexS.zw), tt.y)\n"
+ " gl_FragColor = mix(texture2D(_qt_texture, fTexS.xy), texture2D(_qt_texture, fTexS.zw), tt.y)\n"
" * fColor\n"
" * texture2D(colortable, tt)\n"
" * qt_Opacity;\n"
"#elif defined(TABLE)\n"
- " gl_FragColor = texture2D(texture, fTex)\n"
+ " gl_FragColor = texture2D(_qt_texture, fTex)\n"
" * fColor\n"
" * texture2D(colortable, tt)\n"
" * qt_Opacity;\n"
"#elif defined(DEFORM)\n"
- " gl_FragColor = (texture2D(texture, fTex)) * fColor * qt_Opacity;\n"
+ " gl_FragColor = (texture2D(_qt_texture, fTex)) * fColor * qt_Opacity;\n"
"#elif defined(COLOR)\n"
- " gl_FragColor = (texture2D(texture, gl_PointCoord)) * fColor * qt_Opacity;\n"
+ " gl_FragColor = (texture2D(_qt_texture, gl_PointCoord)) * fColor * qt_Opacity;\n"
"#else\n"
- " gl_FragColor = texture2D(texture, gl_PointCoord) * (fFade * qt_Opacity);\n"
+ " gl_FragColor = texture2D(_qt_texture, gl_PointCoord) * (fFade * qt_Opacity);\n"
"#endif\n"
"}\n";
@@ -296,7 +296,7 @@ public:
void initialize() {
QSGSimpleMaterialShader<TabledMaterialData>::initialize();
program()->bind();
- program()->setUniformValue("texture", 0);
+ program()->setUniformValue("_qt_texture", 0);
program()->setUniformValue("colortable", 1);
glFuncs = QOpenGLContext::currentContext()->functions();
m_timestamp_id = program()->uniformLocation("timestamp");
@@ -358,7 +358,7 @@ public:
void initialize() {
QSGSimpleMaterialShader<DeformableMaterialData>::initialize();
program()->bind();
- program()->setUniformValue("texture", 0);
+ program()->setUniformValue("_qt_texture", 0);
glFuncs = QOpenGLContext::currentContext()->functions();
m_timestamp_id = program()->uniformLocation("timestamp");
m_entry_id = program()->uniformLocation("entry");
@@ -409,7 +409,7 @@ public:
void initialize() {
QSGSimpleMaterialShader<SpriteMaterialData>::initialize();
program()->bind();
- program()->setUniformValue("texture", 0);
+ program()->setUniformValue("_qt_texture", 0);
program()->setUniformValue("colortable", 1);
glFuncs = QOpenGLContext::currentContext()->functions();
//Don't actually expose the animSheetSize in the shader, it's currently only used for CPU calculations.
@@ -488,7 +488,7 @@ public:
void initialize() {
QSGSimpleMaterialShader<ColoredMaterialData>::initialize();
program()->bind();
- program()->setUniformValue("texture", 0);
+ program()->setUniformValue("_qt_texture", 0);
glFuncs = QOpenGLContext::currentContext()->functions();
m_timestamp_id = program()->uniformLocation("timestamp");
m_entry_id = program()->uniformLocation("entry");
@@ -552,7 +552,7 @@ public:
void initialize() {
QSGSimpleMaterialShader<SimpleMaterialData>::initialize();
program()->bind();
- program()->setUniformValue("texture", 0);
+ program()->setUniformValue("_qt_texture", 0);
glFuncs = QOpenGLContext::currentContext()->functions();
m_timestamp_id = program()->uniformLocation("timestamp");
m_entry_id = program()->uniformLocation("entry");