0030963: Visualization, TKOpenGl - texture unit error during FFP global texture's...
[occt.git] / src / OpenGl / OpenGl_Sampler.cxx
index 4ee9e5b..24b69b6 100644 (file)
@@ -276,7 +276,8 @@ void OpenGl_Sampler::applyGlobalTextureParams (const Handle(OpenGl_Context)& the
   (void )theTexture;
   (void )theParams;
 #else
-  if (theCtx->core11 == NULL)
+  if (theCtx->core11 == NULL
+   || theParams->TextureUnit() >= theCtx->MaxTextureUnitsFFP())
   {
     return;
   }