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

# D3D12_VIEW_INSTANCE_LOCATION

> Specifies the viewport/stencil and render target associated with a view instance.

Specifies the viewport/stencil and render target associated with a view instance.

## Syntax

```cpp theme={null}
typedef struct D3D12_VIEW_INSTANCE_LOCATION
{
    UINT ViewportArrayIndex;
    UINT RenderTargetArrayIndex;
} D3D12_VIEW_INSTANCE_LOCATION
```

### Members

*ViewportArrayIndex*\
Type: UINT

The index of the viewport in the viewports array to be used by the view instance associated with this location.

*RenderTargetArrayIndex*\
Type: UINT

The index of the render target in the render targets array to be used by the view instance associated with this location.

## Remarks

The values specified in a view instance location structure can be added to ViewportArrayIndex and RenderTargetArrayIndex values output by the shader prior to rasterization to compute the final effective index of the viewport and render target to send primitives to. If a computed index is out of range (that is, when the index is larger than the number of viewport or render target elements in their respective arrays) then the effective index becomes 0.

For shaders that dynamically select the viewport or render target indices, an application can set all the view instance locations declared in a PSO to the same value to act as a uniform base value for all views.

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

[Core Structures](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/direct3d-12-structures)


## Related topics

- [D3D12_VIEW_INSTANCING_DESC](/reference/graphics/d3d12/structs/d3d12_view_instancing_desc_public.md)
- [D3D12_VIEW_INSTANCING_FLAGS](/reference/graphics/d3d12/enums/d3d12_view_instancing_flags_public.md)
- [D3D12_STREAM_OUTPUT_BUFFER_VIEW](/reference/graphics/d3d12/structs/d3d12_stream_output_buffer_view_public.md)
- [D3D12_VIEW_INSTANCING_TIER](/reference/graphics/d3d12/enums/d3d12_view_instancing_tier_public.md)
- [D3D12_VERTEX_BUFFER_VIEW](/reference/graphics/d3d12/structs/d3d12_vertex_buffer_view_public.md)
