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

# CloseBundleX (XBOX One 系列)

> 關閉套件命令清單，同時將錄製的命令寫入指定的配置。

關閉套件命令清單，同時將錄製的命令寫入指定的配置。

## 語法

```cpp theme={null}
UINT CloseBundleX(  
         void** ppBundleBufferAddress,  
         UINT BundleBufferMaxSize  
)  
```

### 參數

*ppBundleBufferAddress*   \_Inout\_\
類型：void\*\*

套件命令配置器位址的指標。設定為現有的套件命令配置器時，套件命令清單中錄製的命令會複製到指定的記憶體位置。設定為 null 時，所需的記憶體會透過命令配置器配置，傳回時，位址會設定為配置的基底。

*BundleBufferMaxSize*   \
類型：UINT

所提供配置的大小上限。套件命令配置器大小必須小於或等於此上限，且可透過 [GetExecutionCommandSizeX](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_getexecutioncommandsizex) 取得。如果 *ppBundleBufferAddress* 設定為 null，請將指定的大小上限設定為零。

### 傳回值

類型：UINT

此方法會傳回關閉所產生之套件命令集的大小。

## 備註

此方法的用途是佈建可獨立於建構時所用之命令清單物件而保存和執行的套件。由於套件命令清單物件相對於其錄製的命令集可能會耗用大量記憶體，因此針對每個套件只維護命令集本身會比較有利。之後，您不必重設命令清單，而可以重設它以錄製其他套件。

此 API 的一般用法如下：

1. 使用 [GetExecutionCommandSizeX](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_getexecutioncommandsizex) 取得套件大小。
2. 為套件配置記憶體：明確配置，或透過命令配置器間接配置。
3. 使用 **CloseBundleX** 關閉命令清單，將命令認可至獨立的套件配置。
4. 重設或釋放命令清單。
5. 使用 [ExecuteIndirectBundleX](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_executeindirectbundlex) 執行套件配置。

## 需求

**標頭:** d3d12\_x.h

**程式庫:** d3d12\_x.lib

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

## 另請參閱

[ID3D12GraphicsCommandList](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12graphicscommandlist/id3d12graphicscommandlist)\
[CreateCommandAllocator](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12device-createcommandallocator)


## Related topics

- [ExecuteBundle](/zh-TW/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_executebundle_public.md)
- [XGameStreamingGetTouchBundleVersion](/zh-TW/reference/system/xgamestreaming/functions/xgamestreaminggettouchbundleversion.md)
- [XGameStreamingGetTouchBundleVersionNameSize](/zh-TW/reference/system/xgamestreaming/functions/xgamestreaminggettouchbundleversionnamesize.md)
- [XUserCloseHandle](/zh-TW/reference/system/xuser/functions/xuserclosehandle.md)
- [XPackageCloseMountHandle](/zh-TW/reference/system/xpackage/functions/xpackageclosemounthandle.md)
