From 62622c466cf642d640f2cfbcc7f5e489629834a2 Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 5 Mar 2013 01:05:14 +0000 Subject: [PATCH] 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 --- gl_rmain.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.39.2