From 15488bb5d71b4606af6265b45991c116c7cca520 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 4 May 2024 15:31:30 +0300 Subject: [PATCH] Add version checks for a few GLSL functions --- source/glsl/finalize.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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()) -- 2.45.2