X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Fmodule.cpp;h=4eefc0347494ecadb077e8b0bc8a984688b08464;hp=15bd750cf0b299bd7ea8440ed6d0be5adc3788d1;hb=5cbd8664a7300d0c0076862572adeda9955b1c97;hpb=0e61ac01ae99391c6b1301a9bf8de62fe651dac3 diff --git a/source/core/module.cpp b/source/core/module.cpp index 15bd750c..4eefc034 100644 --- a/source/core/module.cpp +++ b/source/core/module.cpp @@ -96,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];