X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprogramcompiler.cpp;h=b004b08bee6f533e437f09051ca28d9bfdb22fbb;hb=6109322ffc5dec1a777807fcbefacafe94d1d5eb;hp=c35fa275c2b1bbadbcfbfb8f113cf68d165d4a8a;hpb=6dc2da27f0831d4172fcfeba4900616fd6c844b8;p=libs%2Fgl.git diff --git a/source/programcompiler.cpp b/source/programcompiler.cpp index c35fa275..b004b08b 100644 --- a/source/programcompiler.cpp +++ b/source/programcompiler.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include "error.h" @@ -71,8 +72,11 @@ void ProgramCompiler::add_shaders(Program &program) else if(i->type==FRAGMENT) { program.attach_shader_owned(new FragmentShader(apply(*i))); - for(map::iterator j=i->locations.begin(); j!=i->locations.end(); ++j) - program.bind_fragment_data(j->second, j->first); + if(EXT_gpu_shader4) + { + for(map::iterator j=i->locations.begin(); j!=i->locations.end(); ++j) + program.bind_fragment_data(j->second, j->first); + } } } } @@ -1678,6 +1682,8 @@ void ProgramCompiler::LegacyConverter::visit(VariableDeclaration &var) } else if(stage->type==FRAGMENT && var.interface=="out") { + if(location!=0) + static Require _req(EXT_gpu_shader4); stage->locations[var.name] = location; var.layout->qualifiers.erase(i); }