[Tizen] Fix to do not try to bind texture when there is no active texture in shader... 26/296826/2
authorseungho baek <sbsh.baek@samsung.com>
Fri, 16 Jun 2023 08:40:18 +0000 (17:40 +0900)
committerseungho baek <sbsh.baek@samsung.com>
Wed, 23 Aug 2023 04:49:54 +0000 (13:49 +0900)
Change-Id: Ibd690b68015869f485b3458dc80b81486d3eca8e
Signed-off-by: seungho baek <sbsh.baek@samsung.com>
dali/internal/graphics/gles-impl/gles-context.cpp

index 56625a0..2b56974 100644 (file)
@@ -313,6 +313,12 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES::
   // elements. This avoids having to sort the bindings.
   for(const auto& binding : mImpl->mCurrentTextureBindings)
   {
+    if(currentSampler >= samplers.size())
+    {
+      // Don't bind more textures than there are active samplers.
+      break;
+    }
+
     auto texture = const_cast<GLES::Texture*>(static_cast<const GLES::Texture*>(binding.texture));
 
     // Texture may not have been initialized yet...(tbm_surface timing issue?)
@@ -336,11 +342,6 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES::
       ++currentSampler;
       currentElement = 0;
     }
-    if(currentSampler >= samplers.size())
-    {
-      // Don't bind more textures than there are active samplers.
-      break;
-    }
   }
 
   // for each attribute bind vertices