From: havoc Date: Tue, 5 Mar 2013 01:05:14 +0000 (+0000) Subject: don't call glGetUniformBlockIndex without GL_ARB_uniform_buffer_object X-Git-Tag: xonotic-v0.7.0~28 X-Git-Url: https://git.xonotic.org/?a=commitdiff_plain;h=22863920fabca11099ef827cd9396f26780fe6ab;p=xonotic%2Fdarkplaces.git don't call glGetUniformBlockIndex without GL_ARB_uniform_buffer_object as the pointer is NULL (this crashed OpenGL 2.0-3.0 drivers) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11925 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=62622c466cf642d640f2cfbcc7f5e489629834a2 --- diff --git a/gl_rmain.c b/gl_rmain.c index 20f94ecd..d71f3b0b 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -1311,7 +1311,10 @@ static void R_GLSL_CompilePermutation(r_glsl_permutation_t *p, unsigned int mode if (p->loc_Texture_ReflectCube >= 0) {p->tex_Texture_ReflectCube = sampler;qglUniform1i(p->loc_Texture_ReflectCube , sampler);sampler++;} if (p->loc_Texture_BounceGrid >= 0) {p->tex_Texture_BounceGrid = sampler;qglUniform1i(p->loc_Texture_BounceGrid , sampler);sampler++;} // get the uniform block indices so we can bind them - p->ubiloc_Skeletal_Transform12_UniformBlock = qglGetUniformBlockIndex(p->program, "Skeletal_Transform12_UniformBlock"); + if (vid.support.arb_uniform_buffer_object) + p->ubiloc_Skeletal_Transform12_UniformBlock = qglGetUniformBlockIndex(p->program, "Skeletal_Transform12_UniformBlock"); + else + p->ubiloc_Skeletal_Transform12_UniformBlock = -1; // clear the uniform block bindings p->ubibind_Skeletal_Transform12_UniformBlock = -1; // bind the uniform blocks in use