diff --git a/src/libGLESv2/ProgramBinary.cpp b/src/libGLESv2/ProgramBinary.cpp
index 8e3c376..48b83f4 100644
--- a/src/libGLESv2/ProgramBinary.cpp
+++ b/src/libGLESv2/ProgramBinary.cpp
@@ -1010,6 +1010,8 @@
 {
     const int maxVaryingVectors = mRenderer->getMaxVaryingVectors();
 
+    fragmentShader->resetVaryingsRegisterAssignment();
+
     for (VaryingList::iterator varying = fragmentShader->mVaryings.begin(); varying != fragmentShader->mVaryings.end(); varying++)
     {
         int n = VariableRowCount(varying->type) * varying->size;
@@ -1153,35 +1155,15 @@
     return registers;
 }
 
-bool ProgramBinary::linkVaryings(InfoLog &infoLog, std::string& pixelHLSL, std::string& vertexHLSL, FragmentShader *fragmentShader, VertexShader *vertexShader)
+bool ProgramBinary::linkVaryings(InfoLog &infoLog, int registers, const Varying *packing[][4],
+                                 std::string& pixelHLSL, std::string& vertexHLSL,
+                                 FragmentShader *fragmentShader, VertexShader *vertexShader)
 {
     if (pixelHLSL.empty() || vertexHLSL.empty())
     {
         return false;
     }
 
-    // Reset the varying register assignments
-    for (VaryingList::iterator fragVar = fragmentShader->mVaryings.begin(); fragVar != fragmentShader->mVaryings.end(); fragVar++)
-    {
-        fragVar->reg = -1;
-        fragVar->col = -1;
-    }
-
-    for (VaryingList::iterator vtxVar = vertexShader->mVaryings.begin(); vtxVar != vertexShader->mVaryings.end(); vtxVar++)
-    {
-        vtxVar->reg = -1;
-        vtxVar->col = -1;
-    }
-
-    // Map the varyings to the register file
-    const Varying *packing[IMPLEMENTATION_MAX_VARYING_VECTORS][4] = {NULL};
-    int registers = packVaryings(infoLog, packing, fragmentShader);
-
-    if (registers < 0)
-    {
-        return false;
-    }
-
     // Write the HLSL input/output declarations
     const int shaderModel = mRenderer->getMajorShaderModel();
     const int maxVaryingVectors = mRenderer->getMaxVaryingVectors();
@@ -1193,6 +1175,8 @@
         return false;
     }
 
+    vertexShader->resetVaryingsRegisterAssignment();
+
     for (VaryingList::iterator input = fragmentShader->mVaryings.begin(); input != fragmentShader->mVaryings.end(); input++)
     {
         bool matched = false;
@@ -1801,7 +1785,16 @@
     std::string pixelHLSL = fragmentShader->getHLSL();
     std::string vertexHLSL = vertexShader->getHLSL();
 
-    if (!linkVaryings(infoLog, pixelHLSL, vertexHLSL, fragmentShader, vertexShader))
+    // Map the varyings to the register file
+    const Varying *packing[IMPLEMENTATION_MAX_VARYING_VECTORS][4] = {NULL};
+    int registers = packVaryings(infoLog, packing, fragmentShader);
+
+    if (registers < 0)
+    {
+        return false;
+    }
+
+    if (!linkVaryings(infoLog, registers, packing, pixelHLSL, vertexHLSL, fragmentShader, vertexShader))
     {
         return false;
     }
