]> git.tdb.fi Git - libs/gl.git/commitdiff
Add version checks for a few GLSL functions
authorMikko Rasa <tdb@tdb.fi>
Sat, 4 May 2024 12:31:30 +0000 (15:31 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 4 May 2024 16:31:55 +0000 (19:31 +0300)
source/glsl/finalize.cpp

index afe0f7fa8b41227117cb6c73884d8330f5663d45..9d309785f52774bddd6415a4c6a064df2fa15401 100644 (file)
@@ -599,7 +599,15 @@ void StructuralFeatureConverter::visit(FunctionCall &call)
 {
        if(call.declaration && call.declaration->source==BUILTIN_SOURCE)
        {
-               if(!call.name.compare(0, 7, "texture") && call.arguments.size()>=1)
+               if(call.name=="textureSize")
+                       check_version(Version(1, 30));
+               if(call.name=="textureQueryLevels")
+                       check_version(Version(4, 30));
+               else if(call.name=="textureQueryLod")
+                       check_version(Version(4, 0));
+               else if(!call.name.compare(0, 8, "bitfield"))
+                       check_version(Version(4, 0));
+               else if(!call.name.compare(0, 7, "texture") && call.arguments.size()>=1)
                {
                        const ImageTypeDeclaration *arg_image = dynamic_cast<const ImageTypeDeclaration *>(call.arguments.front()->type);
                        if(arg_image && !supports_unified_sampling_functions())