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

# CreateMinMipShaderResourceViewX (XBOX Series 主機)

> 根據目標資源 (或描述) 結合 MinMip 資源，建立 MinMip 對應著色器資源檢視。

CreateMinMipShaderResourceViewX 是 XBOX 延伸 API，會根據目標資源 (或描述) 結合 MinMip 資源，建立 MinMip 對應著色器資源檢視。與建立意見反應對應 UAV 類似，此 API 會將目標資源的屬性 (寬度、高度、MIP 層級) 與 MinMip 對應資源的屬性 (寬度、高度、格式) 結合在一起，以產生連結的資源描述元。

## 語法

```cpp theme={null}
void CreateMinMipShaderResourceViewX(  
         ID3D12Resource* pTargetedResource,  
         const D3D12_RESOURCE_DESC* pTargetedResourceDesc,  
         ID3D12Resource* pMinMipResource,  
         const D3D12_SHADER_RESOURCE_VIEW_DESC* pDesc,  
         D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor  
)  
```

### 參數

*pTargetedResource*   \_In\_opt\_\
類型：ID3D12Resource\*

目標紋理資源物件的 ID3D12Resource 介面指標。這應該是保留的資源。pTargetedResource 或 pTargetedResourceDesc 其中之一必須為非 null。

*pTargetedResourceDesc*   \_In\_opt\_\
類型：D3D12\_RESOURCE\_DESC\*

目標紋理資源物件的資源描述。使用資源的描述而非特定資源物件來建立 MinMip 著色器資源檢視可能較為方便。pTargetedResource 或 pTargetedResourceDesc 其中之一必須為非 null。

*pMinMipResource*   \_In\_opt\_\
類型：ID3D12Resource\*

MinMip 紋理資源物件的 ID3D12Resource 介面指標。

*pDesc*   \_In\_opt\_\
類型：D3D12\_SHADER\_RESOURCE\_VIEW\_DESC\*

指向描述著色器資源檢視之 D3D12\_SHADER\_RESOURCE\_VIEW\_DESC 結構的指標。

null pDesc 會用來在可能的情況下初始化預設描述元。此行為與 D3D11 null 描述元行為相同，會填入預設值。此行為會繼承資源格式和維度 (如果不是無類型)；對於緩衝區，SRV 以完整緩衝區為目標且為具類型 (非原始或結構化)；對於紋理，SRV 以完整紋理、所有 MIP 和所有陣列配量為目標。並非所有資源都支援 null 描述元初始化。

*DestDescriptor*   \_In\_\
類型：D3D12\_CPU\_DESCRIPTOR\_HANDLE

描述代表著色器資源檢視的 CPU 描述元控制代碼。此控制代碼可以在著色器可見或非著色器可見的描述元堆積中建立。

### 傳回值

無

## 備註

MinMip 對應資源必須具有下列條件：

1. 維度為目標資源維度的 2 的乘冪分之一
2. 格式為 R8\_UINT
3. MipLevels 計數為 1

建議 MinMip 對應資源使用 D3D12XBOX\_TEXTURE\_LAYOUT\_SWIZZLE\_MODE\_256B\_S 的 Swizzle 模式，因為這些資源預期會很小。

## 需求

**標頭：** d3d12\_xs.h

**程式庫：** d3d12\_xs.lib\
**支援的平台：** XBOX Series 主機

## 另請參閱

[取樣器意見反應 Direct3D 12 API 概觀](https://learn.microsoft.com/en-us/gaming/gdk/_content/gc/graphics/newfeatures/sfs/sf-api-design)

[ID3D12Device8](/zh-TW/reference/graphics/d3d12_xs/interfaces/ID3D12Device8/id3d12device8)


## Related topics

- [D3D12_TEX1D_SRV](/reference/graphics/d3d12/structs/d3d12_tex1d_srv_public.md)
- [CreateShaderResourceView](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createshaderresourceview_public.md)
- [D3D12_TEX3D_SRV](/reference/graphics/d3d12/structs/d3d12_tex3d_srv_public.md)
- [D3D12_TEXCUBE_SRV](/reference/graphics/d3d12/structs/d3d12_texcube_srv_public.md)
- [D3D12_TEX2D_SRV](/reference/graphics/d3d12/structs/d3d12_tex2d_srv_public.md)
