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

> 指定與檢視執行個體相關聯的檢視區/樣板和轉譯目標。

指定與檢視執行個體相關聯的檢視區/樣板和轉譯目標。

## 語法

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

### 成員

*ViewportArrayIndex*\
類型：UINT

檢視區陣列中，要由與此位置相關聯之檢視執行個體使用的檢視區索引。

*RenderTargetArrayIndex*\
類型：UINT

轉譯目標陣列中，要由與此位置相關聯之檢視執行個體使用的轉譯目標索引。

## 備註

檢視執行個體位置結構中指定的值，可以加到點陣化之前的著色器所輸出的 ViewportArrayIndex 和 RenderTargetArrayIndex 值，以計算要將基本型別傳送至之檢視區和轉譯目標的最終有效索引。如果計算出的索引超出範圍 (也就是索引大於其各自陣列中的檢視區或轉譯目標元素數目)，則有效索引會變成 0。

對於動態選取檢視區或轉譯目標索引的著色器，應用程式可以將 PSO 中宣告的所有檢視執行個體位置設定為相同的值，作為所有檢視的統一基底值。

## 需求

**標頭:** d3d12\_xs.h 或 d3d12\_x.h\
**程式庫:** d3d12\_xs.lib 或 d3d12\_x.lib\
**支援的平台**: XBOX Series 主機與 XBOX One 系列

## 另請參閱

[核心結構](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/direct3d-12-structures)


## Related topics

- [D3D12_VIEW_INSTANCING_DESC](/zh-TW/reference/graphics/d3d12/structs/d3d12_view_instancing_desc_public.md)
- [D3D12_VIEW_INSTANCING_FLAGS](/zh-TW/reference/graphics/d3d12/enums/d3d12_view_instancing_flags_public.md)
- [D3D12_VERTEX_BUFFER_VIEW](/zh-TW/reference/graphics/d3d12/structs/d3d12_vertex_buffer_view_public.md)
- [D3D12_INDEX_BUFFER_VIEW](/zh-TW/reference/graphics/d3d12/structs/d3d12_index_buffer_view_public.md)
- [D3D12_STREAM_OUTPUT_BUFFER_VIEW](/zh-TW/reference/graphics/d3d12/structs/d3d12_stream_output_buffer_view_public.md)
