From d12f65a66a67972d0373dc50bf40baf37d08066a Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 28 Jan 2015 09:51:23 +0100 Subject: Add more notes regarding the uniform setters Having overloads for GLuint that call glUniformNi was a mistake to begin with, and it has only been made worse when later OpenGL versions introduced unsigned int support and glUniformNui. Note this in the docs. Task-number: QTBUG-37012 Change-Id: Icc867221d0fbced8c4ff769deee66effa022f1b5 Reviewed-by: Gunnar Sletta --- src/gui/opengl/qopenglshaderprogram.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/gui/opengl/qopenglshaderprogram.cpp') diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp index 2d99833fdf..61efbe03ee 100644 --- a/src/gui/opengl/qopenglshaderprogram.cpp +++ b/src/gui/opengl/qopenglshaderprogram.cpp @@ -1970,6 +1970,9 @@ void QOpenGLShaderProgram::setUniformValue(const char *name, GLint value) Sets the uniform variable at \a location in the current context to \a value. This function should be used when setting sampler values. + \note This function is not aware of unsigned int support in modern OpenGL + versions and therefore treats \a value as a GLint and calls glUniform1i. + \sa setAttributeValue() */ void QOpenGLShaderProgram::setUniformValue(int location, GLuint value) @@ -1986,6 +1989,9 @@ void QOpenGLShaderProgram::setUniformValue(int location, GLuint value) Sets the uniform variable called \a name in the current context to \a value. This function should be used when setting sampler values. + \note This function is not aware of unsigned int support in modern OpenGL + versions and therefore treats \a value as a GLint and calls glUniform1i. + \sa setAttributeValue() */ void QOpenGLShaderProgram::setUniformValue(const char *name, GLuint value) @@ -2753,6 +2759,9 @@ void QOpenGLShaderProgram::setUniformValueArray context to the \a count elements of \a values. This overload should be used when setting an array of sampler values. + \note This function is not aware of unsigned int support in modern OpenGL + versions and therefore treats \a value as a GLint and calls glUniform1iv. + \sa setAttributeValue() */ void QOpenGLShaderProgram::setUniformValueArray(int location, const GLuint *values, int count) -- cgit v1.2.3