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

# XGComputeTexture1DLayout (XBOX One 系列)

> 計算 1D 紋理的硬體配置。

計算 1D 紋理的硬體配置。

<a id="syntaxSection" />

## 語法

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

<a id="ID4EU" />

### 參數

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

1D 紋理的描述，以指向 [XG\_TEXTURE1D\_DESC](/zh-TW/reference/graphics/xg__NR/structs/xg_texture1d_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)。

<a id="remarks" />

## 備註

當您只需要計算配置，而不需要使用紋理計算器的任何其他功能時，請使用此便利函式，而不要建立紋理計算器。此函式會在內部建立紋理計算器、呼叫 [XGTextureAddressComputer::GetResourceLayout 方法](/zh-TW/reference/graphics/xg__NR/interfaces/XGTextureAddressComputer/methods/xgtextureaddresscomputer_getresourcelayout)，然後釋放紋理計算器。

如果發生下列任何情況，函式會傳回 **E\_INVALIDARG**：

* 如果 *pDesc* 或 *pLayout* 為 null。
* 如果 **XG\_TEXTURE1D\_DESC.Usage** 為 XG\_USAGE\_DYNAMIC。離線資源不允許使用動態用途。
* 如果 **XG\_TEXTURE1D\_DESC.Pitch** 不是 0。
* 如果 **XG\_TEXTURE1D\_DESC.Usage** 為 XG\_USAGE\_STAGING，且 **XG\_TEXTURE1D\_DESC.TileMode** 不是 XG\_TILE\_MODE\_LINEAR。暫存資源僅支援線性並排模式。
* 如果 **XG\_TEXTURE1D\_DESC** 旗標無效。

<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)
- [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)
- [SetComputeRoot32BitConstant](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_setcomputeroot32bitconstant_public.md)
