Bladeren bron

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

Alex Szpakowski 10 jaren geleden
bovenliggende
commit
247daa85b5
2 gewijzigde bestanden met toevoegingen van 4 en 0 verwijderingen
  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)
 	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 - 0
src/modules/graphics/opengl/Shader.cpp

@@ -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());