third_party/virtualbox/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp
/* Wait for all drawing, that uses this surface, to finish. */
Wait for all drawing, that uses this surface, to finish.
Wait for all drawing that uses this surface to finish .
int vmsvga3dSurfaceFlush(PVGASTATE pThis, PVMSVGA3DSURFACE pSurface)
{
    RT_NOREF(pThis);
#ifndef VBOX_VMSVGA3D_WITH_WINE_OPENGL
    HRESULT hr;
    if (!pSurface->pQuery)
    {
        LogFlow(("vmsvga3dSurfaceFlush: no query object\n"));
        return VINF_SUCCESS;    
    }
    Assert(pSurface->pSharedObjectTree);
    Log(("vmsvga3dSurfaceFlush: wait for draw to finish (sid=%x)\n", pSurface->id));
    while (true)
    {
        hr = pSurface->pQuery->GetData(NULL, 0, D3DGETDATA_FLUSH);
        if (hr != S_FALSE) break;
        RTThreadSleep(1);
    }
    AssertMsgReturn(hr == S_OK, ("vmsvga3dSurfaceFinishDrawing: GetData failed with %x\n", hr), VERR_INTERNAL_ERROR);
    D3D_RELEASE(pSurface->pQuery);
#endif 
    return VINF_SUCCESS;
}
int vmsvga3dSurfaceFlush ( PVGASTATE pThis , PVMSVGA3DSURFACE pSurface ) { RT_NOREF ( pThis ) ; #ifndef VBOX_VMSVGA3D_WITH_WINE_OPENGL HRESULT hr ; if ( ! pSurface -> pQuery ) { LogFlow ( ( " \n " ) ) ; return VINF_SUCCESS ; } Assert ( pSurface -> pSharedObjectTree ) ; Log ( ( " \n " , pSurface -> id ) ) ; while ( true ) { hr = pSurface -> pQuery -> GetData ( NULL , 0 , D3DGETDATA_FLUSH ) ; if ( hr != S_FALSE ) break ; RTThreadSleep ( 1 ) ; } AssertMsgReturn ( hr == S_OK , ( " \n " , hr ) , VERR_INTERNAL_ERROR ) ; D3D_RELEASE ( pSurface -> pQuery ) ; #endif return VINF_SUCCESS ; }
Wait for all drawing, that uses this surface, to finish.
Wait for all drawing that uses this surface to finish .
/* nothing to wait for */ /* !VBOX_VMSVGA3D_WITH_WINE_OPENGL */