diff --git a/source/renderer/PatchRData.h b/source/renderer/PatchRData.h index 88075f23de..4908782483 100644 --- a/source/renderer/PatchRData.h +++ b/source/renderer/PatchRData.h @@ -80,14 +80,16 @@ private: // diffuse color from sunlight SColor4ub m_DiffuseColor; CVector3D m_Normal; + // pad to a power of two + u8 m_Padding[4]; }; - cassert(sizeof(SBaseVertex) == 28); + cassert(sizeof(SBaseVertex) == 32); struct SSideVertex { // vertex position CVector3D m_Position; - // add some padding - u32 m_Padding[1]; + // pad to a power of two + u8 m_Padding[4]; }; cassert(sizeof(SSideVertex) == 16); @@ -99,16 +101,20 @@ private: // vertex uvs for alpha texture float m_AlphaUVs[2]; CVector3D m_Normal; + // pad to a power of two + u8 m_Padding[28]; }; - cassert(sizeof(SBlendVertex) == 36); + cassert(sizeof(SBlendVertex) == 64); // Mixed Fancy/Simple water vertex description data structure struct SWaterVertex { // vertex position CVector3D m_Position; CVector2D m_WaterData; + // pad to a power of two + u8 m_Padding[12]; }; - cassert(sizeof(SWaterVertex) == 20); + cassert(sizeof(SWaterVertex) == 32); // build this renderdata object void Build(); diff --git a/source/renderer/WaterManager.cpp b/source/renderer/WaterManager.cpp index 2e48d34cd7..c0a472087e 100644 --- a/source/renderer/WaterManager.cpp +++ b/source/renderer/WaterManager.cpp @@ -65,8 +65,11 @@ struct SWavesVertex { CVector2D m_PerpVect; u8 m_UV[3]; + + // pad to a power of two + u8 m_Padding[5]; }; -cassert(sizeof(SWavesVertex) == 60); +cassert(sizeof(SWavesVertex) == 64); struct WaveObject {