From: Mikko Rasa Date: Sat, 4 May 2024 12:31:30 +0000 (+0300) Subject: Add version checks for a few GLSL functions X-Git-Url: https://git.tdb.fi/?a=commitdiff_plain;h=15488bb5d71b4606af6265b45991c116c7cca520;p=libs%2Fgl.git Add version checks for a few GLSL functions --- diff --git a/source/glsl/finalize.cpp b/source/glsl/finalize.cpp index afe0f7fa..9d309785 100644 --- a/source/glsl/finalize.cpp +++ b/source/glsl/finalize.cpp @@ -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(call.arguments.front()->type); if(arg_image && !supports_unified_sampling_functions())