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

# ExecuteBundle

> 번들을 실행합니다.

번들을 실행합니다.

## 구문

```cpp theme={null}
void ExecuteBundle(
    ID3D12GraphicsCommandList  pCommandList
)
```

### 매개 변수

*pCommandList \[in]*\
형식: ID3D12GraphicsCommandList \*

실행할 번들을 결정하는 [ID3D12GraphicsCommandList](/reference/graphics/d3d12_xs/interfaces/ID3D12GraphicsCommandList/id3d12graphicscommandlist_xs)를 지정합니다.

### 반환 값

형식: void

없음.

## 설명

번들은 파이프라인 상태 개체 및 기본 도형 토폴로지를 제외하고 **ExecuteBundle**이 호출되는 상위 명령 목록에서 모든 상태를 상속합니다.
번들에 설정된 모든 상태는 상위 명령 목록의 상태에 영향을 줍니다.
**ExecuteBundle**은 예측 연산이 아님에 유의하세요.

<h3><a id="Runtime_validation" /><a id="runtime_validation" /><a id="RUNTIME_VALIDATION" />런타임 유효성 검사</h3>
런타임은 "callee"가 번들이고 "caller"가 직접 명령 목록임을 확인합니다. 런타임은 또한 번들이 닫혀 있는지 확인합니다. 계약이 위반되면 런타임은 호출을 자동으로 삭제합니다.
유효성 검사에 실패하면 [Close](/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_close_public)가 E\_INVALIDARG를 반환합니다.

<h3><a id="Debug_layer" /><a id="debug_layer" /><a id="DEBUG_LAYER" />디버그 레이어</h3>
디버그 레이어는 런타임이 실패하는 것과 동일한 경우에 경고를 발생시킵니다.
[ExecuteCommandList](/reference/graphics/d3d12_x/interfaces/id3d12commandqueue/methods/id3d12commandqueue_executecommandlists)가 호출될 때 조건자가 설정된 경우 디버그 레이어는 경고를 발생시킵니다.
또한 명령 목록에 의해 참조되는 리소스가 삭제된 것을 감지하면 디버그 레이어는 오류를 발생시킵니다.

디버그 레이어는 또한 명령 목록에서 [Close](/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_close_public)가 호출된 이후 번들과 관련된 명령 할당자가 재설정되지 않았는지 확인합니다. 이 유효성 검사는 **ExecuteBundle** 시점과 상위 명령 목록이 명령 큐에서 실행될 때 발생합니다.

#### 예제

[D3D12Bundles](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/working-samples) 샘플은 다음과 같이 **ID3D12GraphicsCommandList::ExecuteBundle**을 사용합니다:

```cpp theme={null}
void D3D12Bundles::PopulateCommandList(FrameResource* pFrameResource)
{
// Command list allocators can only be reset when the associated
// command lists have finished execution on the GPU; apps should use
// fences to determine GPU execution progress.
ThrowIfFailed(m_pCurrentFrameResource->m_commandAllocator->Reset());

// However, when ExecuteCommandList() is called on a particular command
// list, that command list can then be reset at any time and must be before
// re-recording.
ThrowIfFailed(m_commandList->Reset(m_pCurrentFrameResource->m_commandAllocator.Get(), m_pipelineState1.Get()));

// Set necessary state.
m_commandList->SetGraphicsRootSignature(m_rootSignature.Get());

ID3D12DescriptorHeap* ppHeaps[] = { m_cbvSrvHeap.Get(), m_samplerHeap.Get() };
m_commandList->SetDescriptorHeaps(_countof(ppHeaps), ppHeaps);

m_commandList->RSSetViewports(1, &m_viewport);
m_commandList->RSSetScissorRects(1, &m_scissorRect);

// Indicate that the back buffer will be used as a render target.
m_commandList->ResourceBarrier(1, &CD3DX12_RESOURCE_BARRIER::Transition(m_renderTargets[m_frameIndex].Get(), D3D12_RESOURCE_STATE_PRESENT, D3D12_RESOURCE_STATE_RENDER_TARGET));

CD3DX12_CPU_DESCRIPTOR_HANDLE rtvHandle(m_rtvHeap->GetCPUDescriptorHandleForHeapStart(), m_frameIndex, m_rtvDescriptorSize);
CD3DX12_CPU_DESCRIPTOR_HANDLE dsvHandle(m_dsvHeap->GetCPUDescriptorHandleForHeapStart());
m_commandList->OMSetRenderTargets(1, &rtvHandle, FALSE, &dsvHandle);

// Record commands.
const float clearColor[] = { 0.0f, 0.2f, 0.4f, 1.0f };
m_commandList->ClearRenderTargetView(rtvHandle, clearColor, 0, nullptr);
m_commandList->ClearDepthStencilView(m_dsvHeap->GetCPUDescriptorHandleForHeapStart(), D3D12_CLEAR_FLAG_DEPTH, 1.0f, 0, 0, nullptr);

if (UseBundles)
{
// Execute the prebuilt bundle.
m_commandList->ExecuteBundle(pFrameResource->m_bundle.Get());
}
else
{
// Populate a new command list.
pFrameResource->PopulateCommandList(m_commandList.Get(), m_pipelineState1.Get(), m_pipelineState2.Get(), m_currentFrameResourceIndex, m_numIndices, &m_indexBufferView,
&m_vertexBufferView, m_cbvSrvHeap.Get(), m_cbvSrvDescriptorSize, m_samplerHeap.Get(), m_rootSignature.Get());
}

// Indicate that the back buffer will now be used to present.
m_commandList->ResourceBarrier(1, &CD3DX12_RESOURCE_BARRIER::Transition(m_renderTargets[m_frameIndex].Get(), D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_PRESENT));

ThrowIfFailed(m_commandList->Close());
}

```

[D3D12 참조의 예제 코드](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/notes-on-example-code)를 참조하세요.

<div class="code" />

## 요구 사항

**헤더:** d3d12\_xs.h 또는 d3d12\_x.h\
**라이브러리:** d3d12\_xs.lib 또는 d3d12\_x.lib\
**지원 플랫폼**: XBOX Series 콘솔 및 XBOX One 제품군

## 함께 보기

[ID3D12GraphicsCommandList](/reference/graphics/d3d12_xs/interfaces/ID3D12GraphicsCommandList/id3d12graphicscommandlist_xs)


## Related topics

- [ExecuteFunctionResult](/ko/services/playfab/api-references/events/data-types/executefunctionresult.md)
- [XGameStreamingGetTouchBundleVersion](/ko/reference/system/xgamestreaming/functions/xgamestreaminggettouchbundleversion.md)
- [ExecuteCloudScriptResult](/ko/services/playfab/api-references/events/data-types/executecloudscriptresult.md)
- [XGameStreamingGetTouchBundleVersionNameSize](/ko/reference/system/xgamestreaming/functions/xgamestreaminggettouchbundleversionnamesize.md)
- [PFInventoryExecuteInventoryOperationsResponse](/ko/services/playfab/api-references/c/pfinventorytypes/structs/pfinventoryexecuteinventoryoperationsresponse.md)
