> ## 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 主機) — 從資源的 (請參閱 xgtextureaddresscomputer_copyfromsubresource) 複製 2D 或 3D 資料

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

<a id="syntaxSection" />

## 語法

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

<a id="ID4EG" />

### 參數

*pLinearData*   \_Inout\_<br />類型：VOID\*

要將資料複製到其中的位置。

*Plane*   \_In\_<br />類型：UINT32

平面。

*Subresource*   \_In\_<br />類型：UINT32

要從中複製的子資源。

*pTiledResourceBaseAddress*   \_In\_<br />類型：VOID\*

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

*RowPitchBytes*   \_In\_<br />類型：UINT32

資料列間距 (以位元組為單位)。

*SlicePitchBytes*   \_In\_<br />類型：UINT32

配量間距 (以位元組為單位)。

<a id="ID4EP" />

### 傳回值

類型：[HRESULT](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a)

如果成功，會傳回 **S\_OK**；否則會傳回錯誤碼。如需錯誤碼清單，請參閱[錯誤碼](/zh-TW/reference/errorcodes)。

<a id="remarks" />

## 備註

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

<a id="requirements" />

## 需求

**標頭：** xg.h

**程式庫：** xg\_x.lib

**支援的平台：** XBOX One 系列

<a id="ID4EHC" />

## 另請參閱

[XGTextureAddressComputer](/zh-TW/reference/graphics/xg__NR/interfaces/XGTextureAddressComputer/xgtextureaddresscomputer)<br />[XG 參考](/zh-TW/reference/graphics/xg__NR/xg_members)


## Related topics

- [Répertoire des rubriques NDA : liens actifs vers Microsoft Learn](/fr-CA/nda/nda-topic-directory.md)
- [NDA 토픽 디렉터리 - Microsoft Learn 라이브 링크](/ko/nda/nda-topic-directory.md)
- [Directorio de temas NDA: enlaces activos a Microsoft Learn](/es/nda/nda-topic-directory.md)
- [Diretório de tópicos NDA: links ativos do Microsoft Learn](/pt-BR/nda/nda-topic-directory.md)
- [NDA 主题目录 - Microsoft Learn 在线链接](/zh-CN/nda/nda-topic-directory.md)
