void Module::set_source(const string &src)
{
- SL::Compiler compiler(DeviceInfo::get_global().glsl_features);
+ SL::Compiler compiler(create_features());
compiler.set_source(src);
compile(compiler);
}
void Module::load_source(IO::Base &io, Resources *res, const string &name)
{
- SL::Compiler compiler(DeviceInfo::get_global().glsl_features);
+ SL::Compiler compiler(create_features());
compiler.load_source(io, res, name);
compile(compiler);
}
load_source(io, 0, name);
}
+SL::Features Module::create_features() const
+{
+ const SL::Features &device_features = DeviceInfo::get_global().glsl_features;
+ SL::Features latest_features = SL::Features::latest(get_backend_api());
+ SL::Features features;
+ features.target_api = latest_features.target_api;
+ features.glsl_version = latest_features.glsl_version;
+ features.constant_id_range = device_features.constant_id_range;
+ features.uniform_binding_range = device_features.uniform_binding_range;
+ features.texture_binding_range = device_features.texture_binding_range;
+ return features;
+}
+
void GlslModule::compile(SL::Compiler &compiler)
{