summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-07-03 15:25:40 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-07-03 15:27:49 (GMT)
commit84bbac2a4d7b663e57b74094cbebf8fca16e0ed8 (patch)
tree2f6a82454bed0da42df05d5a7495f00eb52f72be /src/opengl/gl2paintengineex/qglengineshadermanager_p.h
parent108f549a446e13a3be7ee6753be9eb74260547d7 (diff)
downloadQt-84bbac2a4d7b663e57b74094cbebf8fca16e0ed8.zip
Qt-84bbac2a4d7b663e57b74094cbebf8fca16e0ed8.tar.gz
Qt-84bbac2a4d7b663e57b74094cbebf8fca16e0ed8.tar.bz2
Moved uniform enum to QGLEngineShaderManager.
Simplified caching of uniform locations. Reviewed-by: Samuel
Diffstat (limited to 'src/opengl/gl2paintengineex/qglengineshadermanager_p.h')
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager_p.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
index 34f0768..442edfe 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
@@ -274,6 +274,26 @@ public:
TextureSrcWithPattern = Qt::TexturePattern+4
};
+ enum Uniform {
+ ImageTexture,
+ PatternColor,
+ GlobalOpacity,
+ Depth,
+ PmvMatrix,
+ MaskTexture,
+ FragmentColor,
+ LinearData,
+ Angle,
+ HalfViewportSize,
+ Fmp,
+ Fmp2MRadius2,
+ Inverse2Fmp2MRadius2,
+ InvertedTextureSize,
+ BrushTransform,
+ BrushTexture,
+ NumUniforms
+ };
+
// There are optimisations we can do, depending on the brush transform:
// 1) May not have to apply perspective-correction
// 2) Can use lower precision for matrix
@@ -285,8 +305,7 @@ public:
void setMaskType(MaskType);
void setCompositionMode(QPainter::CompositionMode);
- uint getUniformIdentifier(const char *uniformName);
- uint getUniformLocation(uint id);
+ uint getUniformLocation(Uniform id);
void setDirty(); // someone has manually changed the current shader program
bool useCorrectShaderProg(); // returns true if the shader program needed to be changed
@@ -352,6 +371,7 @@ public:
TotalShaderCount, InvalidShaderName
};
+
/*
// These allow the ShaderName enum to be used as a cache key
const int mainVertexOffset = 0;
@@ -391,8 +411,6 @@ private:
void compileNamedShader(QGLEngineShaderManager::ShaderName name, QGLShader::ShaderType type);
static const char* qglEngineShaderSourceCode[TotalShaderCount];
-
- QVector<const char *> uniformIdentifiers;
};
QT_END_NAMESPACE