Initialize vertex attribute and 2d texture caches 47/52847/3
authorFerran Sole <ferran.sole@samsung.com>
Thu, 26 Nov 2015 14:20:26 +0000 (14:20 +0000)
committerFerran Sole <ferran.sole@samsung.com>
Fri, 27 Nov 2015 08:55:30 +0000 (08:55 +0000)
Vertex attribute cache and bounded 2d texture caches were not being properly initialized

Change-Id: I45aa9c005d950c6acbcc355945d03175c24e6656

dali/internal/render/gl-resources/context.cpp

index 2112488..c6ad6da 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <algorithm>
+#include <cstring>
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/constants.h>
@@ -237,6 +238,13 @@ void Context::InitializeGlState()
   // reset viewport, this will be set to something useful when rendering
   mViewPort.x = mViewPort.y = mViewPort.width = mViewPort.height = 0;
 
+  //Initialze vertex attribute cache
+  memset( &mVertexAttributeCachedState, 0, sizeof(mVertexAttributeCachedState) );
+  memset( &mVertexAttributeCurrentState, 0, sizeof(mVertexAttributeCurrentState) );
+
+  //Initialize bound 2d texture cache
+  memset( &mBound2dTextureId, 0, sizeof(mBound2dTextureId) );
+
   mFrameBufferStateCache.Reset();
 }