Allow buffer to take any size, including 0

Signed-off-by: Yuriy Toporovskyy <toporovskyy.y@gmail.com>
monroegm-disable-blank-issue-2
Yuriy Toporovskyy 4 years ago committed by Tommy Walton
parent dbc1f3bb62
commit bf38f07480

@ -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();

Loading…
Cancel
Save