if(count > mImpl->mCurrentVertexBufferBindings.size())
{
mImpl->mCurrentVertexBufferBindings.resize(count);
+ mImpl->mVertexBuffersChanged = true;
}
// Copy only set slots
auto toIter = mImpl->mCurrentVertexBufferBindings.begin();
mImpl->mCurrentUBOBindings.clear();
}
+void Context::ClearVertexBufferCache()
+{
+ mImpl->mCurrentVertexBufferBindings.clear();
+ mImpl->mVertexBuffersChanged = true;
+ mImpl->mProgramVAOCurrentState = 0;
+ if(DALI_LIKELY(!EglGraphicsController::IsShuttingDown()))
+ {
+ if(!(mImpl->mController.GetGLESVersion() >= GLESVersion::GLES_30))
+ {
+ memset(&mImpl->mGlStateCache.mVertexAttributeCachedState, 0, sizeof(mImpl->mGlStateCache.mVertexAttributeCachedState));
+ memset(&mImpl->mGlStateCache.mVertexAttributeCurrentState, 0, sizeof(mImpl->mGlStateCache.mVertexAttributeCurrentState));
+ }
+ }
+}
+
void Context::ColorMask(bool enabled)
{
auto* gl = mImpl->GetGL();
// Do not delete vao now. (Since Context might not be current.)
mImpl->mDiscardedVAOList.emplace_back(vao);
- if(mImpl->mProgramVAOCurrentState == vao)
- {
- mImpl->mProgramVAOCurrentState = 0u;
- }
}
// Clear cached Vertex buffer.
- mImpl->mCurrentVertexBufferBindings.clear();
+ ClearVertexBufferCache();
+
+ mImpl->mGlStateCache.ResetBufferCache();
mImpl->mProgramVAOMap.erase(iter);
}
mImpl->mCurrentPipeline = nullptr;
mImpl->mCurrentUBOBindings.clear();
mImpl->mCurrentTextureBindings.clear();
- mImpl->mCurrentVertexBufferBindings.clear();
mImpl->mCurrentRenderTarget = nullptr;
mImpl->mCurrentRenderPass = nullptr;
- mImpl->mVertexBuffersChanged = true;
mImpl->mCurrentIndexBufferBinding = {};
mImpl->mCurrentSamplerBindings = {};
- mImpl->mProgramVAOCurrentState = 0;
ClearState();
+ ClearVertexBufferCache();
mImpl->InitializeGlState();
}