D1124: DXGI Format Unknown With Null Target Bitmap

DXGI_FORMAT_UNKNOWN is not allowed as a parameter to this API when the target is set to NULL or is a command list.

 

Possible Causes

For operations such as ID2D1RenderTarget::CreateCompatibleRenderTarget, the source render target must have a target bitmap assigned. Without a target bitmap, Direct2D cannot determine which surface format the new render target resource will have.

Possible Fixes

To address this, ensure the corresponding ID2D1DeviceContext has a target bitmap assigned using ID2D1DeviceContext::SetTarget. Or, if the application simply needs the ability to render to two different target surfaces, consider creating an ID2D1Bitmap and setting it as the device context’s target rather than use ID2D1RenderTarget::CreateCompatibleRenderTarget.