Add feature check for array texture samplers
authorMikko Rasa <tdb@tdb.fi>
Thu, 11 Jul 2019 22:22:02 +0000 (01:22 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 11 Jul 2019 22:22:02 +0000 (01:22 +0300)
source/programcompiler.cpp

index 00d217a06aebb4dcb83b731427e466a584fffe6b..989098d7d0cf6410b4d26faed46f9c400bc06a3c 100644 (file)
@@ -4,6 +4,7 @@
 #include <msp/gl/extensions/arb_gpu_shader5.h>
 #include <msp/gl/extensions/arb_uniform_buffer_object.h>
 #include <msp/gl/extensions/ext_gpu_shader4.h>
+#include <msp/gl/extensions/ext_texture_array.h>
 #include <msp/strings/format.h>
 #include <msp/strings/regex.h>
 #include <msp/strings/utils.h>
@@ -1954,6 +1955,26 @@ void ProgramCompiler::LegacyConverter::visit(FunctionCall &call)
                                call.name = "shadow1D";
                        else if(type=="sampler2DShadow")
                                call.name = "shadow2D";
+                       else if(type=="sampler1DArray")
+                       {
+                               check_extension(EXT_texture_array);
+                               call.name = "texture1DArray";
+                       }
+                       else if(type=="sampler2DArray")
+                       {
+                               check_extension(EXT_texture_array);
+                               call.name = "texture2DArray";
+                       }
+                       else if(type=="sampler1DArrayShadow")
+                       {
+                               check_extension(EXT_texture_array);
+                               call.name = "shadow1DArray";
+                       }
+                       else if(type=="sampler2DArrayShadow")
+                       {
+                               check_extension(EXT_texture_array);
+                               call.name = "shadow2DArray";
+                       }
 
                        for(; i!=call.arguments.end(); ++i)
                                (*i)->visit(*this);