- for(vector<const Extension *>::const_iterator i=s.required_extensions.begin(); i!=s.required_extensions.end(); ++i)
- append(format("#extension %s: require\n", (*i)->get_name()));
- if(!s.required_extensions.empty())
- formatted += '\n';
-
- visit(s.content);
+ if(s.required_features.arb_enhanced_layouts)
+ append("#extension GL_ARB_enhanced_layouts: require\n");
+ if(s.required_features.arb_explicit_attrib_location)
+ append("#extension GL_ARB_explicit_attrib_location: require\n");
+ if(s.required_features.arb_explicit_uniform_location)
+ append("#extension GL_ARB_explicit_uniform_location: require\n");
+ if(s.required_features.arb_gpu_shader5)
+ append("#extension GL_ARB_gpu_shader5: require\n");
+ if(s.required_features.arb_separate_shader_objects)
+ append("#extension GL_ARB_separate_shader_objects: require\n");
+ if(s.required_features.arb_uniform_buffer_object)
+ append("#extension GL_ARB_uniform_buffer_object: require\n");
+ if(s.required_features.ext_gpu_shader4)
+ append("#extension GL_EXT_gpu_shader4: require\n");
+ if(s.required_features.ext_texture_array)
+ append("#extension GL_EXT_texture_array: require\n");
+ formatted += '\n';
+
+ s.content.visit(*this);