ID3DX11ThreadPump::ProcessDeviceWorkItems method

Note  The D3DX (D3DX 9, D3DX 10, and D3DX 11) utility library is deprecated for Windows 8 and is not supported for Windows Store apps.

Sets work items to the device after they have finished loading and processing.


HRESULT ProcessDeviceWorkItems(
  [in] UINT iWorkItemCount


iWorkItemCount [in]

Type: UINT

The number of work items to set to the device.

Return value


The return value is one of the values listed in Direct3D 11 Return Codes.


When the thread pump has finished loading and processing a resource or shader, it will hold it in a queue until this API is called, at which point the processed items will be set to the device. This is useful for controlling the amount of processing that is spent on binding resources to the device for each frame.

As an example of how one might use this API, say you are nearing the end of one level in your game and you want to begin preloading the textures, shaders, and other resources for the next level. The thread pump will begin loading, decompressing, and processing the resources and shaders on a separate thread until they are ready to be set to the device, at which point it will leave them in a queue. One may not want to set all the resources and shaders to the device at once because this may cause a noticeable temporary slow down in the game's performance. So, this API could be called once per frame so that only a small number work items would be set to the device on each frame, thereby spreading the work load of binding resources to the device over several frames.






See also

D3DX Interfaces