Index: /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
===================================================================
--- /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp	(revision 76265)
+++ /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp	(revision 76266)
@@ -941,16 +941,4 @@
 #endif
     float v = pszShadingLanguageVersion ? atof(pszShadingLanguageVersion) : 0.0f;
-    if (v >= 3.30f)
-    {
-        pState->caps.vertexShaderVersion   = SVGA3DVSVERSION_40;
-        pState->caps.fragmentShaderVersion = SVGA3DPSVERSION_40;
-    }
-    else
-    if (v >= 1.20f)
-    {
-        pState->caps.vertexShaderVersion   = SVGA3DVSVERSION_20;
-        pState->caps.fragmentShaderVersion = SVGA3DPSVERSION_20;
-    }
-    else
     if (   vmsvga3dCheckGLExtension(pState, 0.0f, " GL_NV_gpu_program4 ")
         || strstr(pState->pszOtherExtensions, " GL_NV_gpu_program4 "))
@@ -981,4 +969,17 @@
         pState->caps.vertexShaderVersion   = SVGA3DVSVERSION_11;
         pState->caps.fragmentShaderVersion = SVGA3DPSVERSION_11;
+    }
+
+    /* Now check the shading language version, in case it indicates a higher supported version. */
+    if (v >= 3.30f)
+    {
+        pState->caps.vertexShaderVersion   = RT_MAX(pState->caps.vertexShaderVersion,   SVGA3DVSVERSION_40);
+        pState->caps.fragmentShaderVersion = RT_MAX(pState->caps.fragmentShaderVersion, SVGA3DPSVERSION_40);
+    }
+    else
+    if (v >= 1.20f)
+    {
+        pState->caps.vertexShaderVersion   = RT_MAX(pState->caps.vertexShaderVersion,   SVGA3DVSVERSION_20);
+        pState->caps.fragmentShaderVersion = RT_MAX(pState->caps.fragmentShaderVersion, SVGA3DPSVERSION_20);
     }
 
