Fix to do not try to bind texture when there is no active texture in shader code 58/294358/1
authorseungho baek <sbsh.baek@samsung.com>
Fri, 16 Jun 2023 08:40:18 +0000 (17:40 +0900)
committerseungho baek <sbsh.baek@samsung.com>
Fri, 16 Jun 2023 08:40:18 +0000 (17:40 +0900)
Change-Id: Ibd690b68015869f485b3458dc80b81486d3eca8e
Signed-off-by: seungho baek <sbsh.baek@samsung.com>
dali/internal/graphics/gles-impl/gles-context.cpp

index a073193..369af21 100644 (file)
@@ -323,6 +323,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?)
@@ -349,11 +355,6 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES::
         currentElement = 0;
       }
     }
-    if(currentSampler >= samplers.size())
-    {
-      // Don't bind more textures than there are active samplers.
-      break;
-    }
   }
 
   const auto& pipelineState    = mImpl->mNewPipeline ? mImpl->mNewPipeline->GetCreateInfo() : mImpl->mCurrentPipeline->GetCreateInfo();