Tracking resource usage
Learn how to query internal resource usage in the Runtime SDK.
Read time 1 minuteLast updated 2 hours ago
The SpeedTree Runtime SDK provides a straightforward mechanism for querying the space used by several internal resources.
Using the system
The Runtime SDK function can be called at any time. It will populate and return the following structure:
CCore::GetSdkResourceUsage()SResourceSummarystruct SResourceSummary{ SResourceStats m_sHeap; SResourceStats m_asGfxResources[GFX_RESOURCE_COUNT]; // indexed with EGfxResourceType};
Where is defined as:
SResourceStatsstruct SResourceStats{ size_t m_siCurrentUsage; // bytes size_t m_siPeakUsage; // bytes size_t m_siCurrentQuantity; size_t m_siPeakQuantity;};
SResourceSummary::m_asGfxResourcesEGfxResourceTypeCore.henum EGfxResourceType{ GFX_RESOURCE_VERTEX_BUFFER, GFX_RESOURCE_INDEX_BUFFER, GFX_RESOURCE_VERTEX_SHADER, GFX_RESOURCE_PIXEL_SHADER, GFX_RESOURCE_TEXTURE, GFX_RESOURCE_OTHER, GFX_RESOURCE_COUNT};