return features;
}
-Features Features::all()
+Features Features::from_version(const Version &ver)
{
Features features;
features.gl_api = OPENGL;
- features.glsl_version = Version(4, 60);
- features.arb_enhanced_layouts = true;
- features.arb_explicit_attrib_location = true;
- features.arb_explicit_uniform_location = true;
- features.arb_gpu_shader5 = true;
- features.arb_separate_shader_objects = true;
- features.arb_uniform_buffer_object = true;
- features.ext_gpu_shader4 = true;
- features.ext_texture_array = true;
+ features.glsl_version = ver;
+ features.arb_enhanced_layouts = (ver>=Version(4, 40));
+ features.arb_explicit_attrib_location = (ver>=Version(1, 30));
+ features.arb_explicit_uniform_location = (ver>=Version(4, 30));
+ features.arb_gpu_shader5 = (ver>=Version(4, 0));
+ features.arb_separate_shader_objects = (ver>=Version(4, 10));
+ features.arb_uniform_buffer_object = (ver>=Version(1, 50));
+ features.ext_gpu_shader4 = (ver>=Version(1, 20));
+ features.ext_texture_array = (ver>=Version(1, 30));
+ features.uniform_binding_range = (ver>=Version(4, 30) ? 84 : ver>=Version(4, 0) ? 60 :
+ ver>=Version(3, 30) ? 36 : 24);
+ features.texture_binding_range = (ver>=Version(4, 30) ? 96 : ver>=Version(4, 0) ? 80 :
+ ver>=Version(1, 50) ? 48 : ver>=Version(1, 40) ? 32 : 16);
return features;
}
+Features Features::latest()
+{
+ return from_version(Version(4, 60));
+}
+
} // namespace SL
} // namespace GL
} // namespace Msp
void GlslCompilerTest::run_test_case(const TestCase *test_case)
{
- GL::SL::Compiler compiler(GL::SL::Features::all());
+ GL::SL::Compiler compiler(GL::SL::Features::latest());
try
{
compiler.set_source(test_case->source, "<test>");
void GlslCompilerIdempotence::run_test_case(const TestCase *test_case)
{
- GL::SL::Compiler compiler(GL::SL::Features::all());
+ GL::SL::Compiler compiler(GL::SL::Features::latest());
compiler.set_source(test_case->source, "<test>");
if(test_case->compile_mode==GL::SL::Compiler::PROGRAM)
compiler.specialize(test_case->spec_values);
compiler.compile(test_case->compile_mode);
- GL::SL::Compiler compiler2(GL::SL::Features::all());
+ GL::SL::Compiler compiler2(GL::SL::Features::latest());
compiler2.set_source(compiler.get_combined_glsl(), "<loopback>");
compiler2.compile(test_case->compile_mode);