From 247daa85b55a99488df1bbc260e4008739da0885 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Wed, 24 Jun 2015 22:25:55 -0300 Subject: [PATCH] Added a couple comments documenting why some codepaths have been chosen. --- src/modules/graphics/opengl/OpenGL.cpp | 2 ++ src/modules/graphics/opengl/Shader.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/modules/graphics/opengl/OpenGL.cpp b/src/modules/graphics/opengl/OpenGL.cpp index dd05338f3..0f11dfb43 100644 --- a/src/modules/graphics/opengl/OpenGL.cpp +++ b/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(); diff --git a/src/modules/graphics/opengl/Shader.cpp b/src/modules/graphics/opengl/Shader.cpp index 1dd57f76c..103a089b9 100644 --- a/src/modules/graphics/opengl/Shader.cpp +++ b/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());