void CRenderCaptureDX::ReadOut() { if (m_query) { //if the result of the occlusion query is available, the data is probably also written into m_copySurface HRESULT result = m_query->GetData(NULL, 0, D3DGETDATA_FLUSH); if (result == S_OK) { SurfaceToBuffer(); } else if (result != S_FALSE) { CLog::Log(LOGERROR, "CRenderCaptureDX::ReadOut: GetData failed"); SurfaceToBuffer(); } } else { SurfaceToBuffer(); } }
void CRenderCaptureDX::ReadOut() { if (m_query) { //if the result of the occlusion query is available, the data is probably also written into m_copySurface HRESULT result = DX::DeviceResources::Get()->GetImmediateContext()->GetData(m_query, nullptr, 0, 0); if (SUCCEEDED(result)) { if (S_OK == result) SurfaceToBuffer(); } else { CLog::Log(LOGERROR, "%s: GetData failed.", __FUNCTION__); SurfaceToBuffer(); } } else { SurfaceToBuffer(); } }
void CRenderCaptureDX::ReadOut() { if (m_query) { //if the result of the occlusion query is available, the data is probably also written into m_copySurface HRESULT result = g_Windowing.GetImmediateContext()->GetData(m_query, nullptr, 0, 0); if (SUCCEEDED(result)) { if (S_OK == result) SurfaceToBuffer(); } else { CLog::Log(LOGERROR, "CRenderCaptureDX::ReadOut: GetData failed"); SurfaceToBuffer(); } } else { SurfaceToBuffer(); } }
void CRenderCaptureDX::EndRender() { // send commands to the GPU queue g_Windowing.FinishCommandList(); ID3D11DeviceContext* pContext = g_Windowing.GetImmediateContext(); pContext->CopyResource(m_copySurface, m_renderTexture); if (m_query) { pContext->End(m_query); } if (m_flags & CAPTUREFLAG_IMMEDIATELY) SurfaceToBuffer(); else SetState(CAPTURESTATE_NEEDSREADOUT); }
void CRenderCaptureDX::EndRender() { LPDIRECT3DDEVICE9 pD3DDevice = g_Windowing.Get3DDevice(); //GetRenderTargetData should be async on most drivers, //so the render thread doesn't have to wait for the gpu to copy the data to m_copySurface pD3DDevice->GetRenderTargetData(m_renderSurface, m_copySurface); if (m_asyncSupported) { m_query->Issue(D3DISSUE_END); m_query->GetData(NULL, 0, D3DGETDATA_FLUSH); //flush the query request } if (m_flags & CAPTUREFLAG_IMMEDIATELY) SurfaceToBuffer(); else SetState(CAPTURESTATE_NEEDSREADOUT); }
void CRenderCaptureDX::EndRender() { // send commands to the GPU queue auto deviceResources = DX::DeviceResources::Get(); deviceResources->FinishCommandList(); ID3D11DeviceContext* pContext = deviceResources->GetImmediateContext(); pContext->CopyResource(m_copyTex.Get(), m_renderTex.Get()); if (m_query) { pContext->End(m_query); } if (m_flags & CAPTUREFLAG_IMMEDIATELY) SurfaceToBuffer(); else SetState(CAPTURESTATE_NEEDSREADOUT); }