X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fmodule.cpp;h=4eefc0347494ecadb077e8b0bc8a984688b08464;hb=5cbd8664a7300d0c0076862572adeda9955b1c97;hp=89d418947f92b1685c9ddd0689d9811612114abd;hpb=26602194c7831bb81b42138c4ee1564be9878342;p=libs%2Fgl.git diff --git a/source/core/module.cpp b/source/core/module.cpp index 89d41894..4eefc034 100644 --- a/source/core/module.cpp +++ b/source/core/module.cpp @@ -1,6 +1,6 @@ #include #include -#include "deviceinfo.h" +#include "device.h" #include "module.h" #include "resources.h" @@ -69,8 +69,9 @@ void Module::load_source(IO::Base &io, const string &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()); + const DeviceInfo &dev_info = Device::get_current().get_info(); + const SL::Features &device_features = dev_info.glsl_features; + SL::Features latest_features = SL::Features::latest(dev_info.api); SL::Features features; features.target_api = latest_features.target_api; features.glsl_version = latest_features.glsl_version; @@ -95,41 +96,6 @@ void GlslModule::compile(SL::Compiler &compiler) } -SpirVModule::SpirVModule(const SpirVModule &other): - code(other.code), - entry_points(other.entry_points), - structs(other.structs), - variables(other.variables) -{ - remap_pointers_from(other); -} - -SpirVModule &SpirVModule::operator=(const SpirVModule &other) -{ - code = other.code; - entry_points = other.entry_points; - structs = other.structs; - variables = other.variables; - remap_pointers_from(other); - return *this; -} - -void SpirVModule::remap_pointers_from(const SpirVModule &other) -{ - for(EntryPoint &e: entry_points) - for(const Variable *&v: e.globals) - v = &variables[v-&other.variables.front()]; - - for(Variable &v: variables) - if(v.struct_type) - v.struct_type = &structs[v.struct_type-&other.structs.front()]; - - for(Structure &s: structs) - for(StructMember &m: s.members) - if(m.struct_type) - m.struct_type = &structs[m.struct_type-&other.structs.front()]; -} - void SpirVModule::load_code(IO::Base &io) { uint32_t buffer[1024];