X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Ffinalize.cpp;fp=source%2Fglsl%2Ffinalize.cpp;h=cb304aa31d6b979efab1d9e3f63659be10334e3d;hb=89de98315588ec89ad66e9a4f3f90bf03e1f7733;hp=7eb0165dc5b82156d6a71caca7953508ad74aa33;hpb=efbce87192ce73ba577684369f759693dccec67c;p=libs%2Fgl.git diff --git a/source/glsl/finalize.cpp b/source/glsl/finalize.cpp index 7eb0165d..cb304aa3 100644 --- a/source/glsl/finalize.cpp +++ b/source/glsl/finalize.cpp @@ -62,8 +62,9 @@ void StructOrganizer::visit(VariableDeclaration &var) } -void LocationAllocator::apply(Module &module, const Features &features) +void LocationAllocator::apply(Module &module, const Features &features, bool a) { + alloc_new = a; for(Stage &s: module.stages) apply(s); @@ -111,6 +112,9 @@ void LocationAllocator::allocate_locations(const string &iface) } } + if(!alloc_new) + continue; + set &used = used_locations[(*i)->interface]; unsigned size = LocationCounter().apply(**i); @@ -142,7 +146,7 @@ void LocationAllocator::bind_uniform(RefPtr &layout, const string &name, auto i = uniforms.find(name); if(i!=uniforms.end() && i->second.bind_point>=0) add_layout_qualifier(layout, Layout::Qualifier("binding", i->second.bind_point)); - else + else if(alloc_new) { set &used = used_bindings[0];