Fixing vector element alignment issues.

Change-Id: Ie5555b9f5bbbc75e1dfd26d3ccbee84b8f71e018
diff --git a/tools/a3dconvert/SimpleMesh.h b/tools/a3dconvert/SimpleMesh.h
index c87bb7d..91b4823 100644
--- a/tools/a3dconvert/SimpleMesh.h
+++ b/tools/a3dconvert/SimpleMesh.h
@@ -106,13 +106,18 @@
             uint32_t vertexPos = i*vertexSize;
             float *vertexPtr = dataPtr + vertexPos;
 
+            uint32_t elemIndex = 0;
             for (uint32_t c = 0; c < mChannels.size(); c ++) {
                 // Skip empty channels
                 if (mChannels[c].mData.size() == 0) {
                     continue;
                 }
+                // This will address vector element alignment issues
+                uint32_t elemlOffset = vertexDataElem->getFieldOffsetBytes(elemIndex)/sizeof(float);
+                elemIndex ++;
+                float *channelPtr = vertexPtr + elemlOffset;
                 for (uint32_t cStride = 0; cStride < mChannels[c].mStride; cStride ++) {
-                    *(vertexPtr++) = mChannels[c].mData[i * mChannels[c].mStride + cStride];
+                    *(channelPtr++) = mChannels[c].mData[i * mChannels[c].mStride + cStride];
                 }
             }
         }
diff --git a/tools/a3dconvert/a3dconvert.cpp b/tools/a3dconvert/a3dconvert.cpp
index 3535b17..4e48642 100644
--- a/tools/a3dconvert/a3dconvert.cpp
+++ b/tools/a3dconvert/a3dconvert.cpp
@@ -44,21 +44,11 @@
 
 // We only care to implement allocation memory initialization and destruction
 // because we need no other renderscript hal features for serialization
-static RsdHalFunctions FunctionTable = {
-    NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-    { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL },
-    {
-        rsdAllocationInit,
-        rsdAllocationDestroy,
-        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
-    },
-    { NULL, NULL, NULL }, { NULL, NULL, NULL }, { NULL, NULL, NULL },
-    { NULL, NULL, NULL }, { NULL, NULL, NULL }, { NULL, NULL },
-    { NULL, NULL, NULL},
-};
-
-// No-op initizlizer for rs context hal since we only
+static RsdHalFunctions FunctionTable;
 bool rsdHalInit(Context *rsc, uint32_t version_major, uint32_t version_minor) {
+    memset(&FunctionTable, 0, sizeof(FunctionTable));
+    FunctionTable.allocation.init = rsdAllocationInit;
+    FunctionTable.allocation.destroy = rsdAllocationDestroy;
     rsc->mHal.funcs = FunctionTable;
     return true;
 }