SpeedTree
    Show / Hide Table of Contents

    Tracking resource usage

    The SpeedTree Runtime SDK provides a straightforward mechanism for querying the space used by several internal resources.

    Using the system

    The Runtime SDK function CCore::GetSdkResourceUsage() can be called at any time. It will populate and return the following SResourceSummary structure:

    struct SResourceSummary
    {
        SResourceStats  m_sHeap; 
        SResourceStats  m_asGfxResources[GFX_RESOURCE_COUNT]; // indexed with EGfxResourceType
    };
    

    Where SResourceStats is defined as:

    struct SResourceStats
    {
        size_t  m_siCurrentUsage;    // bytes
        size_t  m_siPeakUsage;       // bytes
        size_t  m_siCurrentQuantity;
        size_t  m_siPeakQuantity;
    };
    

    SResourceSummary::m_asGfxResources is indexed with the enumeration EGfxResourceType, also defined in Core.h:

    enum 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
    };
    
    Copyright © 2023 Unity Technologies
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX.