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

# CreateReservedResource1 (XBOX Series consoles)

> Creates a resource (optionally for a protected session) that is reserved, and not yet mapped to any pages in a heap.

Creates a resource (optionally for a protected session) that is reserved, and not yet mapped to any pages in a heap. Also see [ID3D12Device::CreateReservedResource](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createreservedresource_public).

<Note>
  Only tiles from heaps created with the same protected resource session can be mapped into a protected reserved resource.
</Note>

## Syntax

```cpp theme={null}
HRESULT CreateReservedResource1(
    const D3D12_RESOURCE_DESC  pDesc,
    D3D12_RESOURCE_STATES InitialState,
    const D3D12_CLEAR_VALUE  pOptimizedClearValue,
    ID3D12ProtectedResourceSession  pProtectedSession,
    const IID & riid,
    void  ppvResource
)
```

### Parameters

*pDesc \[in]*\
Type: const D3D12\_RESOURCE\_DESC \*

A pointer to a **D3D12\_RESOURCE\_DESC** structure that describes the resource.

*InitialState \[in]*\
Type: D3D12\_RESOURCE\_STATES

The initial state of the resource, as a bitwise-OR'd combination of **D3D12\_RESOURCE\_STATES** enumeration constants.

*pOptimizedClearValue \[in, optional]*\
Type: const D3D12\_CLEAR\_VALUE \*

Specifies a **D3D12\_CLEAR\_VALUE** structure that describes the default value for a clear color.

*pOptimizedClearValue* specifies a value for which clear operations are most optimal. When the created resource is a texture with either the [D3D12\_RESOURCE\_FLAG\_ALLOW\_RENDER\_TARGET](/reference/graphics/d3d12_x/enums/d3d12_resource_flags) or **D3D12\_RESOURCE\_FLAG\_ALLOW\_DEPTH\_STENCIL** flags, you should choose the value with which the clear operation will most commonly be called. You can call the clear operation with other values, but those operations won't be as efficient as when the value matches the one passed in to resource creation.

When you use [D3D12\_RESOURCE\_DIMENSION\_BUFFER](/reference/graphics/d3d12_x/enums/d3d12_resource_dimension), you must set *pOptimizedClearValue* to `nullptr`.

*pProtectedSession \[in, optional]*\
Type: ID3D12ProtectedResourceSession \*

An optional pointer to an object that represents a session for content protection. If provided, this session indicates that the resource should be protected. You can obtain an **ID3D12ProtectedResourceSession** by calling [ID3D12Device4::CreateProtectedResourceSession](/reference/graphics/d3d12/interfaces/id3d12device4/methods/id3d12device4_createprotectedresourcesession_public).

*riid \[in]*\
Type: const IID &

A reference to the globally unique identifier (**GUID**) of the resource interface to return in *ppvResource*. See **Remarks**.

While *riidResource* is most commonly the **GUID** of [ID3D12Resource](/reference/graphics/d3d12_xs/interfaces/ID3D12Resource/id3d12resource_xs), it may be the **GUID** of any interface. If the resource object doesn't support the interface for this **GUID**, then creation fails with **E\_NOINTERFACE**.

*ppvResource \[out, optional]*\
Type: void \*\*

An optional pointer to a memory block that receives the requested interface pointer to the created resource object.

*ppvResource* can be `nullptr`, to enable capability testing. When *ppvResource* is `nullptr`, no object is created, and **S\_FALSE** is returned when *pDesc* is valid.

### Return value

Type: HRESULT

If the function succeeds, it returns **S\_OK**. Otherwise, it returns an [**HRESULT**](https://learn.microsoft.com/en-us/windows/desktop/com/structure-of-com-error-codes) [error code](https://learn.microsoft.com/en-us/windows/win32/com/com-error-codes-10).

| Return value   | Description                                          |
| -------------- | ---------------------------------------------------- |
| E\_OUTOFMEMORY | There is insufficient memory to create the resource. |

See [Direct3D 12 return codes](https://learn.microsoft.com/en-us/windows/win32/direct3d12/d3d12-graphics-reference-returnvalues) for other possible return values.

## Remarks

**CreateReservedResource** is equivalent to [D3D11\_RESOURCE\_MISC\_TILED](https://learn.microsoft.com/en-us/windows/win32/api/d3d11/ne-d3d11-d3d11_resource_misc_flag) in Direct3D 11. It creates a resource with virtual memory only, no backing store.

You need to map the resource to physical memory (that is, to a heap) using [CopyTileMappings](/reference/graphics/d3d12/interfaces/id3d12commandqueue/methods/id3d12commandqueue_copytilemappings_public) and [UpdateTileMappings](/reference/graphics/d3d12/interfaces/id3d12commandqueue/methods/id3d12commandqueue_updatetilemappings_public).

These resource types can only be created when the adapter supports tiled resource tier 1 or greater. The tiled resource tier defines the behavior of accessing a resource that is not mapped to a heap.

## Requirements

**Header:** d3d12\_xs.h\
**Library:** d3d12\_xs.lib\
**Supported Platforms**: XBOX Series consoles

## See Also

[CreateCommittedResource1](/reference/graphics/d3d12/interfaces/id3d12device4/methods/id3d12device4_createcommittedresource1_public)

[CreatePlacedResource](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createplacedresource_public)

[ID3D12Device4](/reference/graphics/d3d12/interfaces/id3d12device4/id3d12device4_public)


## Related topics

- [CreateCommittedResource1 (XBOX Series consoles)](/reference/graphics/d3d12/interfaces/id3d12device4/methods/id3d12device4_createcommittedresource1_public.md)
- [CreateReservedResource2 (XBOX Series consoles)](/reference/graphics/d3d12/interfaces/id3d12device10/methods/id3d12device10_createreservedresource2_public.md)
- [CreateHeap1 (XBOX Series consoles)](/reference/graphics/d3d12/interfaces/id3d12device4/methods/id3d12device4_createheap1_public.md)
- [CreatePlacedResource2 (XBOX Series consoles)](/reference/graphics/d3d12/interfaces/id3d12device10/methods/id3d12device10_createplacedresource2_public.md)
- [CreateCommandQueue1 (XBOX Series consoles)](/reference/graphics/d3d12/interfaces/id3d12device9/methods/id3d12device9_createcommandqueue1_public.md)
