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

# PrefetchMemoryX (XBOX One 系列)

> PrefetchMemoryX (XBOX One 系列主機) — 預先擷取指定位址的記憶體。適用於 XBOX 遊戲開發的 Direct3D 12 圖形 API 參考。

將指定位址的記憶體預先擷取至圖形第 2 層快取。

## 語法

```cpp theme={null}
void PrefetchMemoryX(  
         D3D12_GPU_VIRTUAL_ADDRESS BaseAddress,  
         UINT64 SizeBytes,  
         D3D12XBOX_PREFETCH_MEMORY_FLAGS Flags  
)  
```

### 參數

*BaseAddress*   \_In\_\
類型：[D3D12\_GPU\_VIRTUAL\_ADDRESS](https://learn.microsoft.com/en-us/windows/win32/direct3d12/d3d12_gpu_virtual_address)

基底位址。

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

要預先擷取的記憶體數量。

*Flags*   \_In\_\
類型：[D3D12XBOX\_PREFETCH\_MEMORY\_FLAGS](/zh-TW/reference/graphics/d3d12_x/enums/d3d12xbox_prefetch_memory_flags)

預先擷取作業的旗標，包括選取命令處理器中用來啟動預先擷取之引擎的能力。

### 傳回值

類型：void

無。

## 備註

記憶體預先擷取是使用命令處理器的 CPDMA 單元來執行。
CPDMA 單元一次最多可將兩個未完成的複製排入佇列而不會封鎖；更多同時發出的要求將使命令處理器停滯，直到有足夠的 CPDMA 作業完成而解除佇列封鎖為止。
提交 CPDMA 要求時，命令處理器的 ME 和 PFP 引擎上各有一個 2 項目的 FIFO 佇列。
要求會以循環配置方式從 PFP 和 ME 佇列提交至 CPDMA 單元。

## 需求

**標頭：** d3d12\_x.h 和 d3d12\_xs.h

**程式庫：** d3d12\_x.lib 或 d3d12\_xs.lib

**支援的平台：** XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[ID3D12GraphicsCommandList](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12graphicscommandlist/id3d12graphicscommandlist)

[PrefetchPipelineStateX](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_prefetchpipelinestatex)


## Related topics

- [game_chat_allocate_memory_callback](/zh-TW/reference/chat/gamechat2/functions/game_chat_allocate_memory_callback.md)
- [game_chat_free_memory_callback](/zh-TW/reference/chat/gamechat2/functions/game_chat_free_memory_callback.md)
- [PIXRecordMemoryAllocationEvent](/zh-TW/reference/tools/pix3/functions/pixrecordmemoryallocationevent.md)
- [PIXRecordMemoryFreeEvent](/zh-TW/reference/tools/pix3/functions/pixrecordmemoryfreeevent.md)
- [chat_manager::get_memory_callbacks](/zh-TW/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_memory_callbacks.md)
