From d9de5f2306dc6bc64c71e01227cdaa65f47c2e1c Mon Sep 17 00:00:00 2001 From: cutealien Date: Thu, 22 Feb 2024 11:19:58 +0000 Subject: [PATCH] Optimize memory layout for SMaterialLayer SMaterialLayer going down from 40 to 32 bytes on 64-bit systems according to the new VS memory layout tool (nice toy!) git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6596 dfc29bdd-3216-0410-991c-e03cc46cb475 --- include/SMaterialLayer.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/SMaterialLayer.h b/include/SMaterialLayer.h index c8006d01..6bf420e3 100644 --- a/include/SMaterialLayer.h +++ b/include/SMaterialLayer.h @@ -52,7 +52,7 @@ namespace video //! Default constructor SMaterialLayer() : Texture(0), TextureWrapU(ETC_REPEAT), TextureWrapV(ETC_REPEAT), TextureWrapW(ETC_REPEAT), BilinearFilter(true), TrilinearFilter(false), AnisotropicFilter(0), LODBias(0), - TextureMatrix(0), TextureMatrixUsed(false) + TextureMatrixUsed(false), TextureMatrix(0) { } @@ -243,13 +243,15 @@ namespace video private: friend class SMaterial; - irr::core::irrAllocator MatrixAllocator; + + // TextureMatrix memory stays until destructor even when unused to avoid unnecessary allocation/de-allocations + bool TextureMatrixUsed; //! Texture Matrix /** Do not access this element directly as the internal resource management has to cope with Null pointers etc. */ core::matrix4* TextureMatrix; - bool TextureMatrixUsed; // TextureMatrix memory stays until destructor even when unused to avoid unnecessary allocation/de-allocations + irr::core::irrAllocator MatrixAllocator; }; } // end namespace video