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

# PrepareTexture

> 準備串流紋理讀取器，以計算指定紋理在其封存中的資料流索引。

準備串流紋理讀取器，以計算指定紋理在其封存中的資料流索引。

## 語法

```cpp theme={null}
HRESULT PrepareTexture(
  const XBTCArchive * pArchive,
  uint32_t ResourceIdx
)
```

### 參數

`pArchive`\
類型: const XBTCArchive \*

已開啟的紋理封存。

`ResourceIdx`\
類型: uint32\_t

要準備之資源的索引。

### 傳回值

類型: HRESULT

準備成功時傳回 S\_OK。可能失敗的情況包括: 資源索引無效、資源為資料緩衝區，以及紋理細微度為「整個 mip」。此外，對於 3D 紋理、2D 陣列和非 BC 格式，可能會傳回 E\_NOTIMPL。

## 需求

**標頭:** XBTC.h\
**支援的平台**: XBOX One 系列主機與 XBOX Series 主機

## 另請參閱

[XBTC 成員](/zh-TW/reference/graphics/xbtc/xbtc_members)\
[XBTCStreamingTextureReader](/zh-TW/reference/graphics/xbtc/interfaces/xbtcstreamingtexturereader/xbtcstreamingtexturereader)


## Related topics

- [NDA 主題目錄 - Microsoft Learn 線上連結](/zh-TW/nda/nda-topic-directory.md)
- [D3D12_TEXTURE_COPY_LOCATION](/zh-TW/reference/graphics/d3d12/structs/d3d12_texture_copy_location_public.md)
- [D3D12_TEXTURE_COPY_TYPE](/zh-TW/reference/graphics/d3d12/enums/d3d12_texture_copy_type_public.md)
- [XBOX Texture Compressor (XBTC) 工具參考](/zh-TW/build/core-features/graphics/newfeatures/xbtc/index.md)
- [D3D12_TEXTURE_BARRIER (XBOX Series 主機)](/zh-TW/reference/graphics/d3d12/structs/d3d12_texture_barrier_public.md)
