From: Mikko Rasa Date: Tue, 5 Dec 2017 11:37:32 +0000 (+0200) Subject: Check for EXT_gpu_shader4 support when binding fragment data locations X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=afb65a869e1cc6d3afd215bc364db2fbf1374adb Check for EXT_gpu_shader4 support when binding fragment data locations --- 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); }