Changeset 51141 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
- Timestamp:
- Apr 25, 2014 12:51:03 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r51121 r51141 146 146 } 147 147 148 static int crVBoxServerCrCmdDisablePostProcess(VBOXCRCMDCTL_HGCMENABLE_DATA *pData); 149 148 150 static void crServerTearDown( void ) 149 151 { … … 151 153 CRClientNode *pNode, *pNext; 152 154 GLboolean fOldEnableDiff; 155 GLboolean fContextsDeleted = GL_FALSE; 153 156 154 157 /* avoid a race condition */ … … 173 176 } 174 177 175 rc = crVBoxServerHgcmEnable(&EnableData); 176 if (!RT_SUCCESS(rc)) 177 { 178 WARN(("crVBoxServerHgcmEnable failed %d", rc)); 179 return; 180 } 178 crVBoxServerCrCmdDisablePostProcess(&EnableData); 179 fContextsDeleted = GL_TRUE; 181 180 182 181 CRASSERT(DisableData.pfnNotifyTermDone); … … 201 200 cr_server.currentMural = NULL; 202 201 203 /* sync our state with renderspu, 204 * do it before mural & context deletion to avoid deleting currently set murals/contexts*/ 205 cr_server.head_spu->dispatch_table.MakeCurrent(CR_RENDER_DEFAULT_WINDOW_ID, 0, CR_RENDER_DEFAULT_CONTEXT_ID); 202 if (!fContextsDeleted) 203 { 204 /* sync our state with renderspu, 205 * do it before mural & context deletion to avoid deleting currently set murals/contexts*/ 206 cr_server.head_spu->dispatch_table.MakeCurrent(CR_RENDER_DEFAULT_WINDOW_ID, 0, CR_RENDER_DEFAULT_CONTEXT_ID); 207 } 206 208 207 209 /* Deallocate all semaphores */ … … 217 219 218 220 /* synchronize with reality */ 219 fOldEnableDiff = crStateEnableDiffOnMakeCurrent(GL_FALSE); 220 if(cr_server.MainContextInfo.pContext) 221 crStateMakeCurrent(cr_server.MainContextInfo.pContext); 222 crStateEnableDiffOnMakeCurrent(fOldEnableDiff); 221 if (!fContextsDeleted) 222 { 223 fOldEnableDiff = crStateEnableDiffOnMakeCurrent(GL_FALSE); 224 if(cr_server.MainContextInfo.pContext) 225 crStateMakeCurrent(cr_server.MainContextInfo.pContext); 226 crStateEnableDiffOnMakeCurrent(fOldEnableDiff); 227 } 223 228 224 229 /* Free vertex programs */ … … 4170 4175 } 4171 4176 4177 4178 static DECLCALLBACK(bool) crVBoxServerHasDataForScreen(uint32_t u32ScreenID) 4179 { 4180 HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabled(u32ScreenID); 4181 if (hFb) 4182 return CrFbHas3DData(hFb); 4183 4184 return false; 4185 } 4186 4187 4172 4188 static DECLCALLBACK(bool) crVBoxServerHasData() 4173 4189 { … … 4218 4234 4219 4235 pSetup->MainInterface.pfnHasData = crVBoxServerHasData; 4236 pSetup->MainInterface.pfnHasDataForScreen = crVBoxServerHasDataForScreen; 4220 4237 4221 4238 rc = VINF_SUCCESS; … … 4236 4253 } 4237 4254 4238 int32_t crVBoxServerHgcmEnable(VBOXCRCMDCTL_HGCMENABLE_DATA *pData)4255 static int crVBoxServerCrCmdDisablePostProcess(VBOXCRCMDCTL_HGCMENABLE_DATA *pData) 4239 4256 { 4240 4257 int rc = VINF_SUCCESS; … … 4257 4274 } 4258 4275 4276 memset(&cr_server.DisableData, 0, sizeof (cr_server.DisableData)); 4277 4278 return VINF_SUCCESS; 4279 } 4280 4281 int32_t crVBoxServerHgcmEnable(VBOXCRCMDCTL_HGCMENABLE_DATA *pData) 4282 { 4283 int rc = crVBoxServerCrCmdDisablePostProcess(pData); 4284 if (RT_FAILURE(rc)) 4285 { 4286 WARN(("crVBoxServerCrCmdDisablePostProcess failed %d", rc)); 4287 return rc; 4288 } 4289 4259 4290 crVBoxServerDefaultContextSet(); 4260 4261 memset(&cr_server.DisableData, 0, sizeof (cr_server.DisableData));4262 4291 4263 4292 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.