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

This commit is contained in:
Alex Szpakowski
2015-06-24 22:25:55 -03:00
parent 4c571e8fd7
commit 247daa85b5
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -325,6 +325,8 @@ void OpenGL::prepareDraw()
if (Shader::current != nullptr) if (Shader::current != nullptr)
Shader::current->checkSetBuiltinUniforms(); 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) if (GLAD_VERSION_1_0)
{ {
const Matrix &curproj = matrices.projection.back(); const Matrix &curproj = matrices.projection.back();
+2
View File
@@ -696,6 +696,8 @@ void Shader::checkSetBuiltinUniforms()
{ {
checkSetScreenParams(); checkSetScreenParams();
// We use a more efficient method for sending transformation matrices to
// the GPU on desktop GL.
if (GLAD_ES_VERSION_2_0) if (GLAD_ES_VERSION_2_0)
{ {
checkSetPointSize(gl.getPointSize()); checkSetPointSize(gl.getPointSize());