rhodonite
    Preparing search index...

    Class MemoryManager

    Index
    • 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.

    • Dumps the contents of a buffer to a downloadable file for debugging purposes.

      Parameters

      • bufferUse: EnumIO

        The type of buffer to dump

      Returns void

    • 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

    • Parameters

      Returns Buffer[]

    • 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

    • Reads float values from the concatenated layers of a buffer usage.

      This is intended for debugging tools. The returned array is a copy when the range spans buffer layers, and a view into the layer otherwise.

      Parameters

      • bufferUse: EnumIO

        The buffer usage to read

      • byteOffset: number

        Byte offset from the start of the first layer

      • count: number

        Number of float values to read

      Returns Float32Array<ArrayBufferLike> | null

      The read values, or null when the range is outside the allocated buffers

    • 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