]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/compatibility.cpp
Throw an exception if a feature required by a shader is missing
[libs/gl.git] / source / glsl / compatibility.cpp
index 2e13a5f678eaa7592809fa292071b89cecf28beb..3407386248210035c8a6dee75fee815a9987696f 100644 (file)
@@ -2,6 +2,7 @@
 #include <msp/core/raii.h>
 #include <msp/strings/lexicalcast.h>
 #include "compatibility.h"
+#include "glsl_error.h"
 
 using namespace std;
 
@@ -259,8 +260,8 @@ void LegacyConverter::visit(VariableDeclaration &var)
                        }
                        else if(stage->type==Stage::FRAGMENT && var.interface=="out")
                        {
-                               if(location!=0)
-                                       check_extension(&Features::ext_gpu_shader4);
+                               if(location!=0 && !check_extension(&Features::ext_gpu_shader4))
+                                       throw unsupported_shader("EXT_gpu_shader4 is required");
                                stage->locations[var.name] = location;
                                var.layout->qualifiers.erase(i);
                        }