rhodonite
    Preparing search index...

    Class MemoryManager

    Index

    Methods

    • Creates a buffer on-demand with custom size and alignment for a specific object.

      Parameters

      • bufferUse: EnumIO

        The type of buffer to create

      • size: number

        The size of the buffer in bytes

      • byteAlign: number

        The byte alignment requirement for the buffer

      Returns Buffer

      The newly created Buffer instance

    • Gets an existing buffer or creates a new one if it doesn't exist.

      Parameters

      • bufferUse: EnumIO

        The type of buffer to retrieve or create

      • requireIndexOfTheBufferLayer: number = 0

        The index of the buffer layer to retrieve or create

      Returns Buffer

      The Buffer instance (existing or newly created)

    • Destroys all allocated buffers and clears internal state.

      Returns void

      This method clears all buffer maps and resets the buffer usage counters. After calling this method, the MemoryManager should not be used.

    • Gets the index of the active buffer layer for the specified buffer use type.

      Parameters

      • bufferUse: EnumIO

        The type of buffer to get the active layer index of

      Returns number

      The index of the active buffer layer

    • Retrieves an existing buffer for the specified buffer use type.

      Parameters

      • bufferUse: EnumIO

        The type of buffer to retrieve

      • OptionalindexOfTheBufferLayer: number

      Returns Buffer | undefined

      The Buffer instance if it exists, undefined otherwise

    • Gets the byte offset of the existing buffers for the specified buffer use type and index of the buffer layer.

      Parameters

      • bufferUse: EnumIO

        The type of buffer to get the byte offset of

      • indexOfTheBufferLayer: number

        The index of the buffer layer to get the byte offset of

      Returns number

      The byte offset of the existing buffers in bytes

    • Gets the count of the buffer layers for the specified buffer use type.

      Parameters

      • bufferUse: EnumIO

        The type of buffer to get the count of layers of

      Returns number

      The count of the buffer layers

    • Gets the sizes of the buffers for the specified buffer use type.

      Parameters

      • bufferUse: EnumIO

        The type of buffer to get the sizes of

      Returns number[]

      The sizes of the buffers in bytes

    • Increments the count of the buffer layers for the specified buffer use type.

      Parameters

      • bufferUse: EnumIO

        The type of buffer to increment the count of layers of

      Returns void

    • Prints memory usage statistics for all managed buffers to the console. Shows used bytes, total bytes, and usage percentage for each buffer type.

      Returns void

    • Creates a MemoryManager instance if it doesn't exist, or returns the existing instance. This method enforces the singleton pattern.

      Parameters

      • engine: Engine
      • maxGPUDataStorageSize: number

        The maximum GPU data storage size in bytes

      Returns MemoryManager

      The MemoryManager singleton instance