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

# XGComputeBufferLayout (XBOX One 系列)

> 計算緩衝區的硬體對齊。

計算緩衝區的硬體對齊。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
HRESULT XGComputeBufferLayout(
         const XG_BUFFER_DESC* pDesc,  
         XG_RESOURCE_LAYOUT* pLayout  
)  
```

<a id="ID4EU" />

### 參數

*pDesc*   \_In\_<br />類型：[XG\_BUFFER\_DESC\*](/zh-TW/reference/graphics/xg__NR/structs/xg_buffer_desc)

緩衝區資源的描述，以指向 [XG\_BUFFER\_DESC](/zh-TW/reference/graphics/xg__NR/structs/xg_buffer_desc) 結構的指標表示。

*pLayout*   \_Out\_<br />類型：[XG\_RESOURCE\_LAYOUT\*](/zh-TW/reference/graphics/xg__NR/structs/xg_resource_layout)

資源配置，以指向 [XG\_RESOURCE\_LAYOUT](/zh-TW/reference/graphics/xg__NR/structs/xg_resource_layout) 結構的指標表示。

<a id="ID4E3" />

### 傳回值

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

如果成功，會傳回 **S\_OK**；否則會傳回錯誤碼。如需錯誤碼清單，請參閱[錯誤碼](/zh-TW/reference/errorcodes)。如果函式因 *pDesc* 和 *pLayout* 為 null 而失敗，傳回碼會設為 **E\_INVALIDARG**。

如果 *pDesc* 和 *pLayout* 為 null，此函式會傳回 E\_INVALIDARG。與任何計算紋理配置的函式 (例如 [XGComputeTexture1DLayout](/zh-TW/reference/graphics/xg__NR/functions/xgcomputetexture1dlayout)) 不同，此函式沒有其他限制。

<a id="requirements" />

## 需求

**標頭：** xg.h

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

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

## 另請參閱

[XG 參考](/zh-TW/reference/graphics/xg__NR/xg_members)


## Related topics

- [NDA 主題目錄 - Microsoft Learn 線上連結](/zh-TW/nda/nda-topic-directory.md)
- [SetComputeRootConstantBufferView](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_setcomputerootconstantbufferview_public.md)
- [LoadComputePipeline](/zh-CN/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/methods/id3d12pipelinelibrary_loadcomputepipeline_public.md)
- [SetComputeRootSignature](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_setcomputerootsignature_public.md)
- [CreateComputePipelineState](/zh-CN/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createcomputepipelinestate_public.md)
