From bf38f0748097b981a8fa06aa3785c88fac9eeacb Mon Sep 17 00:00:00 2001 From: Yuriy Toporovskyy Date: Mon, 13 Sep 2021 11:59:08 -0400 Subject: [PATCH] Allow buffer to take any size, including 0 Signed-off-by: Yuriy Toporovskyy --- .../Source/SkinnedMesh/SkinnedMeshOutputStreamManager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshOutputStreamManager.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshOutputStreamManager.cpp index f3744fe119..8bf518e277 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshOutputStreamManager.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshOutputStreamManager.cpp @@ -74,6 +74,9 @@ namespace AZ creator.End(m_bufferAsset); } + + // default value of 256mb supports roughly 42 character instances at 100,000 vertices per character x 64 bytes per vertex (12 byte position + 12 byte previous frame position + 12 byte normal + 16 byte tangent + 12 byte bitangent) + // This includes only the output of the skinning compute shader, not the input buffers or bone transforms AZ_CVAR( int, r_skinnedMeshInstanceMemoryPoolSize, @@ -95,10 +98,8 @@ namespace AZ } m_needsInit = false; - // 256mb supports roughly 42 character instances at 100,000 vertices per character x 64 bytes per vertex (12 byte position + 12 byte previous frame position + 12 byte normal + 16 byte tangent + 12 byte bitangent) - // This includes only the output of the skinning compute shader, not the input buffers or bone transforms const AZ::u64 sizeInMb = r_skinnedMeshInstanceMemoryPoolSize; - m_sizeInBytes = AZ::GetMax(sizeInMb, 256ull) * (1024u * 1024u); + m_sizeInBytes = sizeInMb * (1024u * 1024u); CalculateAlignment();