Consolidate the register counting functions to a single location in the HLSL layout encoder source.

This new method explicitly depends on HLSL packing rules, instead of a GL idiom.

TRAC #23748

Signed-off-by: Geoff Lang
Signed-off-by: Nicolas Capens
diff --git a/src/libGLESv2/ProgramBinary.cpp b/src/libGLESv2/ProgramBinary.cpp
index c670fec..78db619 100644
--- a/src/libGLESv2/ProgramBinary.cpp
+++ b/src/libGLESv2/ProgramBinary.cpp
@@ -24,6 +24,8 @@
 #include "libGLESv2/Context.h"
 #include "libGLESv2/Buffer.h"
 
+#include "compiler/HLSLLayoutEncoder.h"
+
 #undef near
 #undef far
 
@@ -2375,7 +2377,7 @@
                 {
                     return false;
                 }
-                fieldRegisterIndex += totalRegisterCount(field);
+                fieldRegisterIndex += sh::HLSLVariableRegisterCount(field);
             }
         }