Reset vertex buffer changed flag after bind buffer finished 90/316690/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Tue, 27 Aug 2024 04:00:46 +0000 (13:00 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Tue, 27 Aug 2024 04:01:36 +0000 (13:01 +0900)
We don't need to bind vertex buffer multiple times per each draw call.

Change-Id: I1e2bc251c204e1f1739d70d89ebc71316d8abe60
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali/internal/graphics/gles-impl/gles-context.cpp

index 382c78f..2d02dcb 100644 (file)
@@ -463,6 +463,9 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES::
         }
       }
     }
+
+    // Reset vertex buffer changed flag now.
+    mImpl->mVertexBuffersChanged = false;
   }
 
   // Resolve topology
@@ -570,8 +573,7 @@ void Context::BindVertexBuffers(const GLES::VertexBufferBindingDescriptor* bindi
     mImpl->mCurrentVertexBufferBindings.resize(count);
   }
   // Copy only set slots
-  mImpl->mVertexBuffersChanged = false;
-  auto toIter                  = mImpl->mCurrentVertexBufferBindings.begin();
+  auto toIter = mImpl->mCurrentVertexBufferBindings.begin();
   for(auto fromIter = bindings, end = bindings + count; fromIter != end; ++fromIter)
   {
     if(fromIter->buffer != nullptr)