From 89ce0b8cb77073ed3a18dedb8325153a6f0a4c41 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 22 Oct 2014 16:54:26 +0200 Subject: [PATCH] - test if GLSL version 1.4 can handle uniform buffers on old Intel hardware without making problems... --- src/gl/shaders/gl_shader.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gl/shaders/gl_shader.cpp b/src/gl/shaders/gl_shader.cpp index 3d4afdbcc8..7c04bdf454 100644 --- a/src/gl/shaders/gl_shader.cpp +++ b/src/gl/shaders/gl_shader.cpp @@ -94,7 +94,14 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char * if (lightbuffertype == GL_UNIFORM_BUFFER) { - vp_comb.Format("#version 130\n#extension GL_ARB_uniform_buffer_object : require\n#define NUM_UBO_LIGHTS %d\n", lightbuffersize); + if (gl.glslversion < 1.4f || gl.version < 3.1f) + { + vp_comb.Format("#version 130\n#extension GL_ARB_uniform_buffer_object : require\n#define NUM_UBO_LIGHTS %d\n", lightbuffersize); + } + else + { + vp_comb.Format("#version 140\n#define NUM_UBO_LIGHTS %d\n", lightbuffersize); + } } else {