Use the proper register count for structs in HLSL uniforms and varyings.

We must respect HLSL packing rules when uploading structs to D3D.

TRAC #23748

Signed-off-by: Geoff Lang
Signed-off-by: Nicolas Capens

diff --git a/src/compiler/BlockLayoutEncoder.h b/src/compiler/BlockLayoutEncoder.h
index b16b61a..b6fb7bf 100644
--- a/src/compiler/BlockLayoutEncoder.h
+++ b/src/compiler/BlockLayoutEncoder.h
@@ -27,7 +27,7 @@
     void encodeInterfaceBlockFields(const std::vector<InterfaceBlockField> &fields);
     void encodeInterfaceBlockField(const InterfaceBlockField &field);
     void encodeType(GLenum type, unsigned int arraySize, bool isRowMajorMatrix);
-    size_t getBlockSize() { return mCurrentOffset * BytesPerComponent; }
+    size_t getBlockSize() const { return mCurrentOffset * BytesPerComponent; }
 
     static const size_t BytesPerComponent = 4u;
     static const unsigned int ComponentsPerRegister = 4u;