# NNS_GfdInitLnkTexVramManager

## Syntax

      #include <nnsys/gfd.h>

      void NNS_GfdInitLnkTexVramManager(
          u32     szByte,
          u32     szByteFor4x4,
          void*   pManagementWork,
          u32     szByteManagementWork,
          BOOL    useAsDefault );

## Arguments

`szByte` | Size of the VRAM region to manage (in bytes). (Calculate as 1 Slot = `0x20000`, with a maximum of 4 slots.)
`szByteFor4x4` | Size of the region (in bytes) used for the 4x4 compressed texture in the management region. (Calculate as 1 Slot = `0x20000`, with a maximum of 2 slots.)
`pManagementWork` | Pointer to the memory region used for management information.
`szByteManagementWork` | Size of the management information region (in bytes).
`useAsDefault` | Whether to use the linked list texture VRAM manager as the current VRAM manager.

## Return Values

None.

## Description

Initializes the VRAM manager to manage the region that begins with the texture RAM and is the size specified by `szByte`. For the initialization parameters, you must specify the size of the VRAM region (in bytes) managed by the manager and the size of the region used for the 4x4 compressed texture that is in the managed region. If `szByteFor4x4` is not zero, the following conditions must be met.
szByteFor4x4 <= 0x20000, szByte >= 0x20000 + szByteFor4x4 / 2
szByteFor4x4 > 0x20000, szByte >= 0x20000 + szByteFor4x4
The linked list VRAM manager requires the management information of the empty region. Therefore, you must pass the memory region for management information when initializing. Use the `NNS_GfdGetLnkTexVramManagerWorkSize` function to get the size of the required management information memory.
If `useAsDefault` is `TRUE`, the linked list texture VRAM manager is set as the current VRAM manager of TWL-System.

### Note About Allocation of Large Regions

When 4x4 compressed textures are used, a 4x4 compressed texture region is allocated inside the manager by, essentially, dividing a part of the region for normal textures. Because of this, continuous blocks inside the manager cannot be fully defragmented, and allocating a large region of memory may fail even though there is sufficient remaining VRAM.

## See Also

`NNS_GfdGetLnkTexVramManagerWorkSize`

## Revision History

2008/06/20 Changed NITRO-System to TWL-System.
2004/10/12 Initial version.

CONFIDENTIAL