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

> XGTextureAddressComputer::GetTexelElementOffsetBytes (XBOX Series 主機) — 計算位移 (請參閱 xgtextureaddresscomputer_gettexelelementoffsetbytes_xs)

計算指定材質像素元素相對於資源基底位址的位移 (以位元組為單位)。

## 語法

```cpp theme={null}
UINT64 GetTexelElementOffsetBytes(  
         UINT32 Plane,  
         UINT32 MipLevel,  
         UINT64 X,  
         UINT32 Y,  
         UINT32 ZOrSlice,  
         UINT32 Sample,  
         UINT32* pBitPosition  
)  
```

### 參數

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

平面。

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

Mip 層級。

*X*   \_In\_\
類型：UINT64

材質像素元素的 x 座標。

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

材質像素元素的 y 座標。

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

材質像素元素的 Z 或配量座標。

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

要開始複製之取樣的索引，通常為零。如果此參數大於或等於取樣計數，此函式會傳回錯誤。

*pBitPosition*   \_Out\_opt\_\
類型：UINT32\*

在子位元組位移的情況下，輸出材質像素位址的位元位置。

### 傳回值

類型：UINT64

如果呼叫成功，傳回值是指定材質像素元素相對於資源基底位址的位移 (以位元組為單位)。

下列任一情況都會導致錯誤，並傳回值 -1 (0xffffffffffffffff，即 UINT64 的最大值)：

* Plane 參數大於或等於紋理計算器所計算的平面計數。
* 取樣計數大於或等於紋理計算器所計算的取樣數目。

## 需求

**標頭:** 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)
- [GetXmaPacketFirstFrameOffsetInBits](/zh-TW/reference/audio/xma2defs/functions/getxmapacketfirstframeoffsetinbits.md)
- [GetShapeXmaOutputBufferNumBytesAvailable](/zh-TW/reference/audio/shapexmacontext/functions/getshapexmaoutputbuffernumbytesavailable.md)
- [D3D12_BUFFER_UAV](/zh-TW/reference/graphics/d3d12/structs/d3d12_buffer_uav_public.md)
- [GetCopyableFootprints](/zh-TW/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_getcopyablefootprints_public.md)
