From afb65a869e1cc6d3afd215bc364db2fbf1374adb Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 5 Dec 2017 13:37:32 +0200 Subject: [PATCH] Check for EXT_gpu_shader4 support when binding fragment data locations --- source/programcompiler.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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); } -- 2.45.2