Browse Source

Added a couple comments documenting why some codepaths have been chosen.

Alex Szpakowski 10 years ago
parent
commit
247daa85b5
2 changed files with 4 additions and 0 deletions
  1. 2 0
      src/modules/graphics/opengl/OpenGL.cpp
  2. 2 0
      src/modules/graphics/opengl/Shader.cpp

+ 2 - 0
src/modules/graphics/opengl/OpenGL.cpp

@@ -325,6 +325,8 @@ void OpenGL::prepareDraw()
 	if (Shader::current != nullptr)
 		Shader::current->checkSetBuiltinUniforms();
 
+	// We use glLoadMatrix rather than uniforms for our matrices when possible,
+	// because uniform uploads can be significantly slower than glLoadMatrix.
 	if (GLAD_VERSION_1_0)
 	{
 		const Matrix &curproj = matrices.projection.back();

+ 2 - 0
src/modules/graphics/opengl/Shader.cpp

@@ -696,6 +696,8 @@ void Shader::checkSetBuiltinUniforms()
 {
 	checkSetScreenParams();
 
+	// We use a more efficient method for sending transformation matrices to
+	// the GPU on desktop GL.
 	if (GLAD_ES_VERSION_2_0)
 	{
 		checkSetPointSize(gl.getPointSize());