]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
don't call glGetUniformBlockIndex without GL_ARB_uniform_buffer_object
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 5 Mar 2013 01:05:14 +0000 (01:05 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 5 Mar 2013 01:05:14 +0000 (01:05 +0000)
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

index 20f94ecd73d76cebdc77e350ee3d5ad36588b08a..d71f3b0ba610290a3a8e7c7a8d5153dfddd84607 100644 (file)
@@ -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