Expose the packing function so we can check varyings packing per program

ANGLEBUG=471
R=kbr@chromium.org

Review URL: https://codereview.appspot.com/13322043
diff --git a/src/compiler/ShaderLang.cpp b/src/compiler/ShaderLang.cpp
index 6d954ca..acd5b72 100644
--- a/src/compiler/ShaderLang.cpp
+++ b/src/compiler/ShaderLang.cpp
@@ -15,6 +15,7 @@
 #include "compiler/preprocessor/length_limits.h"
 #include "compiler/ShHandle.h"
 #include "compiler/TranslatorHLSL.h"
+#include "compiler/VariablePacker.h"
 
 //
 // This is the platform independent interface between an OGL driver
@@ -389,3 +390,19 @@
     default: UNREACHABLE();
     }
 }
+
+int ShCheckVariablesWithinPackingLimits(
+    int maxVectors, ShVariableInfo* varInfoArray, size_t varInfoArraySize)
+{
+    if (varInfoArraySize == 0)
+        return 1;
+    ASSERT(varInfoArray);
+    TVariableInfoList variables;
+    for (size_t ii = 0; ii < varInfoArraySize; ++ii)
+    {
+        TVariableInfo var(varInfoArray[ii].type, varInfoArray[ii].size);
+        variables.push_back(var);
+    }
+    VariablePacker packer;
+    return packer.CheckVariablesWithinPackingLimits(maxVectors, variables) ? 1 : 0;
+}