> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GetResourceAllocationInfo

> GetResourceAllocationInfo (Direct3D 12 on XBOX) — Gets the size and alignment of memory required for a collection of resources on this adapter.

Gets the size and alignment of memory required for a collection of resources on this adapter.

## Syntax

```cpp theme={null}
D3D12_RESOURCE_ALLOCATION_INFO GetResourceAllocationInfo(
    UINT visibleMask,
    UINT numResourceDescs,
    const D3D12_RESOURCE_DESC* pResourceDescs
)
```

### Parameters

*visibleMask \[in]*\
Type: UINT

For single-GPU operation, set this to zero. If there are multiple GPU nodes, then set bits to identify the nodes (the device's physical adapters). Each bit in the mask corresponds to a single node. Also see [Multi-adapter systems](https://learn.microsoft.com/en-us/windows/win32/direct3d12/multi-engine).

*numResourceDescs \[in]*\
Type: **[UINT](https://learn.microsoft.com/en-us/windows/win32/WinProg/windows-data-types)**

The number of resource descriptors in the *pResourceDescs* array.

*pResourceDescs \[in]*\
Type: **const [D3D12\_RESOURCE\_DESC](/reference/graphics/d3d12/structs/d3d12_resource_desc_public)\***

An array of **D3D12\_RESOURCE\_DESC** structures that described the resources to get info about.

### Return value

Type: D3D12\_RESOURCE\_ALLOCATION\_INFO

A [D3D12\_RESOURCE\_ALLOCATION\_INFO](/reference/graphics/d3d12/structs/d3d12_resource_allocation_info_public) structure that provides info about video memory allocated for the specified array of resources.

If an error occurs, then **D3D12\_RESOURCE\_ALLOCATION\_INFO::SizeInBytes** equals **UINT64\_MAX**.

## Remarks

When you're using [CreatePlacedResource](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createplacedresource_public), your application must use **GetResourceAllocationInfo** in order to understand the size and alignment characteristics of texture resources. The results of this method vary depending on the particular adapter, and must be treated as unique to this adapter and driver version.

Your application can't use the output of **GetResourceAllocationInfo** to understand packed mip properties of textures. To understand packed mip properties of textures, your application must use [GetResourceTiling](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_getresourcetiling_public).

Texture resource sizes significantly differ from the information returned by **GetResourceTiling**, because some adapter architectures allocate extra memory for textures to reduce the effective bandwidth during common rendering scenarios. This even includes textures that have constraints on their texture layouts, or have standardized texture layouts. That extra memory can't be sparsely mapped nor remapped by an application using [CreateReservedResource](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createreservedresource_public) and [UpdateTileMappings](/reference/graphics/d3d12/interfaces/id3d12commandqueue/methods/id3d12commandqueue_updatetilemappings_public), so it isn't reported by **GetResourceTiling**.

Your application can forgo using **GetResourceAllocationInfo** for buffer resources ([D3D12\_RESOURCE\_DIMENSION\_BUFFER](/reference/graphics/d3d12_x/enums/d3d12_resource_dimension)). Buffers have the same size on all adapters, which is merely the smallest multiple of 64KB that's greater or equal to [D3D12\_RESOURCE\_DESC::Width](/reference/graphics/d3d12/structs/d3d12_resource_desc_public).

When multiple resource descriptions are passed in, the C++ algorithm for calculating a structure size and alignment are used. For example, a three-element array with two tiny 64KB-aligned resources and a tiny 4MB-aligned resource, reports differing sizes based on the order of the array. If the 4MB aligned resource is in the middle, then the resulting **Size** is 12MB. Otherwise, the resulting **Size** is 8MB. The **Alignment** returned would always be 4MB, because it's the superset of all alignments in the resource array.

## Requirements

**Header:** d3d12\_xs.h or d3d12\_x.h\
**Library:** d3d12\_xs.lib or d3d12\_x.lib\
**Supported Platforms**: XBOX Series consoles and XBOX One family

## See Also

[ID3D12Device](/reference/graphics/d3d12_x/interfaces/id3d12device/id3d12device)


## Related topics

- [GetResourceAllocationInfo1 (XBOX Series consoles)](/reference/graphics/d3d12/interfaces/id3d12device4/methods/id3d12device4_getresourceallocationinfo1_public.md)
- [D3D12_RESOURCE_ALLOCATION_INFO](/reference/graphics/d3d12/structs/d3d12_resource_allocation_info_public.md)
- [GetResourceTiling](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_getresourcetiling_public.md)
- [CreatePlacedResource](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createplacedresource_public.md)
- [CreatePlacedResource2 (XBOX Series consoles)](/reference/graphics/d3d12/interfaces/id3d12device10/methods/id3d12device10_createplacedresource2_public.md)
