From b2860a1d63170ed4ff4e1db651764dbd64af6b1e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 2 Aug 2014 11:57:42 +0200 Subject: [PATCH] - it looks like glProgramUniform is not working correctly with Intel drivers, so better forget about it for setting the view and projection matrices. Even on NVidia the time difference can only be measured in microseconds per frame so it's not a big loss. --- src/gl/shaders/gl_shader.cpp | 15 +++------------ src/gl/system/gl_interface.cpp | 1 - src/gl/system/gl_interface.h | 4 +--- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/gl/shaders/gl_shader.cpp b/src/gl/shaders/gl_shader.cpp index a1a22e770..480d97d25 100644 --- a/src/gl/shaders/gl_shader.cpp +++ b/src/gl/shaders/gl_shader.cpp @@ -299,18 +299,9 @@ FShader *FShaderManager::Compile (const char *ShaderName, const char *ShaderPath void FShader::ApplyMatrices(VSMatrix *proj, VSMatrix *view) { - - if (gl.flags & RFL_SEPARATE_SHADER_OBJECTS) // this check is just for safety. All supported hardware reports this extension as being present. - { - glProgramUniformMatrix4fv(hShader, projectionmatrix_index, 1, false, proj->get()); - glProgramUniformMatrix4fv(hShader, viewmatrix_index, 1, false, view->get()); - } - else - { - Bind(); - glUniformMatrix4fv(projectionmatrix_index, 1, false, proj->get()); - glUniformMatrix4fv(viewmatrix_index, 1, false, view->get()); - } + Bind(); + glUniformMatrix4fv(projectionmatrix_index, 1, false, proj->get()); + glUniformMatrix4fv(viewmatrix_index, 1, false, view->get()); } diff --git a/src/gl/system/gl_interface.cpp b/src/gl/system/gl_interface.cpp index 2f9425fe9..4da1d9a42 100644 --- a/src/gl/system/gl_interface.cpp +++ b/src/gl/system/gl_interface.cpp @@ -131,7 +131,6 @@ void gl_LoadExtensions() if (CheckExtension("GL_ARB_texture_compression")) gl.flags|=RFL_TEXTURE_COMPRESSION; if (CheckExtension("GL_EXT_texture_compression_s3tc")) gl.flags|=RFL_TEXTURE_COMPRESSION_S3TC; if (CheckExtension("GL_ARB_shader_storage_buffer_object")) gl.flags |= RFL_SHADER_STORAGE_BUFFER; - if (CheckExtension("GL_ARB_separate_shader_objects")) gl.flags |= RFL_SEPARATE_SHADER_OBJECTS; glGetIntegerv(GL_MAX_TEXTURE_SIZE,&gl.max_texturesize); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); diff --git a/src/gl/system/gl_interface.h b/src/gl/system/gl_interface.h index fbafc7ca6..5d59e5560 100644 --- a/src/gl/system/gl_interface.h +++ b/src/gl/system/gl_interface.h @@ -9,9 +9,7 @@ enum RenderFlags RFL_TEXTURE_COMPRESSION=1, RFL_TEXTURE_COMPRESSION_S3TC=2, - RFL_SEPARATE_SHADER_OBJECTS = 4, // we need this extension for glProgramUniform. On hardware not supporting it we need some rather clumsy workarounds - RFL_SHADER_STORAGE_BUFFER = 16, // to be used later for a parameter buffer - RFL_BASEINDEX = 32, // currently unused + RFL_SHADER_STORAGE_BUFFER = 4, // to be used later for a parameter buffer }; enum TexMode