> ## 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.

# MakeResident

> Makes objects resident for the device.

Makes objects resident for the device.

## Syntax

```cpp theme={null}
HRESULT MakeResident(
    UINT NumObjects,
    ID3D12Pageable const  ppObjects
)
```

### Parameters

*NumObjects*<br />Type: UINT

The number of objects  in the <i>ppObjects</i> array to make resident for the device.

*ppObjects \[in]*<br />Type: ID3D12Pageable \*const \*

A pointer to a memory block that contains an array of [ID3D12Pageable](/reference/graphics/d3d12/interfaces/id3d12pageable/id3d12pageable_public) interface pointers for the objects.

Even though most D3D12 objects inherit from [ID3D12Pageable](/reference/graphics/d3d12/interfaces/id3d12pageable/id3d12pageable_public), residency changes are only supported on the following objects: Descriptor Heaps, Heaps, Committed Resources, and Query Heaps

### Return value

Type: HRESULT

This method returns one of the [Direct3D 12 Return Codes](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/d3d12-graphics-reference-returnvalues).

## Remarks

**MakeResident** loads the data associated with a resource from disk, and re-allocates the memory from the resource's appropriate memory pool. This method should be called on the object which owns the physical memory.

Use this method, and [Evict](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_evict_public), to manage GPU video memory, noting that this was done automatically in D3D11, but now has to be done by the app in D3D12.

**MakeResident** and [Evict](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_evict_public) can help applications manage the residency budget on many adapters. **MakeResident** explicitly pages-in data and, then, precludes page-out so the GPU can access the data. **Evict** enables page-out.

Some GPU architectures do not benefit from residency manipulation, due to the lack of sufficient GPU virtual address space. Use [D3D12\_FEATURE\_DATA\_GPU\_VIRTUAL\_ADDRESS\_SUPPORT](/reference/graphics/d3d12/structs/d3d12_feature_data_gpu_virtual_address_support_public) and [IDXGIAdapter3::QueryVideoMemoryInfo](https://learn.microsoft.com/en-us/windows/desktop/api/dxgi1_4/nf-dxgi1_4-idxgiadapter3-queryvideomemoryinfo) to recognize when the maximum GPU VA space per-process is too small or roughly the same size as the residency budget. For such architectures, the residency budget will always be constrained by the amount of GPU virtual address space. [Evict](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_evict_public) will not free-up any residency budget on such systems.

Applications must handle **MakeResident** failures, even if there appears to be enough residency budget available. Physical memory fragmentation and adapter architecture quirks can preclude the utilization of large contiguous ranges. Applications should free up more residency budget before trying again.

**MakeResident** is ref-counted, such that [Evict](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_evict_public) must be called the same amount of times as **MakeResident** before **Evict** takes effect. Objects that support residency are made resident during creation, so a single **Evict** call will actually evict the object.

Applications must use fences to ensure the GPU doesn't use non-resident objects. **MakeResident** must return before the GPU executes a command list that references the object. [Evict](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_evict_public) must be called after the GPU finishes executing a command list that references the object.

Evicted objects still consume the same GPU virtual address and same amount of GPU virtual address space. Therefore, resource descriptors and other GPU virtual address references are not invalidated after [Evict](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_evict_public).

## Requirements

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

## See Also

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


## Related topics

- [EnqueueMakeResident](/reference/graphics/d3d12/interfaces/id3d12device3/methods/id3d12device3_enqueuemakeresident_public.md)
- [ID3D12Pageable](/reference/graphics/d3d12/interfaces/id3d12pageable/id3d12pageable_public.md)
- [Evict](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_evict_public.md)
- [D3D12_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT](/reference/graphics/d3d12/structs/d3d12_feature_data_gpu_virtual_address_support_public.md)
- [D3D12_RESIDENCY_FLAGS](/reference/graphics/d3d12/enums/d3d12_residency_flags_public.md)
