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

# XGTextureAddressComputer::CopyFromSubresource

> XGTextureAddressComputer::CopyFromSubresource (XBOX Series 主機) — 從以下項目複製 2D 或 3D 資料 (請參閱 xgtextureaddresscomputer_copyfromsubresource_xs)

將資源指定子資源 (mip + 配量) 中的 2D 或 3D 資料複製到線性目的地。

## 語法

```cpp theme={null}
HRESULT CopyFromSubresource(  
         VOID* pLinearData,  
         UINT32 Plane,  
         UINT32 Subresource,  
         UINT32 Sample,  
         const VOID* pTiledResourceBaseAddress,  
         UINT32 RowPitchBytes,  
         UINT32 SlicePitchBytes  
)  
```

### 參數

*pLinearData*   \_Inout\_\
類型：VOID\*

要複製資料的目標位置。

*Plane*   \_In\_\
類型：UINT32

平面。

*Subresource*   \_In\_\
類型：UINT32

要複製來源的子資源。

*Sample*   \_In\_\
類型：UINT32

要複製來源的取樣索引。

*pTiledResourceBaseAddress*   \_In\_\
類型：VOID\*

要複製來源之並排資源的基底位址，以 VOID 指標表示。若為離線紋理準備，*pTiledResourceBaseAddress* 不需要正確對齊。

*RowPitchBytes*   \_In\_\
類型：UINT32

目的地線性列間距，以位元組為單位。

*SlicePitchBytes*   \_In\_\
類型：UINT32

目的地線性配量間距，以位元組為單位。

### 傳回值

類型：HRESULT

如果成功，則傳回 S\_OK；否則傳回錯誤碼。如需錯誤碼清單，請參閱 [Direct3D 12 傳回碼](https://learn.microsoft.com/en-us/windows/win32/direct3d12/d3d12-graphics-reference-returnvalues)。

## 備註

此方法會使用 *pTiledResourceBaseAddress* 作為資源的基底位址，從資源的指定子資源 (mip + 配量) 複製 2D 或 3D 線性輸入資料。若為離線紋理準備，*pTiledResourceBaseAddress* 不需要正確對齊。

<a id="requirements" />

## 需求

**標頭:** xg\_xs.h

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

## 另請參閱

[XGTextureAddressComputer](/zh-TW/reference/graphics/xg_xs/interfaces/XGTextureAddressComputer/xgtextureaddresscomputer_xs)


## Related topics

- [NDA 主題目錄 - Microsoft Learn 線上連結](/zh-TW/nda/nda-topic-directory.md)
- [D3D12_TEXTURE_COPY_TYPE](/zh-TW/reference/graphics/d3d12/enums/d3d12_texture_copy_type_public.md)
- [D3D12_TEXTURE_COPY_LOCATION](/zh-TW/reference/graphics/d3d12/structs/d3d12_texture_copy_location_public.md)
- [D3D12_PLACED_SUBRESOURCE_FOOTPRINT](/zh-TW/reference/graphics/d3d12/structs/d3d12_placed_subresource_footprint_public.md)
- [D3D12_BOX](/zh-TW/reference/graphics/d3d12/structs/d3d12_box_public.md)
