- /* XXX Conceptually a bit weird place for this, but I couldn't really come up
- with anything better that would still be transparent. */
- if(extensions.count("GL_ARB_shader_objects"))
- init_arb_shader_objects();
- if(extensions.count("GL_ARB_vertex_shader"))
- init_arb_vertex_shader();
- if(extensions.count("GL_ARB_vertex_program"))
- init_arb_vertex_program();
- if(extensions.count("GL_EXT_framebuffer_object"))
- init_ext_framebuffer_object();
- if(extensions.count("GL_ARB_vertex_buffer_object"))
- init_arb_vertex_buffer_object();
- if(extensions.count("GL_NV_primitive_restart"))
- init_nv_primitive_restart();
+ string renderer = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
+ if(renderer.find("Radeon")!=string::npos)
+ {
+ /* Radeon doesn't process NV_primitive_restart correctly and treats
+ the restart index as a normal element if the indices are stored in a
+ buffer. */
+ extensions.erase("GL_NV_primitive_restart");
+
+ /* AMD's uniform buffer objects only work with the core version of
+ shaders. */
+ if(!(get_gl_version()>=Version(2, 0)))
+ extensions.erase("GL_ARB_uniform_buffer_object");
+ }
+
+ if(const char *disable_ptr = getenv("MSPGL_DISABLE_EXTENSIONS"))
+ {
+ vector<string> disable = split(disable_ptr);
+ for(vector<string>::const_iterator i=disable.begin(); i!=disable.end(); ++i)
+ extensions.erase(*i);
+ }