Note that there are some explanatory texts on larger screens.

plurals
  1. POReturn error when trying to copy the render target's backbuffer
    primarykey
    data
    text
    <p>I have one WDDM user mode display driver for DX9. Now I would like to dump the render target's back buffer to a bmp file. Since the render target resource is not lockable, I have to create a resource from system buffer and bitblt from the render target to the system buffer and then save the system buffer to the bmp file. However, calling the bitblt always return the error code E_FAIL. I also tried to call the pfnCaptureToSysMem which also returned the same error code. Anything wrong here? </p> <pre><code> D3DDDI_SURFACEINFO nfo; nfo.Depth = 0; nfo.Width = GetRenderSize().cx; nfo.Height = GetRenderSize().cy; nfo.pSysMem = NULL; nfo.SysMemPitch = 0; nfo.SysMemSlicePitch = 0; D3DDDIARG_CREATERESOURCE resource; resource.Format = D3DDDIFMT_A8R8G8B8; resource.Pool = D3DDDIPOOL_SYSTEMMEM; resource.MultisampleType = D3DDDIMULTISAMPLE_NONE; resource.MultisampleQuality = 0; resource.pSurfList = &amp;nfo; resource.SurfCount = 1; resource.MipLevels = 1; resource.Fvf = 0; resource.VidPnSourceId = 0; resource.RefreshRate.Numerator = 0; resource.RefreshRate.Denominator = 0; resource.hResource = NULL; resource.Flags.Value = 0; resource.Flags.Texture = 1; resource.Flags.Dynamic = 1; resource.Rotation = D3DDDI_ROTATION_IDENTITY; HRESULT hr = m_pDevice-&gt;m_deviceFuncs.pfnCreateResource(m_pDevice-&gt;GetDrv(), &amp;resource); HANDLE hSysSpace = resource.hResource; D3DDDIARG_BLT blt; blt.hSrcResource = m_pDevice-&gt;m_hRenderTarget; blt.hDstResource = hSysSpace; blt.SrcRect.left = 0; blt.SrcRect.top = 0; blt.SrcRect.right = GetRenderSize().cx; blt.SrcRect.bottom = GetRenderSize().cy; blt.DstRect = blt.SrcRect; blt.DstSubResourceIndex = 0; blt.SrcSubResourceIndex = 0; blt.Flags.Value = 0; blt.ColorKey = 0; hr = m_pDevice-&gt;m_deviceFuncs.pfnBlt(m_pDevice, &amp;blt); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload