Changeset 44937 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
- Timestamp:
- Mar 6, 2013 7:45:08 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r44924 r44937 1024 1024 GLuint width; 1025 1025 GLuint height; 1026 1027 CRASSERT(pCtxInfo->currentMural);1028 1026 1029 1027 crMemset(pData, 0, sizeof (*pData)); … … 1498 1496 } 1499 1497 1498 #define CR_DBG_STR_STATE_SAVE_START "VBox.Cr.StateSaveStart" 1499 #define CR_DBG_STR_STATE_SAVE_STOP "VBox.Cr.StateSaveStop" 1500 1501 if (cr_server.head_spu->dispatch_table.StringMarkerGREMEDY) 1502 cr_server.head_spu->dispatch_table.StringMarkerGREMEDY(sizeof (CR_DBG_STR_STATE_SAVE_START), CR_DBG_STR_STATE_SAVE_START); 1503 1500 1504 /* Save rendering contexts creation info */ 1501 1505 ui32 = crHashtableNumElements(cr_server.contextTable); … … 1614 1618 cr_server.bIsInSavingState = GL_FALSE; 1615 1619 1620 if (cr_server.head_spu->dispatch_table.StringMarkerGREMEDY) 1621 cr_server.head_spu->dispatch_table.StringMarkerGREMEDY(sizeof (CR_DBG_STR_STATE_SAVE_STOP), CR_DBG_STR_STATE_SAVE_STOP); 1622 1616 1623 return VINF_SUCCESS; 1617 1624 } … … 1727 1734 if (version >= SHCROGL_SSM_VERSION_WITH_SAVED_DEPTH_STENCIL_BUFFER) 1728 1735 { 1729 CRASSERT(cr_server.currentCtxInfo == pContextInfo);1730 CRASSERT(cr_server.currentMural = pMural);1731 1732 1736 if (!pMural->width || !pMural->height) 1733 1737 return VINF_SUCCESS; … … 1781 1785 CRBufferState *pBuf = &pContext->buffer; 1782 1786 /* can apply the data right away */ 1783 CRASSERT(cr_server.currentCtxInfo == pContextInfo); 1784 CRASSERT(cr_server.currentMural = pMural); 1785 1787 CRASSERT(cr_server.currentCtxInfo == &cr_server.MainContextInfo); 1788 CRASSERT(cr_server.currentMural); 1789 1790 cr_server.head_spu->dispatch_table.MakeCurrent( pMural->spuWindow, 1791 0, 1792 pContextInfo->SpuContext >= 0 1793 ? pContextInfo->SpuContext 1794 : cr_server.MainContextInfo.SpuContext); 1786 1795 crStateApplyFBImage(pContext, &Data.data); 1787 AssertRCReturn(rc, rc);1788 1796 CRASSERT(!pBuf->pFrontImg); 1789 1797 CRASSERT(!pBuf->pBackImg); … … 1794 1802 crServerPresentFBO(pMural); 1795 1803 } 1804 1805 CRASSERT(cr_server.currentMural); 1806 cr_server.head_spu->dispatch_table.MakeCurrent( cr_server.currentMural->spuWindow, 1807 0, 1808 cr_server.currentCtxInfo->SpuContext >= 0 1809 ? cr_server.currentCtxInfo->SpuContext 1810 : cr_server.MainContextInfo.SpuContext); 1796 1811 } 1797 1812 else … … 1851 1866 } 1852 1867 1868 #define CR_DBG_STR_STATE_LOAD_START "VBox.Cr.StateLoadStart" 1869 #define CR_DBG_STR_STATE_LOAD_STOP "VBox.Cr.StateLoadStop" 1870 1871 if (cr_server.head_spu->dispatch_table.StringMarkerGREMEDY) 1872 cr_server.head_spu->dispatch_table.StringMarkerGREMEDY(sizeof (CR_DBG_STR_STATE_LOAD_START), CR_DBG_STR_STATE_LOAD_START); 1873 1853 1874 /* Load and recreate rendering contexts */ 1854 1875 rc = SSMR3GetU32(pSSM, &uiNumElems); … … 1900 1921 rc = crStateLoadGlobals(pSSM, version); 1901 1922 AssertRCReturn(rc, rc); 1923 1924 if (uiNumElems) 1925 { 1926 /* ensure we have main context set up as current */ 1927 CRMuralInfo *pMural; 1928 CRASSERT(cr_server.MainContextInfo.SpuContext > 0); 1929 CRASSERT(!cr_server.currentCtxInfo); 1930 CRASSERT(!cr_server.currentMural); 1931 pMural = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo.visualBits); 1932 CRASSERT(pMural); 1933 crServerPerformMakeCurrent(pMural, &cr_server.MainContextInfo); 1934 } 1902 1935 1903 1936 /* Restore context state data */ … … 1933 1966 CRASSERT(pMural); 1934 1967 } 1935 1936 crServerPerformMakeCurrent(pMural, pContextInfo);1937 1968 } 1938 1969 … … 1977 2008 pInitialCurMural = pContextInfo->currentMural; 1978 2009 1979 crServerPerformMakeCurrent(pMural, pContextInfo);1980 1981 2010 rc = crVBoxServerLoadFBImage(pSSM, version, pContextInfo, pMural); 1982 2011 AssertRCReturn(rc, rc); … … 1987 2016 } 1988 2017 1989 if (cr_server.currentCtxInfo != &cr_server.MainContextInfo) 1990 { 1991 /* most ogl data gets loaded to hw on chromium 3D state switch, i.e. inside crStateMakeCurrent -> crStateSwitchContext 1992 * to force the crStateSwitchContext being called later, we need to set the current context to our dummy one */ 1993 pMural = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo.visualBits); 1994 CRASSERT(pMural); 1995 crServerPerformMakeCurrent(pMural, &cr_server.MainContextInfo); 1996 } 2018 CRASSERT(cr_server.currentCtxInfo == &cr_server.MainContextInfo); 1997 2019 1998 2020 cr_server.curClient = NULL; … … 2150 2172 crVBoxServerCheckConsistency(); 2151 2173 #endif 2174 2175 if (cr_server.head_spu->dispatch_table.StringMarkerGREMEDY) 2176 cr_server.head_spu->dispatch_table.StringMarkerGREMEDY(sizeof (CR_DBG_STR_STATE_LOAD_STOP), CR_DBG_STR_STATE_LOAD_STOP); 2177 2152 2178 2153 2179 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.